Fix packaging: include module_library as subpackage - #11
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a packaging issue where the s4dd/module_library subpackage was not being installed. The fix enables proper installation via pip and allows downstream applications to import s4dd.module_library without requiring manual path setup.
- Added empty
__init__.pyfile tos4dd/module_library/to mark it as a Python package - Updated
setup.pyto usefind_packages()instead of manually listing packages
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| setup.py | Imports find_packages and uses it to automatically discover all packages including the previously missing s4dd.module_library subpackage |
| s4dd/module_library/init.py | New empty file that marks the directory as a Python package, enabling it to be discovered by find_packages() |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| author="Rıza Özçelik", | ||
| author_email="r.ozcelik@tue.nl", | ||
| packages=["s4dd"], | ||
| packages=find_packages(), |
There was a problem hiding this comment.
Consider adding explicit exclusions to find_packages() to prevent accidental inclusion of non-package directories if they gain __init__.py files in the future. For example: find_packages(exclude=['examples', 'examples.*', 'docs', 'docs.*', 'datasets', 'datasets.*', 'site', 'site.*']). This is a best practice that makes the packaging intent explicit and prevents issues if these directories are modified later.
| packages=find_packages(), | |
| packages=find_packages(exclude=['examples', 'examples.*', 'docs', 'docs.*', 'datasets', 'datasets.*', 'site', 'site.*']), |
This PR fixes a packaging issue where
s4dd/module_libraryexists in the source tree but is not installed as part of the Python package.Changes:
__init__.pytos4dd/module_librarysetup.pyto include subpackages viafind_packages()With this change,
s4dd.module_librarycan be imported correctly after installation, allowing users to install and use the package directly viapipwithout relying on manual path setup or additional scripts. This also makes it easier to depend on and reference this package cleanly in downstream applications.This addresses the import issue reported in #10. Happy to adjust if a different packaging approach is preferred.