forked from python-mechanize/mechanize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·92 lines (78 loc) · 3.19 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
#!/usr/bin/env python
"""Stateful programmatic web browsing.
Stateful programmatic web browsing, after Andy Lester's Perl module
WWW::Mechanize.
mechanize.Browser implements the urllib2.OpenerDirector interface. Browser
objects have state, including navigation history, HTML form state, cookies,
etc. The set of features and URL schemes handled by Browser objects is
configurable. The library also provides an API that is mostly compatible with
urllib2: your urllib2 program will likely still work if you replace "urllib2"
with "mechanize" everywhere.
Features include: ftp:, http: and file: URL schemes, browser history, hyperlink
and HTML form support, HTTP cookies, HTTP-EQUIV and Refresh, Referer [sic]
header, robots.txt, redirections, proxies, and Basic and Digest HTTP
authentication.
Much of the code originally derived from Perl code by Gisle Aas (libwww-perl),
Johnny Lee (MSIE Cookie support) and last but not least Andy Lester
(WWW::Mechanize). urllib2 was written by Jeremy Hylton.
"""
import os
import setuptools
import sys
if sys.version_info < (2, 7):
raise SystemExit('mechanize requires python >= 2.7')
if sys.version_info.major > 2:
raise SystemExit('mechanize only works on python 2.x')
VERSION = open(os.path.join("mechanize", "_version.py")).\
readlines()[0].strip(' "\n')
CLASSIFIERS = """\
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
Intended Audience :: System Administrators
License :: OSI Approved :: BSD License
Natural Language :: English
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 2 :: Only
Topic :: Internet
Topic :: Internet :: File Transfer Protocol (FTP)
Topic :: Internet :: WWW/HTTP
Topic :: Internet :: WWW/HTTP :: Browsers
Topic :: Internet :: WWW/HTTP :: Indexing/Search
Topic :: Internet :: WWW/HTTP :: Site Management
Topic :: Internet :: WWW/HTTP :: Site Management :: Link Checking
Topic :: Software Development :: Libraries
Topic :: Software Development :: Libraries :: Python Modules
Topic :: Software Development :: Testing
Topic :: Software Development :: Testing :: Traffic Generation
Topic :: System :: Archiving :: Mirroring
Topic :: System :: Networking :: Monitoring
Topic :: System :: Systems Administration
Topic :: Text Processing
Topic :: Text Processing :: Markup
Topic :: Text Processing :: Markup :: HTML
Topic :: Text Processing :: Markup :: XML
"""
def main():
setuptools.setup(
name="mechanize",
version=VERSION,
license="BSD",
platforms=["any"],
install_requires=['html5lib>=0.999999999'],
extras_require={'fast': ['html5-parser>=0.4.4']},
classifiers=[c for c in CLASSIFIERS.split("\n") if c],
zip_safe=True,
author="Kovid Goyal",
author_email='[email protected]',
description=__doc__.split("\n", 1)[0],
long_description=__doc__.split("\n", 2)[-1],
url="https://github.com/python-mechanize/mechanize",
download_url=("https://pypi.python.org/packages/source/m/mechanize/"
"mechanize-%s.tar.gz" % VERSION),
packages=["mechanize"],
)
if __name__ == "__main__":
main()