setup.py 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import codecs
  2. import os
  3. import re
  4. import sys
  5. from setuptools import find_packages, setup
  6. here = os.path.abspath(os.path.dirname(__file__))
  7. def read(*parts):
  8. # intentionally *not* adding an encoding option to open, See:
  9. # https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690
  10. with codecs.open(os.path.join(here, *parts), 'r') as fp:
  11. return fp.read()
  12. def find_version(*file_paths):
  13. version_file = read(*file_paths)
  14. version_match = re.search(
  15. r"^__version__ = ['\"]([^'\"]*)['\"]",
  16. version_file,
  17. re.M,
  18. )
  19. if version_match:
  20. return version_match.group(1)
  21. raise RuntimeError("Unable to find version string.")
  22. long_description = read('README.rst')
  23. setup(
  24. name="pip",
  25. version=find_version("src", "pip", "__init__.py"),
  26. description="The PyPA recommended tool for installing Python packages.",
  27. long_description=long_description,
  28. license='MIT',
  29. classifiers=[
  30. "Development Status :: 5 - Production/Stable",
  31. "Intended Audience :: Developers",
  32. "License :: OSI Approved :: MIT License",
  33. "Topic :: Software Development :: Build Tools",
  34. "Programming Language :: Python",
  35. "Programming Language :: Python :: 2",
  36. "Programming Language :: Python :: 2.7",
  37. "Programming Language :: Python :: 3",
  38. "Programming Language :: Python :: 3.4",
  39. "Programming Language :: Python :: 3.5",
  40. "Programming Language :: Python :: 3.6",
  41. "Programming Language :: Python :: 3.7",
  42. "Programming Language :: Python :: Implementation :: CPython",
  43. "Programming Language :: Python :: Implementation :: PyPy",
  44. ],
  45. url='https://pip.pypa.io/',
  46. keywords='distutils easy_install egg setuptools wheel virtualenv',
  47. author='The pip developers',
  48. author_email='pypa-dev@groups.google.com',
  49. package_dir={"": "src"},
  50. packages=find_packages(
  51. where="src",
  52. exclude=["contrib", "docs", "tests*", "tasks"],
  53. ),
  54. package_data={
  55. "pip._vendor.certifi": ["*.pem"],
  56. "pip._vendor.requests": ["*.pem"],
  57. "pip._vendor.distlib._backport": ["sysconfig.cfg"],
  58. "pip._vendor.distlib": ["t32.exe", "t64.exe", "w32.exe", "w64.exe"],
  59. },
  60. entry_points={
  61. "console_scripts": [
  62. "pip=pip._internal:main",
  63. "pip%s=pip._internal:main" % sys.version_info[:1],
  64. "pip%s.%s=pip._internal:main" % sys.version_info[:2],
  65. ],
  66. },
  67. zip_safe=False,
  68. python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
  69. )