|
1 |
| -import os |
2 | 1 | import sys
|
3 | 2 |
|
4 |
| -from setuptools import find_packages, setup |
5 |
| - |
6 |
| - |
7 |
| -def read(rel_path: str) -> str: |
8 |
| - here = os.path.abspath(os.path.dirname(__file__)) |
9 |
| - # intentionally *not* adding an encoding option to open, See: |
10 |
| - # https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690 |
11 |
| - with open(os.path.join(here, rel_path)) as fp: |
12 |
| - return fp.read() |
13 |
| - |
14 |
| - |
15 |
| -def get_version(rel_path: str) -> str: |
16 |
| - for line in read(rel_path).splitlines(): |
17 |
| - if line.startswith("__version__"): |
18 |
| - # __version__ = "0.9" |
19 |
| - delim = '"' if '"' in line else "'" |
20 |
| - return line.split(delim)[1] |
21 |
| - raise RuntimeError("Unable to find version string.") |
22 |
| - |
| 3 | +from setuptools import setup |
23 | 4 |
|
24 | 5 | setup(
|
25 |
| - version=get_version("src/pip/__init__.py"), |
26 |
| - package_dir={"": "src"}, |
27 |
| - packages=find_packages( |
28 |
| - where="src", |
29 |
| - exclude=["contrib", "docs", "tests*", "tasks"], |
30 |
| - ), |
31 |
| - include_package_data=False, |
32 |
| - package_data={ |
33 |
| - "pip": ["py.typed"], |
34 |
| - "pip._vendor": ["vendor.txt"], |
35 |
| - "pip._vendor.certifi": ["*.pem"], |
36 |
| - "pip._vendor.requests": ["*.pem"], |
37 |
| - "pip._vendor.distlib._backport": ["sysconfig.cfg"], |
38 |
| - "pip._vendor.distlib": [ |
39 |
| - "t32.exe", |
40 |
| - "t64.exe", |
41 |
| - "t64-arm.exe", |
42 |
| - "w32.exe", |
43 |
| - "w64.exe", |
44 |
| - "w64-arm.exe", |
45 |
| - ], |
46 |
| - }, |
47 | 6 | entry_points={
|
48 | 7 | "console_scripts": [
|
49 | 8 | "pip=pip._internal.cli.main:main",
|
50 | 9 | "pip{}=pip._internal.cli.main:main".format(sys.version_info[0]),
|
51 | 10 | "pip{}.{}=pip._internal.cli.main:main".format(*sys.version_info[:2]),
|
52 | 11 | ],
|
53 | 12 | },
|
54 |
| - zip_safe=False, |
55 | 13 | )
|
0 commit comments