|
8 | 8 | # |
9 | 9 |
|
10 | 10 |
|
11 | | -import ast |
12 | 11 | import glob |
13 | 12 | import subprocess |
14 | 13 | import sys |
|
36 | 35 | except ValueError: |
37 | 36 | sys.exit("libsystemd version returned by pkg-config is not a plain integer!") |
38 | 37 |
|
39 | | -THIS_DIR = Path(__file__).parent |
40 | | - |
41 | | -with (THIS_DIR / "README.md").open() as f: |
42 | | - long_description = f.read() |
43 | | - |
44 | | -# get and compute the version string |
45 | | -version_file = THIS_DIR / "pystemd" / "__version__.py" |
46 | | -with version_file.open() as f: |
47 | | - parsed_file = ast.parse(f.read()) |
48 | | - |
49 | | -__version__ = [ |
50 | | - expr.value.s |
51 | | - for expr in parsed_file.body |
52 | | - if isinstance(expr, ast.Assign) |
53 | | - and isinstance(expr.targets[0], ast.Name) |
54 | | - and isinstance(expr.value, ast.Str) |
55 | | - and expr.targets[0].id == "__version__" |
56 | | -][0] |
57 | | - |
58 | 38 | # Use C extensions if respective files are present. Else let Cython modules be |
59 | 39 | # compiled to C code. The latter is the case when using a clone of the git |
60 | 40 | # repository, unlike the source distribution which includes both .pyx and .c |
|
80 | 60 | else: |
81 | 61 | raise RuntimeError("Cython not installed.") |
82 | 62 |
|
83 | | -package_data = [] |
84 | | -package_data.extend(glob.glob("pystemd/*.pyi")) |
85 | | -package_data.extend(glob.glob("pystemd/*/*.pyi")) |
86 | 63 |
|
87 | 64 | setup( |
88 | 65 | name="pystemd", |
89 | | - version=__version__, |
| 66 | + version="0.13.0", |
| 67 | + author="Alvaro Leiva Geisse", |
| 68 | + author_email="aleivag@gmail.com", |
90 | 69 | packages=["pystemd", "pystemd.systemd1", "pystemd.machine1", "pystemd.DBus"], |
91 | | - author="Alvaro Leiva", |
92 | | - author_email="aleivag@meta.com", |
93 | 70 | ext_modules=external_modules, |
94 | | - url="https://github.com/systemd/pystemd", |
95 | | - classifiers=[ |
96 | | - "Operating System :: POSIX :: Linux", |
97 | | - "Intended Audience :: Developers", |
98 | | - "Intended Audience :: System Administrators", |
99 | | - "Programming Language :: Python :: 3.6", |
100 | | - "Programming Language :: Python :: 3.7", |
101 | | - "Programming Language :: Python :: 3.8", |
102 | | - "Programming Language :: Python :: 3.9", |
103 | | - "Programming Language :: Python :: 3.10", |
104 | | - "Programming Language :: Python :: 3.11", |
105 | | - "Development Status :: 5 - Production/Stable", |
106 | | - "Topic :: Utilities", |
107 | | - "License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)", |
108 | | - ], |
109 | | - keywords=["systemd"], |
110 | | - description="A systemd binding for python", |
111 | 71 | package_data={ |
112 | | - "pystemd": [str(Path(p).relative_to("pystemd")) for p in package_data] |
| 72 | + "pystemd": [ |
| 73 | + str(Path(p).relative_to("pystemd")) for p in glob.glob("pystemd/**/*.pyi") |
| 74 | + ] |
113 | 75 | }, |
114 | | - install_requires=[ |
115 | | - "lxml", |
116 | | - "psutil", |
117 | | - ], |
118 | | - long_description=long_description, |
119 | | - long_description_content_type="text/markdown", |
120 | | - license="LGPL-2.1+", |
121 | 76 | ) |
0 commit comments