Commits

Andriy Kornatskyy committed 90e3fbc

Added upload make target

  • Participants
  • Parent commits b032d17

Comments (0)

Files changed (3)

-.SILENT: clean env po doctest-cover test doc release
-.PHONY: clean env po doctest-cover test doc release
+.SILENT: clean env po doctest-cover test doc release upload
+.PHONY: clean env po doctest-cover test doc release upload
 
 VERSION=2.7
 PYPI=http://pypi.python.org/simple
+DIST_DIR=dist
 
 PYTHON=env/bin/python$(VERSION)
 EASY_INSTALL=env/bin/easy_install-$(VERSION)
 release:
 	$(PYTHON) setup.py -q bdist_egg
 
+upload:
+	REV=$$(hg head --template '{rev}');\
+	if [ "$$(echo $(VERSION) | sed 's/\.//')" -eq 27 ]; then \
+		$(PYTHON) setup.py -q egg_info --tag-build .$$REV \
+			sdist register upload; \
+		make -s doc; \
+		python setup.py upload_docs; \
+	fi; \
+	$(PYTHON) setup.py -q egg_info --tag-build .$$REV \
+		bdist_egg --dist-dir=$(DIST_DIR) \
+		rotate --match=egg,gz --keep=1 --dist-dir=$(DIST_DIR) \
+		upload;
+
 test:
 	$(PYTEST) -q -x --pep8 --doctest-modules \
 		src/wheezy/core
 [bdist_egg]
 exclude-source-files=0
 
+[upload_docs]
+upload-dir = doc/_build
+
 [pytest]
+
 
 setup(
     name='wheezy.core',
-    version='0.1.1',
+    version='0.1',
     description='A lightweight core library',
     long_description=README,
     url='https://bitbucket.org/akorn/wheezy.core',