-
Notifications
You must be signed in to change notification settings - Fork 12
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
* Python3: Update code to work with python3 #19
Conversation
Awesome! "ruamel.yaml is needed as the yaml library." Why? |
Hmm.. I'm not sure. I used it in another project, so I guess I thought it needed to be changed. I can try switching it back to pyyaml. |
Okay, it works fine with PyYaml. I've also added a requirements.txt to this project so you can just |
I pushed an update to make it compatible with either python 2 or 3 (whichever is in the path first as |
I was trying to build eosrei/twemoji-color-font, and realized this now needs Python3 on Ubuntu 20.04. I ran
Other than that... it seems like it works without the usual Python stacktraces when trying to run on Python3. |
Considering Python 3 support, I should add one last set of details to consider:
Python 3 MigrationArch Linux Details:It appears that Also according to the following info on ArchWiki:
ReferencesDebian / Ubuntu Details:Based on some quick research on the state of Python 3 in Debian & Ubuntu,
So, just using References:
Gentoo Details:The shebang line will work on this distro! The References:Official Python PEP recommendations:We're well into the End of Life of Python2, according to PEP 373:
Based on the distro-specific inconsistencies still existing with
At the very least, this upstream project should probably think about documenting the choice in shebang line so users, new developers and/or package maintainers don't get confused or bitten by the hidden complexities across different distros & platforms. References: |
scfbuild requires your fontforge installation to be built with the binding for the current python version. I know at least that Ubuntu 18.04 was shipping than as for python2, so this PR doesn't break that: it's assuming whatever is |
(Or simply disregard the shebang like |
Sorry, I didn’t mean to dump so much info in a confusing way as to say that there are not many valid solutions (which, including this one there are) I think the main “executive summary” I was able to consolidate from all this was that it will probably work fine on most targeted distros that have moved to python3. For those like Debian (and also probably RHEL / CentOS), the shebang line becomes a packager’s responsibility to rewrite for that platform. The Python PEP recommendations state it well:
|
I'm working on this now. I'm going to leave Python2 support in the code, but am changing the startup script to refer directly to Python3. Thanks for all your work on this!
|
Works well. I've decided to default to python3 in the shebang due to the Py2 EOL. Thank you @earboxer for figuring this out! :D |
Close #18
Note that dependencies are now that fontforge needs to be installed with python3 bindings (
--enable-python-scripting=3
), andruamel.yaml
is needed as the yaml library.