-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
74 lines (61 loc) · 1.88 KB
/
setup.py
File metadata and controls
74 lines (61 loc) · 1.88 KB
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
70
71
72
73
74
#!/usr/bin/env python
# encoding: utf-8
import sys
import subprocess
from setuptools import setup, Command
class RunTests(Command):
"""
Make sure the code is importable and properly-formatted. Will fail if
dependencies aren't yet installed.
"""
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
print("Attempting to import API and checking source code "
"formatting...")
# Make sure there are no issues that would prevent import
from afapi import AppFirstAPI # NOQA
return_code = subprocess.call(['flake8', 'afapi'])
if return_code == 0:
print("All tests passed!")
else:
print("Error(s) found in code formatting!")
sys.exit(return_code)
class CreateDocs(Command):
"""
Generate HTML docs based on method definitions & docstrings. Requires
pydoc to be installed.
"""
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
print("Generating docs...")
return_code = subprocess.call(['pydoc', '-w', 'afapi.AppFirstAPI'])
if return_code == 0:
print("Done.")
else:
print("Error generating docs.")
sys.exit(return_code)
setup(
name='afapi',
version='1.0.4',
packages=['afapi'],
install_requires=['requests'],
author="Michael Okner, Nick Reichel, Zach Huffman, Morgan Snyder",
author_email="michael@appfirst.com",
url="https://github.com/appfirst/afapi",
cmdclass={
'test': RunTests,
'doc': CreateDocs,
},
description=("A Python wrapper for interacting with AppFirst's APIs (v5)"
"\n\nSee https://github.com/appfirst/afapi for more info."),
license="Apache2",
keywords="AppFirst API",
)