Skip to content
This repository was archived by the owner on Feb 21, 2024. It is now read-only.

Commit d57fc96

Browse files
author
Sam Briesemeister
committed
Fix packaging to include version tags
1 parent 13f53b5 commit d57fc96

File tree

4 files changed

+30
-16
lines changed

4 files changed

+30
-16
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
*.pyc
2-
release-tag
32
commit-tag
43
dist/
54
build/

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include commit-version
2+
include DESCRIPTION.rst

Makefile

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,36 @@
11

2-
.PHONY: install clean remove build upload test release-tag commit-tag git-status-clean push-release release-checkout
2+
.PHONY: install clean uninstall build upload test release-version commit-version git-status-clean push-release release-checkout
33

44
GIT_COMMIT = $(shell git log -1 "--pretty=format:%H")
55
GIT_BRANCH = $(shell git describe --contains --all HEAD)
66
GIT_STATUS = $(shell git status -sb --untracked=no | wc -l | awk '{ if($$1 == 1){ print "clean" } else { print "pending" } }')
77

88
VERSION_PATTERN = "^[0-9]+\.[0-9]+\.[0-9]+$$"
99

10+
DRYRUN ?= false
1011

11-
install:
12-
python setup.py install
12+
ifeq ($(DRYRUN),false)
13+
DRYRUN_ARG=
14+
else
15+
DRYRUN_ARG=--dry-run
16+
endif
17+
18+
install: test commit-version
19+
sudo python setup.py check install
20+
21+
remove uninstall:
22+
sudo pip uninstall universal-analytics-python
1323

1424
clean:
15-
@rm -rf dist build universal_analytics_python.egg-info/
16-
@rm RELEASE_VERSION
25+
@rm -rvf dist build universal_analytics_python.egg-info/
26+
@rm -vf RELEASE_VERSION
1727

1828
build: test
19-
python setup.py build
29+
python setup.py check build sdist bdist
2030

21-
upload: git-status-clean test commit-tag
22-
python setup.py sdist upload
31+
upload: git-status-clean test commit-version build
32+
test -n `cat commit-version`
33+
python setup.py ${DRYRUN_ARG} sdist bdist upload
2334

2435

2536
push-release: release upload
@@ -29,21 +40,21 @@ git-status-clean:
2940
test "${GIT_STATUS}" == "clean" || (echo "GIT STATUS NOT CLEAN"; exit 1) >&2
3041

3142

32-
release: release-tag
33-
echo "## Tagging release " `cat release-tag`
34-
git tag `cat release-tag`
43+
release: release-version
44+
echo "## Tagging release " `cat release-version`
45+
git tag `cat release-version`
3546

3647
release-checkout:
3748
git checkout release
3849

3950

40-
release-tag: git-status-clean release-checkout test
51+
release-version: git-status-clean release-checkout test
4152
(echo "0.0.0"; git tag --list) | egrep "${VERSION_PATTERN}" | \
4253
sort -n | tail -n 1 | \
4354
awk -F '.' '{ printf("%d.%d.%d\n", ($$1), ($$2), ($$3) + 1 ) }' > $@
4455

4556

46-
commit-tag: git-status-clean
57+
commit-version: git-status-clean
4758
git tag --list --points-at=${GIT_COMMIT} | egrep "${VERSION_PATTERN}" | \
4859
sort -n | tail -n 1 > $@
4960

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from setuptools import setup
22
import sys
33

4-
VERSION=open('commit-tag').read().strip()
4+
VERSION=open('commit-version').read().strip()
55
print >>sys.stderr, "Preparing version {0}\n".format(VERSION or "NOTFOUND")
66

77

@@ -17,7 +17,7 @@
1717
description = "Universal Analytics Python Module",
1818
long_description = long_description,
1919

20-
version = VERSION,
20+
version = VERSION or 'NOTFOUND',
2121

2222
author = 'Sam Briesemeister',
2323
author_email = '[email protected]',
@@ -28,5 +28,7 @@
2828
license = 'BSD',
2929
packages = ["UniversalAnalytics"],
3030

31+
install_requires = [],
32+
3133
zip_safe = True,
3234
)

0 commit comments

Comments
 (0)