forked from pgaref/HTTP_Request_Randomizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
91 lines (80 loc) · 2.74 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
'''Setup script for HTTP_Request_Randomizer.'''
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import codecs
import sys
import os
HERE = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
"""Return multiple read calls to different readable objects as a single
string."""
# intentionally *not* adding an encoding option to open
return codecs.open(os.path.join(HERE, *parts), 'r').read()
LONG_DESCRIPTION = read('README.rst')
class Tox(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
#import here, cause outside the eggs aren't loaded
import tox
errcode = tox.cmdline(self.test_args)
sys.exit(errcode)
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = [
'--strict',
'--verbose',
'--tb=long',
'tests']
self.test_suite = True
def run_tests(self):
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)
setup(
name='http_request_randomizer',
version='1.0.3',
url='http://pgaref.com/blog/python-proxy',
license='MIT',
author='Panagiotis Garefalakis',
author_email='[email protected]',
description='A package using public proxies to randomise http requests.',
long_description=LONG_DESCRIPTION,
packages=find_packages(exclude=['tests']),
platforms='any',
test_suite='tests.test_parsers',
# tests_require=['tox'],
# cmdclass={'test': Tox},
tests_require=['pytest', 'pytest-cov'],
cmdclass={'test': PyTest},
install_requires=['beautifulsoup4 >= 4.5.3',
'httmock>=1.2.6',
'psutil>=5.1.3',
'python-dateutil>=2.6.0',
'requests>=2.13.0',
'schedule>=0.4.2',
],
setup_requires=['pytest-runner'],
zip_safe=False,
# include_package_data=True,
package_data={
# Include agents.txt files
'http_request_randomizer.requests': ['data/*'],
},
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Operating System :: OS Independent',
'Development Status :: 4 - Beta',
'Natural Language :: English',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'Topic :: Internet :: WWW/HTTP',
'License :: OSI Approved :: MIT License',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)