-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
69 lines (60 loc) · 2.09 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import os
import sys
import codecs
from setuptools import setup, find_packages
from shutil import rmtree
here = os.path.abspath(os.path.dirname(__file__))
package = "print_env"
with codecs.open(os.path.join(here, "README.md")) as f:
long_description = "\n" + f.read()
version = {}
with codecs.open(os.path.join(here, package, "version.py")) as f:
exec(f.read(), version)
def print_run(cmd, err_exit=False):
print("RUNNING: {}".format(cmd))
r = os.system(cmd)
if err_exit and r != 0:
sys.exit(r)
if sys.argv[-1] == "publish":
try:
rmtree(os.path.join(here, "dist"))
except FileNotFoundError:
pass
print_run("{0} setup.py sdist bdist_wheel".format(sys.executable), True)
print_run("env $(print-env twine.env) twine upload dist/*", True)
print_run("git tag v{}".format(version["__version__"]))
print_run("git push --tags")
sys.exit()
setup(
name="print-env",
version=version["__version__"],
description="CLI to print environment variables from supported sources.",
long_description=long_description,
long_description_content_type="text/markdown",
author="Runzhou Li (Leo)",
author_email="[email protected]",
url="https://github.com/woozyking/print-env",
packages=find_packages(exclude=["tests"]),
install_requires=[
"click>=7,<8",
"python-dotenv==0.19.2",
"python-gnupg==0.4.8",
"pyyaml>=5,<6",
"requests>=2,<3",
],
entry_points={"console_scripts": ["print-env={}.cli:cli".format(package)]},
package_data={"": ["LICENSE"]},
license="MIT",
python_requires=">=3.6",
classifiers=[
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
)