Skip to content

Commit 9862c53

Browse files
committed
Merge pull request #66 from ocefpaf/easy_tag_publish
Easy tag and publish via `setup.py`.
2 parents 046e1a6 + af7b99c commit 9862c53

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

setup.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# -*- coding: utf-8 -*-
22
import os
3-
43
import re
4+
import sys
5+
56
VERSIONFILE = "folium/__init__.py"
67
verstrline = open(VERSIONFILE, "rt").read()
78
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
@@ -11,6 +12,16 @@
1112
else:
1213
raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,))
1314

15+
16+
if sys.argv[-1] == 'publish':
17+
os.system("python setup.py sdist upload")
18+
print("Remember to also tag the version.")
19+
sys.exit()
20+
elif sys.argv[-1] == 'tag':
21+
os.system("git tag -a %s -m 'version %s'" % (verstr, verstr))
22+
os.system("git push --tags")
23+
sys.exit()
24+
1425
try:
1526
from setuptools import setup
1627
except ImportError:

0 commit comments

Comments
 (0)