Update setup.py
This commit is contained in:
parent
0c572e5324
commit
bbb281284d
17
setup.py
17
setup.py
@ -1,11 +1,15 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Note: To use the 'upload' functionality of this file, you must:
|
||||||
|
# $ pip install twine
|
||||||
|
|
||||||
import codecs
|
import codecs
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from setuptools import find_packages, setup
|
from setuptools import find_packages, setup
|
||||||
|
from shutil import rmtree
|
||||||
|
|
||||||
# Package meta-data.
|
# Package meta-data.
|
||||||
NAME = 'mypackage'
|
NAME = 'mypackage'
|
||||||
@ -36,7 +40,18 @@ required = [
|
|||||||
|
|
||||||
# Support "$ setup.py publish".
|
# Support "$ setup.py publish".
|
||||||
if sys.argv[-1] == "publish":
|
if sys.argv[-1] == "publish":
|
||||||
os.system("{0} setup.py sdist bdist_wheel upload".format(sys.executable))
|
try:
|
||||||
|
# Remove previous builds from the source tree.
|
||||||
|
rmtree(os.sep.join(('.', 'dist')))
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
# Create Source and Wheel (universal) distributions
|
||||||
|
os.system("{0} setup.py sdist bdist_wheel --universal ".format(sys.executable))
|
||||||
|
|
||||||
|
# Upload the package to PyPi.
|
||||||
|
os.system("twine upload dist/*")
|
||||||
|
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
# Where the magic happens:
|
# Where the magic happens:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user