-
Notifications
You must be signed in to change notification settings - Fork 122
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
Add build-system to pyproject.toml for PEP 517 (-m build) #323
Conversation
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #323 +/- ##
=======================================
Coverage 96.78% 96.78%
=======================================
Files 20 20
Lines 1183 1183
Branches 106 106
=======================================
Hits 1145 1145
Misses 20 20
Partials 18 18 Continue to review full report at Codecov.
|
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.
It looks good. Thanks.
I guess thare are many ways to do it.
As long as the Ci works, I am happy with any solution pushed by @altendky :)
Thanks!
python -m build --sdist --outdir ${toxinidir}/dist/ ${toxinidir} | ||
tar -xvf ${toxinidir}/dist/* | ||
cd * | ||
# build the wheel from the sdist |
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.
Why do we need to build the wheel from the sdist, and not build the wheel directly? Feels like you don't need this indirection, you're only testing the correctness of setuptools backend at best.
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.
It makes sure that the sdist was in the path of what is tested. Trio does it. Made enough sense to me to do it too. I don't know what errors I might be able to have that could make a wheel work but an sdist be broken. It may well be 'excessive' but it do you see harm that it could do? The overall goal is to make sure that the actual files to be published are what is tested. Not just that 'some wheel built in some situation is tested'. Likewise for sdist.
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.
https://twistedmatrix.com/trac/ticket/10103 would have been caught if I'd have used this strategy
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.
If you go down this path why not also test that direct wheel build works? I'm sure they'll be some edge case in some situation when src to sdist works, sdist to wheel also, but src to wheel does not 🤷♂️
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.
And it's not some wheel in some situation. The builder ensures it's a pep 517/518 situation.
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.
How do you generate your packages to upload to pypi?
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.
This code that we are discussing. They are built, archived in GitHub Actions. Downloaded for tests and checks. If all is still well, they are downloaded and then published to PyPI. At least that is the presently-being-developed workflow. This PR does the first bit, #315 is adding the automated PyPI upload.
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.
I see, thanks 👍🏻
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.
Perhaps you want a wheel-from-sdist option for build
project so you don't have to do this dance 🤷🏻
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.
Maybe. We'll see what everyone else thinks I guess. pypa/build#257
Like #314 but with a prebuild step using build instead of tox-wheel integrated into the tox run. It has been expressed that tox-wheel has the added benefit of being the same thing in CI and locally. I do like this but something about that setup is broken with PyPy on Windows, and this works... Also, using tox-wheel in CI is a bit odd since every tox environment in every job would be rebuilding the wheel rather than building it once and testing that to-be-published artifact everywhere. So, I think some drawbacks both ways. Also, not being the same as Twisted is a downside. Then again, Twisted isn't testing on PyPy on macOS or Windows.
Note that the code in
tox_build.sh
can't be put intox.ini
since it uses wildcards and tox doesn't support those (but yay, tox 4.1 maybe will).