This repository has been archived by the owner on Dec 31, 2023. It is now read-only.
generated from br3ndonland/template-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Calculate version number based on pyproject.toml
During `poetry install`, Poetry installs the project as if it were a package itself. You can then pull the version from the package metadata. It's a little tricky to get `importlib_metadata` to work with Docker. You have to remove `--no-root` from the _Dockerfile_ and add `importlib-metadata` to prod dependencies, and you still might get errors after that. python-poetry/poetry#144 python-poetry/poetry#1036
- Loading branch information
1 parent
54f1376
commit 227ab28
Showing
3 changed files
with
19 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,16 @@ | ||
__version__ = "0.2.0" | ||
""" | ||
Calculate version number based on pyproject.toml. | ||
--- | ||
During `poetry install`, Poetry installs the project as if it were a package itself. | ||
You can then pull from the package metadata. | ||
It's a little tricky to get `importlib_metadata` to work with Docker builds. | ||
You have to remove `--no-root` from the _Dockerfile_ and move `importlib-metadata` | ||
to prod dependencies, and you still might get errors after that. | ||
See [poetry#1036](https://github.com/python-poetry/poetry/issues/1036) and | ||
[poetry#144](https://github.com/python-poetry/poetry/issues/144) for more info. | ||
""" | ||
|
||
from importlib_metadata import version | ||
|
||
__version__ = version(__package__) |
This file contains 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
This file contains 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