-
Notifications
You must be signed in to change notification settings - Fork 13
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
[ttx_diff] Use pip-compile and requirements.in #1090
Open
cmyr
wants to merge
1
commit into
main
Choose a base branch
from
use-pip-compile
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+343
−116
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,14 +22,17 @@ script in the [`fontc_crater` repo][crater-repo] and results are posted to | |
To run in CI mode locally to play with the html output: | ||
|
||
When run in CI, we want to ensure that we have complete control over the set of | ||
python pacakges we are comparing against; to ensure this we use `constraints.txt` | ||
in the root `resources/scripts` directory. To update the set of python packages | ||
in use, you need to update this file: | ||
python pacakges we are comparing against; to ensure this we use `pip-compile` | ||
(part of [`pip-tools`]) to generate a pinned `requirements.txt` from a | ||
`requirements.in` file in the root `resources/scripts` directory. To update the | ||
set of python packages in use, you need to update this file: | ||
|
||
- `rm -rf` your existing venv | ||
- create a new venv and activate it | ||
- `pip install -r resources/scripts/requirements.txt` | ||
- `pip freeze > resources/scripts/constraints.txt` | ||
- install pip-tools with `python -m pip install pip-tools` | ||
- delete `resources/scripts/requirements.txt` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think you need to delete it as it will be overwritten, but it's ok |
||
- run `pip-compile resources/scripts/requirements.in` | ||
- commit the new `requirements.txt` file. | ||
|
||
```shell | ||
# clone [email protected]:googlefonts/fontc_crater.git somewhere, we'll assume at ../fontc_crater | ||
|
@@ -45,5 +48,4 @@ $ cargo run --release -p=fontc_crater -- ci ../fontc_crater/gf-repos-2024-09-23. | |
[rust-lang/crater]: https://github.com/rust-lang/crater | ||
[crater-repo]: https://github.com/googlefonts/fontc_crater | ||
[crater-results]: https://googlefonts.github.io/fontc_crater/ | ||
|
||
|
||
[`pip-tools`]: https://github.com/jazzband/pip-tools |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
absl-py | ||
# keep fontmake version pinned to ensure output from ttx_diff.py is stable; | ||
# the 'repacker' option enables faster GSUB/GPOS serialization via uharfbuzz | ||
fontmake[repacker]==3.10.0 | ||
# technically fonttools is in turn a dependency of fontmake but a few of | ||
# our scripts import it directly, so we list it among the top-level requirements. | ||
fonttools | ||
lxml | ||
cdifflib | ||
glyphsLib | ||
# our custom branch of gftools | ||
git+https://github.com/googlefonts/gftools.git@fontc-flag-sketch |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one doesn't need to delete and create a new venv when using pip-compile, it may well run from a global site-packages (e.g. I install it globally with
pipx install pip-tools
) as pip-compile does not modify its environment.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
installing something in a venv is generally good practice especially when developing onto something, in this case we are simply using a development tool and it's not a requirement that it runs within a venv, so I don't think you should mention this here