Skip to content

Python 3 with future#15

Closed
rardiol wants to merge 49 commits intosingularity:masterfrom
rardiol:python3b
Closed

Python 3 with future#15
rardiol wants to merge 49 commits intosingularity:masterfrom
rardiol:python3b

Conversation

@rardiol
Copy link
Contributor

@rardiol rardiol commented May 29, 2016

A python 2/3 compatible Singularity, using future. Please note the end result wasn't extensively tested yet.

First the setuptools update from the other PR, then some general improvements needed for the porting, then making the game run with future on py2, then some extra fixes and changes.

I'm sure at least something broke save game compatibility, so I bumped version. 9c9c97c

A proper refactoring for the use of bisect for handlers is probably necessary. Old one broke because py3 removed method comparison, right now it just sorts normally. 5428ed7

I've had some trouble with the relative circular imports, so there's a lot of absolutely imported singularity.code.g.foo around the code now. d7081e1

By running "python2 -3", I found a few cases of floor division, and made those explicit. However I'm not 100% sure they're supposed to always be floor. All others divisions became future's olddiv (= py2's /). A lot of those are clearly supposed to be float. f591ccf and 079caf8

In addition to division, some of the automatically done changes may be done in a better way with py3 style code, with iterators and so on.

I unbundled polib because I don't like bundling, it was out of date and pip is supposed to make installing deps trivial. I can revert if desired.

pygame is not on pypi yet, and 1.9.1 is py2 only. If you want to test you need to download a pre-release of 1.9.2 from their repository https://bitbucket.org/pygame/pygame/downloads

@MestreLion
Copy link
Member

This is a much welcome improvement, but IMHO it should wait until (if?) pygame, being the game's main dependency, gets properly packaged to Python 3, in both PyPy and Debian repositories.

@rardiol
Copy link
Contributor Author

rardiol commented Oct 15, 2017

I don't use debian myself, but:

https://pypi.python.org/pypi/Pygame/1.9.3 shows py35 and 36
https://packages.debian.org/sid/python3-pygame

Is there something wrong in those packages? You want to wait until it hits debian (un)stable?

@Xenega Xenega added this to the 2.0 milestone Mar 31, 2018
@nthykier nthykier modified the milestones: 2.0, 1.0 Aug 10, 2019
@nthykier
Copy link
Member

The singularity game is now running on python3. While we did not merge this branch as it was, we did cherry-pick several commits from it and it was also very valuable as a reference for issues seen in the code base.

Many thanks to @rardiol :)

@nthykier nthykier closed this Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants