|
4 | 4 | import pathlib |
5 | 5 | from setuptools import setup, find_namespace_packages |
6 | 6 |
|
| 7 | +# Resolve the absolute path to the directory containing setup.py |
7 | 8 | here = pathlib.Path(__file__).parent.resolve() |
| 9 | + |
| 10 | +# Read the long description from README.md |
8 | 11 | long_description = (here / "README.md").read_text(encoding="utf-8") |
9 | 12 |
|
| 13 | +# Construct the absolute path to __init__.py within your package |
| 14 | +init_py_path = here / "red_plex" / "__init__.py" |
| 15 | + |
10 | 16 | # Read the version from the package's __init__.py |
11 | | -with open('red_plex/__init__.py', 'r', encoding="utf-8") as f: |
| 17 | +with open(init_py_path, 'r', encoding="utf-8") as f: |
12 | 18 | version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", f.read(), re.M) |
13 | 19 | if version_match: |
14 | 20 | version = version_match.group(1) |
15 | 21 | else: |
16 | | - raise RuntimeError("Unable to find version string.") |
| 22 | + # It's good to show the path it tried to open for easier debugging |
| 23 | + raise RuntimeError(f"Unable to find version string in {init_py_path}") |
17 | 24 |
|
18 | 25 | setup( |
19 | 26 | name='red_plex', |
|
24 | 31 | author='marceljungle', |
25 | 32 | author_email='gigi.dan2011@gmail.com', |
26 | 33 | url='https://github.com/marceljungle/red-plex', |
27 | | - packages=find_namespace_packages(where="red_plex"), |
28 | | - package_dir={"": "red_plex"}, |
| 34 | + packages=find_namespace_packages(include=['red_plex*']), |
29 | 35 | include_package_data=True, |
30 | 36 | install_requires=[ |
31 | 37 | 'plexapi', |
|
37 | 43 | ], |
38 | 44 | entry_points=''' |
39 | 45 | [console_scripts] |
40 | | - red-plex=infrastructure.cli.cli:main |
| 46 | + red-plex=red_plex.infrastructure.cli.cli:main |
41 | 47 | ''', |
42 | 48 | classifiers=[ |
43 | 49 | 'Programming Language :: Python :: 3', |
|
0 commit comments