forked from Lispython/human_curl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
108 lines (91 loc) · 2.77 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
human_curl
~~~~~~~~~~
Simple cURL wrapper for Humans
:copyright: (c) 2011 - 2012 by Alexandr Lispython ([email protected]).
:license: BSD, see LICENSE for more details.
"""
import sys
import os
try:
import subprocess
has_subprocess = True
except:
has_subprocess = False
from setuptools import Command, setup
try:
readme_content = open(os.path.join(os.path.abspath(
os.path.dirname(__file__)), "README.rst")).read()
except Exception, e:
print(e)
readme_content = __doc__
VERSION = "0.1.9"
class run_audit(Command):
"""Audits source code using PyFlakes for following issues:
- Names which are used but not defined or used before they are defined.
- Names which are redefined without having been used.
"""
description = "Audit source code with PyFlakes"
user_options = []
def initialize_options(self):
all = None
def finalize_options(self):
pass
def run(self):
try:
import pyflakes.scripts.pyflakes as flakes
except ImportError:
print "Audit requires PyFlakes installed in your system."""
sys.exit(-1)
dirs = ['human_curl']
# Add example directories
for dir in []:
dirs.append(os.path.join('examples', dir))
# TODO: Add test subdirectories
warns = 0
for dir in dirs:
for filename in os.listdir(dir):
if filename.endswith('.py') and filename != '__init__.py':
warns += flakes.checkPath(os.path.join(dir, filename))
if warns > 0:
print ("Audit finished with total %d warnings." % warns)
else:
print ("No problems found in sourcecode.")
def run_tests():
from tests import suite
return suite()
tests_require = [
'nose',
'unittest2',
'httphq'
]
setup(
name="human_curl",
version=VERSION,
description="Simple cURL wrapper for Humans",
long_description=readme_content,
author="Alex Lispython",
author_email="[email protected]",
maintainer="Alexandr Lispython",
maintainer_email="[email protected]",
url="https://github.com/lispython/human_curl",
packages=["human_curl"],
install_requires=[
'pycurl'],
tests_require=tests_require,
license="BSD",
# test_suite="nose.collector",
platforms = ['Linux', 'Mac'],
classifiers=[
"Environment :: Web Environment",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX",
"Topic :: Internet",
"Topic :: Software Development :: Libraries"
],
cmdclass={'audit': run_audit},
test_suite = '__main__.run_tests')