Skip to content

Add the "source" key as option to hatch.version #4581

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

Merged

Conversation

relativityhd
Copy link
Contributor

Hi all,
I noticed that the hatch.version.source option used by tools like uv-dynamic-versioning is not recognized by the json, even if it stated in the hatch documentation.
Hope this fix is the way you want it to be. :)

Copy link
Contributor

Thanks for the PR!

This section of the codebase is owned by @madskristensen and @hyperupcall - if they write a comment saying "LGTM" then it will be merged.

@hyperupcall
Copy link
Member

Thanks! The patch is great but it looks like CI is failing

@relativityhd
Copy link
Contributor Author

@hyperupcall I needed to remove the overconstraint for the hatch-vcs case. Now the tests are working. I would interpret the docs of hatch so, that the "source" is an alternative to the "path" + "pattern" settings in all cases, not just hatch-vcs, thats why I think removing the overconstraint is correct.
However, I am not very deep into the topic, so I may be incorrect.

@ninoseki
Copy link

ninoseki commented Mar 30, 2025

Just FYI for reviewers. Hatch's version source (= hatch.version.source) can have an arbitrary string (= a plugin's name).

For example, Hatch officially have regex, code and env plugins:

And also there are 3rd party plugins like uv-dynamic-versioning. So allowing only vcs is not good.

@eggplants
Copy link

@hyperupcall Could you review this again? Tests are passed for now.

@hyperupcall
Copy link
Member

Thanks! Sorry for the late merge

@hyperupcall hyperupcall merged commit f142680 into SchemaStore:master May 7, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants