collector.VERSION constant from pyproject.toml via importlib.metadata#69
Merged
collector.VERSION constant from pyproject.toml via importlib.metadata#69
collector.VERSION constant from pyproject.toml via importlib.metadata#69Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements a single source of truth for version management by loading the version from pyproject.toml via importlib.metadata instead of hardcoding it in constants. The change ensures version consistency between the package metadata and the collector's runtime version reporting.
Key changes:
- Replaces hardcoded version string with dynamic loading from package metadata
- Updates collector name to use a consistent format with the new distribution name constant
- Removes unused import in test file
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/buildkite_test_collector/collector/constants.py |
Implements dynamic version loading from package metadata with fallback handling |
src/buildkite_test_collector/collector/run_env.py |
Updates collector name usage and removes pylint disable comment |
tests/buildkite_test_collector/collector/test_run_env.py |
Removes unused RunEnv import |
So that there's a single source of truth again; prior to uv the setup.py file was loading the version from the constant... now we're doing it the other way around.
0c1fbe3 to
87e74d7
Compare
tommeier
approved these changes
Jul 21, 2025
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.
There should be a single source of truth for the version.
Prior to uv (#58) the
setup.pyfile was loading the version attribute from thecollector.VERSIONconstant... butpyproject.tomlcan't do that, so now we're doing it the other way around.👌🏼