ofek / hatch-vcs

Hatch plugin for versioning with your preferred VCS
MIT License
109 stars 15 forks source link

Version when .git root folder n levels up #70

Open infn-ke opened 2 months ago

infn-ke commented 2 months ago

How can I use the plugin to get the version when the .git folder is n levels up?

ethnB commented 2 months ago

@infn-ke

I've been using this configuration:

[tool.hatch.version]
source = "vcs"

[tool.hatch.version.raw-options]
root = "../"

to use a git repo one level above my package. Hope that answers your question.

infn-ke commented 2 months ago

Thanks @ethnB that worked!

JPHutchins commented 3 weeks ago

@infn-ke

I've been using this configuration:

[tool.hatch.version]
source = "vcs"

[tool.hatch.version.raw-options]
root = "../"

to use a git repo one level above my package. Hope that answers your question.

This worked for me as well. I suggest that the ticket can be closed when this ticket 1) links to the relevant documentation or 2) the relevant documentation is added.