refactor: Centralize version in pyproject.toml#32
Merged
Conversation
- Add __version__ to birdnetpi package using importlib.metadata - Update ConfigManager to reference birdnetpi.__version__ - Update manage_translations CLI to reference birdnetpi.__version__ - Normalize version to PEP 440 format (2.0.0a0) This eliminates hardcoded version strings and ensures consistency across the codebase by having a single source of truth.
The previous commit incorrectly used birdnetpi.__version__ (2.0.0a0) as the config schema version, but no version handler exists for alpha/beta versions. The version handler files define the schema version (2.0.0), which is separate from the package release version. This change: - Removes CURRENT_VERSION class attribute that pulled from __version__ - Adds current_version property that uses registry.get_current_version() - Updates references from self.CURRENT_VERSION to self.current_version - Updates release checklist to reflect version handler as source of truth The version handler files (e.g., v2_0_0.py) are now the single source of truth for configuration schema versions.
mverteuil
added a commit
that referenced
this pull request
Feb 23, 2026
- Add version header validation to _check_pot_freshness - Add entry flags validation (python-format, no-python-format, etc.) - Extract helper functions for version, msgid, and flag checking - Update POT and PO files to use correct version (2.0.0a0) - Update tests to use proper POT header template with version The check command now validates: - msgid completeness (existing) - Header version matches package version (new) - Entry flags match freshly extracted POT (new) This ensures the translation workflow produces consistent results and catches version mismatches introduced by PR #32.
3 tasks
mverteuil
added a commit
that referenced
this pull request
Feb 23, 2026
- Add version header validation to _check_pot_freshness - Add entry flags validation (python-format, no-python-format, etc.) - Extract helper functions for version, msgid, and flag checking - Update POT and PO files to use correct version (2.0.0a0) - Update tests to use proper POT header template with version The check command now validates: - msgid completeness (existing) - Header version matches package version (new) - Entry flags match freshly extracted POT (new) This ensures the translation workflow produces consistent results and catches version mismatches introduced by PR #32.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
__version__tobirdnetpipackage usingimportlib.metadataConfigManager.CURRENT_VERSIONto referencebirdnetpi.__version__manage_translationsCLI to referencebirdnetpi.__version__2.0.0a0)Why
Previously, the version was hardcoded in three places:
pyproject.tomlsrc/birdnetpi/config/manager.pysrc/birdnetpi/cli/manage_translations.pyThis caused inconsistencies and required manual updates in multiple files for each release.
Now there's a single source of truth (
pyproject.toml), and all other code references it viabirdnetpi.__version__.Test plan