-
Notifications
You must be signed in to change notification settings - Fork 2
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
Making minimal sized sdist
and whl
using pyproject.toml
#587
base: main
Are you sure you want to change the base?
Conversation
[tool.hatch.build.targets.sdist] | ||
include = ["requirements.torch.txt", "/everyvoice"] | ||
exclude = [ | ||
"*.coveragerc", | ||
"*.ipynb", | ||
"*.psv", | ||
"*.pyc", | ||
"*/.schema/*.json", | ||
"*~", | ||
".git", | ||
".github", | ||
".gitlint", | ||
".pre-commit-config.yaml", | ||
"LICENSE", | ||
"README.md", | ||
"pyproject.toml", | ||
"readme.md", | ||
"requirement*txt", | ||
"setup.cfg", | ||
"setup.py", | ||
"tests/", | ||
# ".gitignore", # Needed/Used by hatch to filter-out files | ||
] | ||
|
||
[tool.hatch.build.targets.wheel] | ||
# sources = ["/everyvoice"] | ||
include = ["requirements.torch.txt", "/everyvoice"] | ||
exclude = [ | ||
"*.coveragerc", | ||
"*.ipynb", | ||
"*.psv", | ||
"*.pyc", | ||
"*/.schema/*.json", | ||
"*~", | ||
".git", | ||
".github", | ||
".gitignore", | ||
".gitlint", | ||
".pre-commit-config.yaml", | ||
"LICENSE", | ||
"README.md", | ||
"readme.md", | ||
"requirement*txt", | ||
"setup.cfg", | ||
"setup.py", | ||
"tests/", | ||
] | ||
|
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.
Should I fold these two under [tool.hatch.build]
since there are almost identical?
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.
Does that work? I didn't think that was possible, but if there is a way to list all this just once, yes, absolutely!
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #587 +/- ##
=======================================
Coverage 76.58% 76.58%
=======================================
Files 46 46
Lines 3451 3451
Branches 470 470
=======================================
Hits 2643 2643
Misses 706 706
Partials 102 102 ☔ View full report in Codecov by Sentry. |
|
sdist
and whl
using pyproject.toml
For ReadAlongs/Studio, the equivalent code (scroll to pyproject.toml lines 94-97) is much shorter, so I was surprised you had to have all these exclusions here, but EV has all these files deeper, so we probably can't remove this list. You can shorten it a tiny bit by finding patterns that express the sames things in a shorter way, but that's of little value, One detail: TLDR: the changes I suggest are:
|
PR Goal?
Turns out that our understanding of
pyproject.toml
withhatch
was insufficient.This PR aims to reduce what is included in a
sdist
andwhl
.We decided to remove all
tests/
because they would require us to include the wav files and more which bloats thewhl
andsdist
.Fixes?
fixes: #586
Feedback sought?
This PR as a long and explicit list of inclusions and exclusions, is this the best way of doing what we want to achieve?
Priority?
Needed before our next release
Tests added?
None
How to test?
Get yourself some reference prebuild
whl
andsdist
files.Compare the content of each files with its reference.
sdist
Wheel
Access to the unittest
After making a new environment with
make-everyvoice-env
, we can still performpython -m unittest everyvoice.tests.test_dataloader
even if thetests/
directory wasn't included in thewhl
.Confidence?
fair
Version change?
no
Related PRs?
None