Fix version when installing from sdist

When installing an sdist, setup.py is invoked on the machine you're installing on. We extract the version from a git tag, but the repo is not included in the sdist. The git describe --long command will silently fail and cause the installed package to report version 0.0.0.0.
This commit is contained in:
Shane McDonald
2017-07-25 10:54:42 -04:00
parent 0cf376ca6f
commit 7695cb6419
4 changed files with 16 additions and 5 deletions

View File

@@ -86,7 +86,7 @@ UI_RELEASE_FLAG_FILE = awx/ui/.release_built
reprepro setup_tarball virtualbox-ovf virtualbox-centos-7 \
virtualbox-centos-6 clean-bundle setup_bundle_tarball \
ui-docker-machine ui-docker ui-release ui-devel \
ui-test ui-deps ui-test-ci ui-test-saucelabs jlaska
ui-test ui-deps ui-test-ci ui-test-saucelabs jlaska VERSION
# remove ui build artifacts
clean-ui:
@@ -117,6 +117,7 @@ clean: clean-ui clean-dist
rm -rf requirements/vendor
rm -rf tmp
rm -rf $(I18N_FLAG_FILE)
rm -f VERSION
mkdir tmp
rm -rf build $(NAME)-$(VERSION) *.egg-info
find . -type f -regex ".*\.py[co]$$" -delete
@@ -535,7 +536,7 @@ dev_build:
release_build:
$(PYTHON) setup.py release_build
dist/$(SDIST_TAR_FILE): ui-release
dist/$(SDIST_TAR_FILE): ui-release VERSION
BUILD="$(BUILD)" $(PYTHON) setup.py $(SDIST_COMMAND)
dist/$(WHEEL_FILE): ui-release
@@ -621,3 +622,6 @@ clean-elk:
psql-container:
docker run -it --net tools_default --rm postgres:9.4.1 sh -c 'exec psql -h "postgres" -p "5432" -U postgres'
VERSION:
echo $(RELEASE_VERSION) > $@