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

Commit 1cde74e

Browse files
committed
Tune our Make for publishing to PyPi.
1 parent c7b08f3 commit 1cde74e

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

Makefile

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: test install clean clean-build clean-pyc build
1+
.PHONY: test publish install clean clean-build clean-pyc clean-test build
22

33
install:
44
python setup.py install
@@ -20,6 +20,27 @@ clean-pyc:
2020
find . -name '*~' -exec rm -f {} +
2121
find . -name '__pycache__' -exec rm -fr {} +
2222

23+
clean-test:
24+
rm -f .coverage
25+
26+
test:
27+
py.test -s --cov=sqlalchemy_opentracing
28+
2329
build:
2430
python setup.py build
2531

32+
publish: test build
33+
@git diff-index --quiet HEAD || (echo "git has uncommitted changes. Refusing to publish." && false)
34+
awk 'BEGIN { FS = "." }; { printf("%d.%d.%d", $$1, $$2, $$3+1) }' VERSION > VERSION.incr
35+
mv VERSION.incr VERSION
36+
git add VERSION
37+
git commit -m "Update VERSION"
38+
git tag `cat VERSION`
39+
git push
40+
git push --tags
41+
python setup.py register -r pypi || (echo "Was unable to register to pypi, aborting publish." && false)
42+
python setup.py sdist upload -r pypi || (echo "Was unable to upload to pypi, publish failed." && false)
43+
@echo
44+
@echo "\033[92mSUCCESS: published v`cat VERSION` \033[0m"
45+
@echo
46+

0 commit comments

Comments
 (0)