-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Git archives full support #580
Git archives full support #580
Conversation
Yay! This should probably also deprecate https://github.com/pypa/setuptools_scm/#notable-plugins and conversely describe how to use .git_archival.txt since unlike hg it's not automatic... |
a387613
to
4282060
Compare
@eli-schwartz i noted another key issue with the approach - almost all the tags in the wild are non-annotated, git only supports this for annotated tags i will have to eventually implement tools to help this mess :( |
Historic tags cannot have %(describe) injected anyway, so this concern is limited to documenting and raising awareness that when adding full archive support, one must switch to annotated tags. Personally, I would use annotated tags anyway, you need them for PGP signatures and they let you add release notes automatically etc. Actually supporting them in git archive, would presumably entail adding an additional option to |
@eli-schwartz the problem is that it creates extra issue users have to be aware of and platforms don't necessarily support it nicely so we can kind of expect to see users with light tags realizing the feature doesn't work for them over the next years as people start to use it |
Ah, looking at src/setuptools_scm/git.py it appears setuptools_scm always assumed lightweight tags are candidates, which does seem unfortunately inconsistent. The two solutions I can see are:
|
@eli-schwartz i believe both are necessary - an error will happen and inform the users of the missing annotated tags, as thats what they will have to use |
a44c0c3
to
4bf964c
Compare
So this just needs an addition to check what kind of tag the project is using and raise an error, and then it is good to merge? |
@RonnyPfannschmidt any updates on this? |
Unfortunately nope, other items took priority |
@RonnyPfannschmidt good news!
I've implemented support for I'm currently at v2 of the patchset to resolve some review feedback, but the git maintainer likes the change overall so I have high hopes for it being in Git 2.34, which means that...
Not anymore you don't. :) |
Very awesome, exciting, it's just a big yay moment |
I had originally missed the boat for this feature to land in git 2.34 (I was cutting it close to the feature freeze to begin with, and unfortunately it got held back until the next cycle). So, I've been keeping an eye on its status waiting for some more definitive news. That news is now here. As of git/git@6ba65f4 my patchset is merged to git.git master and documented in the third batch as git/git@69a9c10#diff-4ddaeae40f2e69479747ed61ad12f9d74d1d9acd7dcc7c4298439987ff6d280cR41-R43 So, it is now guaranteed to be present (after a bit of waiting) in git 2.35. 🎉 |
When I read the 2.35 GitHub release announcement |
@henryiii yup, @eli-schwartz did the awesome job on doing the git side, im very grateful for that |
I'm very excited to see my change make it's way into production on GitHub and hopefully into a setuptools_scm version nearby! :D ;) |
What's the status of this, BTW? :) |
Personal life got in the way, i hope to hack it together in the easter vacation, but the toddler has a "slight" priority |
422f83c
to
64aa510
Compare
0fe2a45
to
ffb409b
Compare
@paugier it seems that while fixing some typing issues i missed how i broke hg_git support - i tried some initial fixes but i hit a change blindness spot, please take a look |
src/setuptools_scm/hg_git.py
Outdated
return None, None, None | ||
hg_tags = hg_tags.split() | ||
return _FAKE_GIT_DESCRIBE_ERROR | ||
hg_tags: set[str] = set(hg_tags_str.split()) |
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.
The order is important. One cannot use a set.
hg_tags: list[str] = hg_tags_str.split()
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.
FYI, I've also seen people use a dict[str, None]
for an ordered set, if you actually need the set behavior. Not ideal, but does work and is pretty fast. (Assuming you don't and list is better, but just pointing it out)
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.
list should be fine actually, thanks for pointing out, unfortunately not the fix yet
00d0b8c
to
a4bb52b
Compare
f7d16d2
to
6707c4f
Compare
I'm so excited to see this land and use this! Thank you so much for all you hard work on this |
This one has been dragging and screaming |
Yay, it's finally here!!! :D 🎉 |
Release triggered, finally |
Completes pypa#580 by dropping the “Notable Plugins” section and creating a new “Git archives” subsection under “Builtin mechanisms for obtaining version numbers”.
Completes pypa#580 by dropping the “Notable Plugins” section and creating a new “Git archives” subsection under “Builtin mechanisms for obtaining version numbers”.
fixes #65
fixes #578