feat(publish): change to use version from env var #20
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.
What was done?
In this PR, the versioning system was changed to use the version from the environment variable. The
__version__.py
file was deleted and the version is now fetched from the environment variable insetup.py
. Also, the Github workflow was updated to determine the version from the tag and pass it as an environment variable to themake publish
command.Maintaining
__version__.py
is not the best aproach here due to that it's easy to forget to change it before creating a release. It's better to just use an env var to fetch the right application version.How was it done?
The changes were made in the
setup.py
file and the.github/workflows/release.yaml
file. Insetup.py
, the version is now fetched from the environment variable. If the version is not found, an exception is raised. In the Github workflow, a new step was added to determine the version from the tag and pass it as an environment variable to themake publish
command.How was it tested?
The changes were tested by running the Github workflow and ensuring that the version is correctly fetched from the environment variable and the
make publish
command works as expected.