setup.py 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #!/usr/bin/env python
  2. from setuptools import setup
  3. import os
  4. import re
  5. import codecs
  6. base_path = os.path.dirname(__file__)
  7. # Get the version (borrowed from SQLAlchemy)
  8. with open(os.path.join(base_path, "src", "urllib3", "__init__.py")) as fp:
  9. VERSION = (
  10. re.compile(r""".*__version__ = ["'](.*?)['"]""", re.S).match(fp.read()).group(1)
  11. )
  12. with codecs.open("README.rst", encoding="utf-8") as fp:
  13. readme = fp.read()
  14. with codecs.open("CHANGES.rst", encoding="utf-8") as fp:
  15. changes = fp.read()
  16. version = VERSION
  17. setup(
  18. name="urllib3",
  19. version=version,
  20. description="HTTP library with thread-safe connection pooling, file post, and more.",
  21. long_description=u"\n\n".join([readme, changes]),
  22. classifiers=[
  23. "Environment :: Web Environment",
  24. "Intended Audience :: Developers",
  25. "License :: OSI Approved :: MIT License",
  26. "Operating System :: OS Independent",
  27. "Programming Language :: Python",
  28. "Programming Language :: Python :: 2",
  29. "Programming Language :: Python :: 2.7",
  30. "Programming Language :: Python :: 3",
  31. "Programming Language :: Python :: 3.5",
  32. "Programming Language :: Python :: 3.6",
  33. "Programming Language :: Python :: 3.7",
  34. "Programming Language :: Python :: 3.8",
  35. "Programming Language :: Python :: 3.9",
  36. "Programming Language :: Python :: Implementation :: CPython",
  37. "Programming Language :: Python :: Implementation :: PyPy",
  38. "Topic :: Internet :: WWW/HTTP",
  39. "Topic :: Software Development :: Libraries",
  40. ],
  41. keywords="urllib httplib threadsafe filepost http https ssl pooling",
  42. author="Andrey Petrov",
  43. author_email="andrey.petrov@shazow.net",
  44. url="https://urllib3.readthedocs.io/",
  45. project_urls={
  46. "Documentation": "https://urllib3.readthedocs.io/",
  47. "Code": "https://github.com/urllib3/urllib3",
  48. "Issue tracker": "https://github.com/urllib3/urllib3/issues",
  49. },
  50. license="MIT",
  51. packages=[
  52. "urllib3",
  53. "urllib3.packages",
  54. "urllib3.packages.ssl_match_hostname",
  55. "urllib3.packages.backports",
  56. "urllib3.contrib",
  57. "urllib3.contrib._securetransport",
  58. "urllib3.util",
  59. ],
  60. package_dir={"": "src"},
  61. requires=[],
  62. python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4",
  63. tests_require=[
  64. # These are a less-specific subset of dev-requirements.txt, for the
  65. # convenience of distro package maintainers.
  66. "pytest",
  67. "mock",
  68. "tornado",
  69. ],
  70. test_suite="test",
  71. extras_require={
  72. "brotli": ["brotlipy>=0.6.0"],
  73. "secure": [
  74. "pyOpenSSL>=0.14",
  75. "cryptography>=1.3.4",
  76. "idna>=2.0.0",
  77. "certifi",
  78. "ipaddress; python_version=='2.7'",
  79. ],
  80. "socks": ["PySocks>=1.5.6,<2.0,!=1.5.7"],
  81. },
  82. )