-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Improve dependency management with MANIFEST.in
Problem
Currently, the package dependencies are hardcoded in setup.py
, which creates several issues:
- Dependencies are duplicated between
setup.py
andrequirements.txt
- Version updates need to be synchronized in multiple files
- Dependabot can only manage versions in
requirements.txt
, notsetup.py
Solution
Implement the same approach as used in datadog-monitor-deployer:
- Add a
MANIFEST.in
file to ensurerequirements.txt
is included in source distribution - Modify
setup.py
to read dependencies fromrequirements.txt
- Keep
requirements.txt
as the single source of truth for dependencies
Implementation Steps
- Create
MANIFEST.in
with the following content:
include LICENSE
include README.md
include requirements.txt
include requirements-dev.txt
recursive-include src *.py
recursive-include tests *.py
recursive-include config *.yaml
- Update
setup.py
to read fromrequirements.txt
:
# Read requirements
with open("requirements.txt", "r", encoding="utf-8") as f:
requirements = [line.strip() for line in f if line.strip() and not line.startswith("#")]
setup(
# ... other setup parameters ...
install_requires=requirements,
# ... rest of setup ...
)
Benefits
- Single source of truth for dependencies
- Better integration with Dependabot
- Cleaner dependency management
- Consistent with Python packaging best practices
- Matches the approach used in datadog-monitor-deployer
Testing
- Delete existing tag
- Create new tag
- Verify package builds and publishes correctly
- Verify all dependencies are correctly included
References
- Successful implementation in datadog-monitor-deployer
- PyPA packaging guide
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
No status