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

gftools-add-font: support py3 #103

Merged
merged 1 commit into from
Jan 4, 2019
Merged

Conversation

m4rc1e
Copy link
Collaborator

@m4rc1e m4rc1e commented Dec 21, 2018

Script is still backwards compatible with py2.7+. I've only tested it on a handful of families.

I've had to implement a work around for the cmp function since py3 removed it. I used the python porting guide as a reference.

@garretrieger are you folks running a verion of python which is greater than or equal to 2.7? if not, I'll remove the use of functools.

I'm hoping to fix #89 soon. I may need help coordinating the fix so I don't break GF's internals.

@davelab6
Copy link
Member

Folks are running v2.7.13

@davelab6
Copy link
Member

https://twitter.com/FontTools/status/1074788792832266240 says

Important announcement! From January 2019, FontTools joins https://python3statement.org initiative and will begin to gradually drop support for Python 2. Only bug fixes are scheduled for py27 in the next 6 months, new features will require Python 3! 🐍🐍🐍 -

We should probably match that

@davelab6
Copy link
Member

@eliheuer please review

bin/gftools-add-font.py Outdated Show resolved Hide resolved
Script is still backwards compatible with py2.7.
@m4rc1e
Copy link
Collaborator Author

m4rc1e commented Jan 3, 2019

@eliheuer I'm done.

I've done the following since the first pr:

  • drop google-apputils because it's deprecated. Absl-py has replaced it
  • utils.download_file now uses requests instead of urllib (diff interfaces between py2 and py3)
  • py2 cmp function moved to utils

@eliheuer
Copy link
Contributor

eliheuer commented Jan 3, 2019

Nice, looking at this now.

@eliheuer
Copy link
Contributor

eliheuer commented Jan 4, 2019

It works, but for some reason bin/gftools-add-font.py is missing the python3 header. I'll merge this and make another PR. Thanks Marc!

@eliheuer eliheuer merged commit ff0249a into googlefonts:master Jan 4, 2019
@m4rc1e m4rc1e deleted the add-font-py3 branch January 4, 2019 08:44
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.

add-font -- failing with OSError: [Errno 20] No such directory: u'encodings/'
3 participants