From af7b99c2f480c41cf543c433086c4f144d5cd734 Mon Sep 17 00:00:00 2001 From: ocefpaf Date: Thu, 1 Jan 2015 17:44:13 -0300 Subject: [PATCH] Easy tag and publish via `setup.py`. --- setup.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d1f6358c30..4fc55018b8 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- import os - import re +import sys + VERSIONFILE = "folium/__init__.py" verstrline = open(VERSIONFILE, "rt").read() VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]" @@ -11,6 +12,16 @@ else: raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,)) + +if sys.argv[-1] == 'publish': + os.system("python setup.py sdist upload") + print("Remember to also tag the version.") + sys.exit() +elif sys.argv[-1] == 'tag': + os.system("git tag -a %s -m 'version %s'" % (verstr, verstr)) + os.system("git push --tags") + sys.exit() + try: from setuptools import setup except ImportError: