Skip to content
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

fix: support getting git info on a tag #5

Merged
merged 1 commit into from
Oct 1, 2021
Merged

Conversation

henryiii
Copy link
Collaborator

Closes #4 with a suggested possible fix.

@FFY00
Copy link
Owner

FFY00 commented Sep 20, 2021

Sorry for the delay! I think I will be using setuptools_scm for this. I will keep this open in the meanwhile, but if everything goes according to plan, it should not be needed 😅

@henryiii
Copy link
Collaborator Author

Didn't see it in the changelog, does 0.0.4 support this, or is automatic tagging from an actual tag still unsupported?

@FFY00
Copy link
Owner

FFY00 commented Sep 30, 2021

No, I am waiting for pypa/setuptools_scm#580, but I guess we could merge this in the meanwhile.

@henryiii
Copy link
Collaborator Author

Was hoping the release would clean up some of my workarounds, but this one and pypa/twine#753 are the main problems.

@FFY00 FFY00 enabled auto-merge (rebase) September 30, 2021 20:19
@henryiii
Copy link
Collaborator Author

And the missing /src support.

@FFY00
Copy link
Owner

FFY00 commented Sep 30, 2021

That one is fixed, 2.2 metadata will only be used when needed. I guess I can make a new release with this PR.

@FFY00
Copy link
Owner

FFY00 commented Sep 30, 2021

And the missing /src support.

Ah, yes. I will add an option for that and make a release after.

@henryiii
Copy link
Collaborator Author

Great, will remove the 2.2 workaround then.

@henryiii
Copy link
Collaborator Author

Okay, as soon as you do, I'll update. Since you don't use GitHub releases so subscribing doesn't do anything, I'll just check back occasionally.

@henryiii
Copy link
Collaborator Author

I can easily add a test to fix coverage if you want me to.

@henryiii
Copy link
Collaborator Author

(Basically just asking for a mutex lock, in case you have started doing it already)

auto-merge was automatically disabled September 30, 2021 20:31

Head branch was pushed to by a user without write access

@henryiii
Copy link
Collaborator Author

Done.

@henryiii
Copy link
Collaborator Author

PS https://github.com/github/gitignore/blob/master/Python.gitignore is a good source for a CC0 gitignore basis. ;) I immediately noticed that __pycache__ was not ignored locally.

@FFY00 FFY00 enabled auto-merge (rebase) September 30, 2021 21:52
@FFY00
Copy link
Owner

FFY00 commented Sep 30, 2021

Seems like the tests are failing due to fragile version unpacking. Perhaps we could just use setuptools_scm.version.tag_to_version.

@henryiii
Copy link
Collaborator Author

Nah, I accidentally put the output before the patch into the monkey patched tests. I'm dumping a real output (grabbed from a random repository) in now.

def test_vcs_git_repo_exact(mocker, package_no_version):
mocker.patch(
'subprocess.check_output',
side_effect=[b'v2.1.1-0-g5ce8958'],
Copy link
Collaborator Author

@henryiii henryiii Sep 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole point of the patch is so that the output will always look something like this; adding --long will always produce the last two items. The tests originally didn't have the last two items.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it might be broken. :) I can look into it in a little bit.

Signed-off-by: Filipe Laíns <lains@riseup.net>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@FFY00 FFY00 merged commit 6ec90b0 into FFY00:main Oct 1, 2021
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.

Exactly sitting on a tag fails
2 participants