-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
67 lines (57 loc) · 2.16 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
import ast
import os
import re
from pathlib import Path
from typing import Iterable
from setuptools import setup
current_dir = Path(__file__).parent.resolve()
ts_client_dir = current_dir / "typeshed_client"
typeshed_dir = ts_client_dir / "typeshed"
_version_re = re.compile(r"__version__\s+=\s+(?P<version>.*)")
with (ts_client_dir / "__init__.py").open() as f:
match = _version_re.search(f.read())
if match is None:
raise RuntimeError("Could not find in the init file")
version = match.group("version")
version = str(ast.literal_eval(version))
def find_bundled_files() -> Iterable[str]:
yield str(ts_client_dir / "py.typed")
for root, _, files in os.walk(typeshed_dir):
root_path = Path(root)
for file in files:
path = root_path / file
if path.suffix == ".pyi" or path.name == "VERSIONS":
yield str(path)
setup(
name="typeshed_client",
version=version,
description="A library for accessing stubs in typeshed.",
long_description=Path("README.rst").read_text(),
keywords="typeshed typing annotations",
author="Jelle Zijlstra",
author_email="[email protected]",
url="https://github.com/JelleZijlstra/typeshed_client",
project_urls={
"Bug Tracker": "https://github.com/JelleZijlstra/typeshed_client/issues"
},
license="MIT",
packages=["typeshed_client"],
install_requires=["importlib_resources >= 1.4.0", "typing-extensions>=4.5.0"],
package_data={"typeshed_client": list(find_bundled_files())},
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development",
],
python_requires=">=3.8",
)