mirror of
https://github.com/mnauw/git-remote-hg.git
synced 2025-11-01 00:55:48 +01:00
Move release version management to make stage
... to ensure setup.py does not trip some later time. Fixes mnauw/git-remote-hg#25
This commit is contained in:
2
Makefile
2
Makefile
@@ -27,6 +27,8 @@ install-doc: doc
|
|||||||
install -m 644 doc/git-remote-hg.1 $(D)$(mandir)/git-remote-hg.1
|
install -m 644 doc/git-remote-hg.1 $(D)$(mandir)/git-remote-hg.1
|
||||||
|
|
||||||
pypi:
|
pypi:
|
||||||
|
version=`git describe --tags ${REV}` && \
|
||||||
|
sed -i "s/version = .*/version = '$$version'/" setup.py
|
||||||
-rm -rf dist build
|
-rm -rf dist build
|
||||||
python setup.py sdist bdist_wheel
|
python setup.py sdist bdist_wheel
|
||||||
|
|
||||||
|
|||||||
9
setup.py
9
setup.py
@@ -5,15 +5,8 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
# derive version from git repo
|
|
||||||
cmd = ["git", "describe", "--tags"]
|
|
||||||
commit = os.environ.get('REV', None)
|
|
||||||
if commit:
|
|
||||||
cmd.append(commit)
|
|
||||||
process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
|
||||||
version = process.communicate()[0].strip()
|
|
||||||
# strip leading v
|
# strip leading v
|
||||||
version = version[1:]
|
version = 'v1.0.0'
|
||||||
|
|
||||||
# check for released version
|
# check for released version
|
||||||
assert (len(version) > 0)
|
assert (len(version) > 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user