From 4b6f6df49f69599edd00e0527ea9d10e87c50f12 Mon Sep 17 00:00:00 2001 From: takunomi-build-bot Date: Wed, 4 Jun 2025 21:30:18 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Repository=20layout=20updated=20?= =?UTF-8?q?to=20latest=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit was automatically generated by [a script](https://gitfub.space/Jmaa/repo-manager) --- setup.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/setup.py b/setup.py index 7742056..42b9c11 100644 --- a/setup.py +++ b/setup.py @@ -3,6 +3,7 @@ # MANUAL CHANGES CAN AND WILL BE OVERWRITTEN! import re +from pathlib import Path from setuptools import setup @@ -108,6 +109,20 @@ def parse_version_file(text: str) -> str: return match.group(2) +def find_python_packages() -> list[str]: + """ + Find all python packages. (Directories containing __init__.py files.) + """ + root_path = Path(PACKAGE_NAME) + packages: set[str] = set([PACKAGE_NAME]) + + # Search recursively + for init_file in root_path.rglob('__init__.py'): + packages.add(str(init_file.parent).replace('/', '.')) + + print(f'Found following packages: {packages}') + return sorted(packages) + with open(PACKAGE_NAME + '/_version.py') as f: version = parse_version_file(f.read()) @@ -136,6 +151,7 @@ setup( author='Jon Michael Aanes', author_email='jonjmaa@gmail.com', url='https://gitfub.space/Jmaa/' + PACKAGE_NAME, + packages=find_python_packages(), install_requires=REQUIREMENTS_MAIN, extras_require={ 'test': REQUIREMENTS_TEST,