-
Notifications
You must be signed in to change notification settings - Fork 12
Use hatch in github actions #373
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
Conversation
A PR has been generated to the instance repo: You can check out the PR to preview your changes |
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.
Great!
I think @flying-sheep should ultimately approve this.
Generally, we are now really all-in on Hatch and I would not be surprised if uv
expanded its scope in a year or two and we go all in on uv
. It's still okay with me to commit more to Hatch now because well, we already use it in so many parts.
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.
Looking good, this certainly deduplicates things conceptually and makes everything easier to grasp.
The following collapsed section is #374
Details
Before I start: The “changes requested” is basically only because this PR should also get rid of the doc
and test
extras and move the doc deps and test deps into the respective hatch env configs. These extras are artifacts of using standard tooling in CI, and there is no need to expose them to users of the package when using Hatch in CI1.
OK: there are two schools of thought here:
- Before this PR: stick with standard tooling throughout everything to minimize lock-in with the build tool and keep things as simple as possible2.
- This PR: keep local development as close to what happens in CI
I think both approaches are valid. So this PR will make things as close to a local dev environment as possible at the cost of being slightly less debuggable if they break, e.g. there are now two environments in CI (system and hatch-test), not just the system one, but people should be used to that anyway.
Footnotes
-
There is discussion about introducing the concept of dev dependencies to standard Python project metadata: PEP 735. Until then, when a package wants to export a test utilities subpackage (e.g.
testing.mypackage
ormypackage.testing
or so), the package can define atesting
extra for users and use it from Hatch together withenvs.hatch-test.dependencies
likeenvs.hatch-test.features = ["testing"]
. ↩ -
Note that I use “simple” in the same way a VW Beetle or Arch Linux are simple: “Use the most standard set of parts possible so everything is maximally debuggable when things break” ↩
Hatch is currently by far the best environment manager (i.e. alternative to tox), this is why we use it. So keep in mind that unless uv expands into that territory, it’s no alternative to what we use Hatch for IMHO. |
Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net>
Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net>
Co-authored-by: Philipp A. <flying-sheep@web.de>
Co-authored-by: Philipp A. <flying-sheep@web.de>
Co-authored-by: Philipp A. <flying-sheep@web.de>
OK, I made #375 for an alternative approach, let’s discuss there! |
I’m a bit confused why tests fail here. The Apart from this, I think this looks great! |
I don't get it either. The package-lock.json of the v1.9.4 release seems to pin the correct package versions. Is |
Ah I got it, we’re asking for that. (I mean, yeah, the fact that pre-commit updates to pre-releases is weird, but nothing new)
Maybe we should stop doing that? We keep the template updated nicely at all times anyway |
This is an attempt to move all CI scripts to
hatch
wherever possible. Not sure if we want that in all cases, but at least for runningpytest
it makes sense as it simplifies the CI script quite a bit and thepyproject.toml
becomes the single point of truth on how to run tests.Cheers,
@grst