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

Add git commit hash to version when not building wheel #2992

Merged
merged 2 commits into from
Mar 14, 2017

Conversation

pkch
Copy link
Contributor

@pkch pkch commented Mar 13, 2017

Fixes #2547

This detects whether we're building a wheel by searching for bdist_wheel among command-line arguments to setup.py. If it's not a wheel, then the full version (with git commit hash if available) is used.

setup.py Outdated
from mypy import git

git.verify_git_integrity_or_abort(".")

version = base_version
if 'bdist_wheel' in sys.argv[1:]:
Copy link
Member

Choose a reason for hiding this comment

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

We'll need a similar exception for 'sdist'. See the misc/upload-pypy.py script, it runs python3 setup.py bdist_wheel and python3 setup.py sdist.

Otherwise this seems to work and solves my problem, so thanks!

@pkch
Copy link
Contributor Author

pkch commented Mar 14, 2017

Oh I am on Windows, so I forgot that source distribution is a thing =)

@gvanrossum
Copy link
Member

LGTM. Will merge when tests pass.

@gvanrossum gvanrossum merged commit b418a9f into python:master Mar 14, 2017
@gvanrossum
Copy link
Member

Thanks!

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.

2 participants