-
Notifications
You must be signed in to change notification settings - Fork 18
/
setup.py
56 lines (46 loc) · 1.6 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
import sys
import setuptools
def get_env(args):
""" If args contain `pypi-dev`, the package name will be `knackpy-dev`. Else the
package name will be Knackpy."""
try:
# test if our custom arg is present and delete it so that setuptools doesn't
# throw an error
args.remove("pypi-dev")
return "dev"
except ValueError:
return "prod"
def get_package_name(env):
if env == "dev":
return "knackpy-dev"
else:
return "knackpy"
def build_config(env, readme="README.md"):
package_name = get_package_name(env)
with open(readme, "r") as fh:
long_description = fh.read()
return {
"author": "John Clary",
"author_email": "[email protected]",
"classifiers": [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: Public Domain",
"Programming Language :: Python :: 3",
],
"description": "A Python API client for interacting with Knack applications.",
"long_description": long_description,
"long_description_content_type": "text/markdown",
"install_requires": ["pytz", "requests"],
"keywords": "knack api api-client integration python",
"license": "Public Domain",
"name": package_name,
"packages": ["knackpy"],
"tests_require": ["pytest", "coverage"],
"url": "http://github.com/cityofaustin/knackpy",
"version": "1.1.1",
}
if __name__ == "__main__":
env = get_env(sys.argv)
config = build_config(env)
setuptools.setup(**config)