Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3 Support #2003

Closed
renpytom opened this issue Sep 15, 2019 · 17 comments
Closed

Python 3 Support #2003

renpytom opened this issue Sep 15, 2019 · 17 comments

Comments

@renpytom
Copy link
Member

Since I've been getting a lot of people asking about this. Yes, Ren'Py is going to be ported to Python 3. That will very likely take place later this year, or early next year, once the OpenGL Rewrite that I'm working on is mature enough that I can spend some time on something else.

My goal is to keep releasing a Python 2.7-based Ren'Py 7 for several years after that, to allow older games to keep working on newer computer. At the same time, I'll to release Ren'Py 8, based on a Python 3.x version, for newer development.

It's important to realize that Python 2.7 will not stop working in 2020 or anytime soon. The games that work today will still work today, and new games created with Ren'Py 7 will still continue to work. Many of the advantages of Python 3, like unicode strings, have been adopted by Ren'Py. So while this is something that I plan to do soon, right now I'd like to focus on work that more directly improves what Ren'Py is capable of. (And to be honest, to focus on something I'd enjoy way more than getting the Python 3 stack up on a bunch of unsupported platforms.)

@thirdtruck
Copy link

Hi Tom! Looking for help with this?

I'm a Ren'Py user (http://www.anthrotari.com), fresh off of helping with a Python 2->3 migration for work, who wants to contribute something for Hacktoberfest (https://hacktoberfest.digitalocean.com). I'd be glad to get the ball rolling on this.

@danballance
Copy link

danballance commented Nov 1, 2019

Hi guys, how is the python 3 migration looking? I only ask because my brother is learning python in order to develop games with Renpy (great project btw!) and I've advised him to get his machine set up for python 3. Then we've realised you're actually running python 2 still. I'm a bit hesitant to advise him to start learning python 2 in 2019. Is the migration definitely going to happen or are you struggling to get the time and resources? (Completely understandable if you are of course!)

@LuqueDaniel
Copy link
Member

@danballance To develop games with Ren'Py it isn't necessary to setup a specific environment. In addition there isn't much difference between Python 2 and 3 in terms of syntax. Regarding the current status of Python 3 support, some contributors have been working on it recently.

@danballance
Copy link

Thanks for the pointer and update. Much appreciated :)

@darrickyee
Copy link

Hi, just wondering how the progress on this has been? I would like to use Ren'Py as a "frontend" to my game core but it relies on a lot of Python 3 functionality (RxPy 3, dataclasses, dict unpacking, preserving order of dict keys, type annotations, etc.). I noticed there is a "python 3" branch, but it looks like it hasn't been updated in quite some time?

@bircoph
Copy link
Contributor

bircoph commented Sep 1, 2020

It's important to realize that Python 2.7 will not stop working in 2020 or anytime soon. The games that work today will still work today, and new games created with Ren'Py 7 will still continue to work. Many of the advantages of Python 3, like unicode strings, have been adopted by Ren'Py. So while this is something that I plan to do soon, right now I'd like to focus on work that more directly improves what Ren'Py is capable of. (And to be honest, to focus on something I'd enjoy way more than getting the Python 3 stack up on a bunch of unsupported platforms.)

Yes, it will not stop working, but distributions are already removing python2-only packages and this means that RenPy will be ditched from most Linux distributions as well. One may argue that users still may use stand-alone renpy setups shipped with games, but many games does not provide builds for Linux — that's why we have renpy at distro level to have all games playable.

Of course users still may use RenPy from other sources: other games or some virtual environment with old python2 still available. But such ordeals will definitely degrade user experience and this is something we need to avoid.

So it would be very nice to know an ETA on when RenPy will be ported to python3.

@scruloose
Copy link

I just want to point out that the Python2 removal process in Debian testing has caught up with Ren'Py now. On my daily driver system (a laptop running Bullseye), sudo apt upgrade results in a message saying "the following packages have been kept back" in reference to libpython2-stdlib, python2, and python2-minimal. sudo apt dist-upgrade wants to resolve the problem by removing renpy, renpy-demo and renpy-thequestion (along with python-pygame-sdl2), and upgrading the aforementioned python2 packages.

