store project metadata in pyproject.toml#45
Conversation
zzzeek
left a comment
There was a problem hiding this comment.
OK but let's use hatch
the commit you see for example at sqlalchemyorg/zzzeeksphinx@84607bb I did like this:
hatch new --init
boom, there's your pyproject.toml file. I was going to use hatch for all the sqlalchemyorg stuff
|
Sure thing, just to confirm, https://github.com/sqlalchemyorg/zzzeeksphinx/ seems to have been storing the version in its Edit: I meant .github/workflows/scripts/update_version.py, but .github/workflows/release.yml interacts with it quite a bit. |
yes
this has buzzed past my knowledge of these tools. This looks like the release action that @CaselIT wrote for this. What happens to it? |
|
the idea there was that the release pipeline would:
I don't see much issues in keeping the same flow also if we were to update to pyproject |
I think it would make sense to do this in another PR |
If my understanding of .github/workflows/scripts/update_version.py and the release pipeline are correct, as of right now that's what happens. FWIW did manually test update_version.py to try and up my confidence in it still working as expected. However, with the move to hatch, update_version.py might no longer be necessary by using and parsing output from hatch itself (https://hatch.pypa.io/latest/version/#updating) |
|
it's not clear what that command does. It goes and edit the python file so that it has the new version? from my point of view it's fine to keep it in the pyproject file only |
|
@zzzeek you prefer having hatch added to this pr? personally since this seem to work i would leave as is so we can merge and release 0.7 |
|
So release.yml relies on setuptools ? Otherwise why does it matter ? |
|
Not really. Meaning it relied on how things worked before. Now it resiel on how things work with this pr, if we add hatch it will have to rely on how hatch works. Overall it's likely the same either with any way we want to go with this |
|
release.yml seems to be reliant on the hardcoded version in setup.cfg but otherwise doesnt care about setuptools. can we do a separate PR that updates release.yml and setup.cfg to use a normal version in |
|
doesn't really make much sense since this pr already changes both of them. so if anything I would do such a change after this pr or in this pr. also need to look at how hatch version upgrade works, since if it's only for the pyproject defined case I thing it would make sense to keep the version only in pyproject |
|
Hatch can parse and upgrade versions from an arbitrary file using an arbitrary regex. Configured via the |
|
@zzzeek it's fine either way for me, I just want to release a new version of zimports. |
|
OK so ultimately I want:
how can we get there? |
|
Well we can either do that change here or in a follow up. |
|
I'm open to making the hatch switch in this PR or another The only things I'm not clear about are how to keep the functionality release.yml already has and how to test my approach(es) without making a release by accident. Maybe @CaselIT you have some useful pointers in that regard |
|
OK @CaselIT can we merge this as-is with the setuptools version which assumes we do not need to change release.yml in any way, is that correct? |
|
release.yml should work with the changes in this pr.
it should be easy do to, we replace the current script with |
|
created #48 for hatch |
I think we could also remove the functionally empty setup.py (could be added if that's ok).