-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor version handling to dynamically retrieve from __init__.py in setup.py #1
Copy link
Copy link
Open
Description
User Story
As a maintainer,
I want setup.py to dynamically retrieve the package version from __init__.py
so that version management is centralized and release processes avoid manual updates.
Background
The current setup.py (line 4) hardcodes an arbitrary version string (2025.4.231612), which:
- Requires manual updates for releases, increasing error risk
- Creates confusion for users seeing a nonsensical future version
- Complicates CI/CD pipelines due to lack of single source of truth
The solution involves:
- Adding a
__version__attribute tofolder_scanner/__init__.py - Modifying
setup.pyto parse this value dynamically
Risks include potential version-parsing failures during installation if not implemented cautiously.
Acceptance Criteria
- Add
__version__ = "1.0.0"tofolder_scanner/__init__.py - Update
setup.pyto extract__version__from__init__.pywithout importing the package (use file reading + regex) - Remove hardcoded
version=value fromsetup.py - Validate by running
python setup.py sdistand confirming the built package's metadata reflects the__version__value - Ensure the README's PyPI badge URL remains functional post-change (no version hardcoding in
README.md)
Reactions are currently unavailable