So as of right now, anyone using Ren'Py on Debian Bullseye has to choose whether to let their system get increasingly out of sync with the Debian repos, uninstall Ren'Py, or try to hack together a solution with custom dummy packages or somesuch.

@Cybertwip
Copy link

What's left of porting to Python 3, is there a contribution guide? What about RAPT? Does it work on Android using Python 3?

@kcroker
Copy link

kcroker commented Nov 28, 2020

Yeah, was about to start some backend work to help a friend out with their Ren'Py game, and realized that its still running Python 2? People have commented that the syntax is not changed much, but many APIs have. A lot of the utility of Ren'py comes from the Python backend. Any comments on the port? @renpytom @thirdtruck

@Quantumdit
Copy link

Quantumdit commented Aug 3, 2021

Are there plans to move from Ren'Py 7 (Python2) to Ren'Py 8 (Python3) in the next while?

I know the Ren'Py Team (and renpytom especially) has its hands full with all the stuff they're working on, but I'm finding the lack of Python3 support to be a significant barrier.

I've had to implement several pieces of functionality that are part of the standard library in Python3. Additionally, I've got a few things I've left until the Python3 migration because they either depend on external libraries (almost all actively maintained libraries have dropped support for Python2) or because they're hampered by bugs that were fixed in Python3 but the fix was not backported to Python2.

At this point, I can't imagine any feature that would be more helpful for developing my game than Python3 support.

@darrickyee
Copy link

darrickyee commented Aug 13, 2021

I really hope this becomes the #1 priority soon. Python 2 has been EOL for more than half a year now...

[Edit] Wait, make that a year and a half. Wow.

@kcroker
Copy link

kcroker commented Aug 13, 2021 via email

@darrickyee
Copy link

RenPy savages python under the hood, destroying expected notions of scope and overloading extremely fundamental language constructs. So I can imagine that retooling for Python 3 might be close to a ground-up endeavor.

Interesting. It seems like that should motivate updating to Python 3 sooner rather than later! Otherwise adding more features means even more conversion work later...

@golfinq
Copy link

golfinq commented Sep 12, 2021

RenPy savages python under the hood, destroying expected notions of scope and overloading extremely fundamental language constructs. So I can imagine that retooling for Python 3 might be close to a ground-up endeavor.

I also imagine this is the issue as well. It is my understanding that renpy works by: turning the renpy source into an ast, then converting it into python, then manipulating python directly to achieve things like rollback and fast forwarding. (Ref: issue 301; The associated code is in ast.py, translation, parser.py, and python.py )

To stand on a soapbox, I don't see how a full conversion could be done by RenpyTom (the python3 branch of RenPy is 3 years out of date, and right now his focus seems to be on the model based renderer), or the community (Overall isn't very big or active on development). Based on the pull requests which pop up every so often, it seems the focus isn't on converting it to python 3, but is instead is on making it python 3 compatible. I am unsure of the plans, but this doesn't seem to be active enough to be occurring in the near future, ( Ref: #1100 , #1804 , Python 3 PR list ) and the focus on compatibility is going to become incredibly difficult as the python community actively removes python 2 compatibility. (Ref: Python 3.9 DeprecationWarning )

EDIT: It seems you can run some Python 3 code inside RenPy ( Ref? : parser.py ), irregardless I don't see RenPy compiling with Python 3 in the near future

Further EDIT: Apparently it is happening either later this year or next year. Looking forward to it!

@renpytom
Copy link
Member Author

I'd expect python3 to happen late this year or early next year.

@Vinccool96
Copy link

So, any updates on porting to Python 3?

@renpytom
Copy link
Member Author

Yes, there are Ren'Py 8 nightly builds being produced.

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

No branches or pull requests