diff --git a/setup.py b/setup.py index 1a163a3..0300348 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +1,34 @@ """Setup.py for small_small_hr.""" -from os import path +import os +import sys from setuptools import find_packages, setup +import small_small_hr as sshr + # read the contents of your README file with open( - path.join(path.abspath(path.dirname(__file__)), "README.md"), encoding="utf-8" + os.path.join(os.path.abspath(os.path.dirname(__file__)), "README.md"), + encoding="utf-8", ) as f: LONG_DESCRIPTION = f.read() +# convenience command to publish +if sys.argv[-1] == "publish": + if os.system("pip freeze | grep twine"): + print("twine not installed.\nUse `pip install twine`.\nExiting.") + sys.exit() + os.system("rm -rf build/ *.egg-info/") + os.system("python setup.py sdist bdist_wheel") + os.system("twine upload dist/* --skip-existing") + print("You probably want to also tag the version now:") + print(f" git tag -a v{sshr.__version__} -m 'version {sshr.__version__}'") + print(" git push --tags") + sys.exit() + setup( name="small-small-hr", - version=__import__("small_small_hr").__version__, + version=sshr.__version__, description="Minimal human resource management app for Django", long_description=LONG_DESCRIPTION, long_description_content_type="text/markdown",