./setup.py publish

This commit is contained in:
SantaSpeen 2022-03-17 22:02:55 +03:00
parent 2dd969db93
commit 01e9a9a879

16
setup.py Normal file → Executable file
View File

@ -1,4 +1,6 @@
#!python3
import os
import shutil
import sys
from setuptools import setup
@ -10,11 +12,15 @@ packages = ['gitflic']
requires = ['requests']
# 'setup.py publish' shortcut.
if sys.argv[-1] == 'publish':
os.system('py -m build')
os.system('py -m twine upload --repository testpypi dist/*')
os.system('py -m twine upload --repository pypi dist/*')
sys.exit()
if 'publish' in sys.argv:
# Only if packages == 1
for dir in ("./dist", f"{packages[0]}.egg-info"):
if os.path.isdir(dir):
shutil.rmtree(dir)
os.system('python3 -m build')
os.system('python3 -m twine upload --repository testpypi dist/*')
os.system('python3 -m twine upload --repository pypi dist/*')
sys.exit(0)
about = {}
with open(os.path.join(here, 'gitflic', '__version__.py'), 'r', encoding='utf-8') as f: