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
Remove build hacks #1001
Remove build hacks #1001
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1001 +/- ##
==========================================
- Coverage 84.11% 84.08% -0.03%
==========================================
Files 34 33 -1
Lines 4727 4707 -20
==========================================
- Hits 3976 3958 -18
+ Misses 751 749 -2
|
Hi. |
Hatchling is the build backend we use in the scverse-cookiecutter template. Compared to flit-core, it’s less opinionated (doesn’t derive Its maintainer is also quicker with fixes and incorporation of new packaging standards. But as said: the main reason for this is that the |
I'm fine with going from flit to hatch, less sure on hatch-vcs. Does hatch-vcs add commit info, or is it all tag based? My recollection is that it will be wrong most of the time for development builds/ editable installs. Is hatch + setuptools-scm an option? See also: https://github.com/maresb/hatch-vcs-footgun-example |
See initial comment:
|
{name = "Alex Wolf", email = "f.alex.wolf@gmx.de"}, | ||
] | ||
readme = {file = "README.md", content-type="text/markdown"} | ||
readme = "README.md" |
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 recall this throwing errors if I didn't specify the content-type. Was that flit specific?
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.
not for many years: pypa/flit#169
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.
Pretty sure I was running into this more recently than that. But I believe twine check
was the one complaining, so it's fine as long as the build check is passing.
It's more that I don't see how setuptools-scm is being used from the changes. How does this not have the behavior described here:
|
To summarize our in-person discussion: There’s no way to have the version in the package metadata automatically up-to-date. It can only be updated when (dev-)installing your package anew. There’s a discussion about adding dynamic version metadata here The “Ideally”, we’d run that code in dev mode, and a simple |
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.
Review
Could we add a step to the build check where we check that the built package imports and has a __version__
?
One other point from discussion
We'd also discussed if we could strip out all the version finding logic and just hardcode the version for releases.
{name = "Alex Wolf", email = "f.alex.wolf@gmx.de"}, | ||
] | ||
readme = {file = "README.md", content-type="text/markdown"} | ||
readme = "README.md" |
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.
Pretty sure I was running into this more recently than that. But I believe twine check
was the one complaining, so it's fine as long as the build check is passing.
Co-authored-by: Isaac Virshup <ivirshup@gmail.com>
Also switches from flit-core to hatchling, but at this point, that’s just a backend change.
It uses
setuptools-scm
(via thehatch-vcs plugin
) as a build hook, so the version will ship in a generated_version.py
file.