Skip to content
This repository has been archived by the owner on Sep 8, 2023. It is now read-only.

gftools and virtual environment #74

Open
RosaWagner opened this issue Jul 14, 2020 · 7 comments
Open

gftools and virtual environment #74

RosaWagner opened this issue Jul 14, 2020 · 7 comments

Comments

@RosaWagner
Copy link
Contributor

RosaWagner commented Jul 14, 2020

I would like to add informations in the gf docs about how to handle gftools/fontmake etc. with a virtual environment. I have a poor experience when it comes to that, and when I tried, I had conflicts with tools already installed locally. How do you proceed yourself? I saw in some threads that some of you are using one venv per project for example.

@m4rc1e
Copy link
Contributor

m4rc1e commented Jul 14, 2020

You should have a virtualenv for each project since you then have individual control over each project's dependencies.

The virtualenv docs are pretty stellar, https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment

@m4rc1e
Copy link
Contributor

m4rc1e commented Jul 14, 2020

All upstream repos should include installation instructions in the README e.g https://github.com/TypeNetwork/Roboto#install.

Also, you shouldn't commit the virtualenv to version control, only a requirements.txt file.

Perhaps we should just add a few notes to https://github.com/googlefonts/gf-docs/tree/master/Spec#upstream-repos?

I don't want us to write too much about this section since there are many tutorials and official docs that cover dependency management better than we can.

@RosaWagner
Copy link
Contributor Author

OK (with an install process updated for python 3 probably).

@eliheuer
Copy link

eliheuer commented Jul 14, 2020

I'm a bit out of the loop, but I'm reasonably happy with the build script I wrote here: https://github.com/eliheuer/blue-ocean/blob/main/sources/build.sh

This script builds, sets up, and removes a Python 3 virtual environment as part of the script. My goal was to make the build process as easy as possible for new users and that the whole process should happen in "one step". There is even an optional -gf flag that, after all the build steps are done, updates and moves all the needed files to~/Google/fonts/ofl/... in exactly the way they are needed to make a new PR.

@RosaWagner
Copy link
Contributor Author

Thanks Eli !
The GF pull request makes it a bit complicated though. I personally prefer to separate what happens in the upstream repo and what happen in google/fonts repo.

@m4rc1e
Copy link
Contributor

m4rc1e commented Jul 15, 2020

We also have @graphicore's packager arriving soon which will eliminate the need for users to manually pr to google/fonts.

@graphicore
Copy link
Contributor

We also have @graphicore's packager arriving soon which will eliminate the need for users to manually pr to google/fonts.

Right, but you got to commit and push the fonts to the upstream to make a proper PR, because we now record the commit hash in METADATA.pb. For local "testing" you'll still need to make a commit locally.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants