Skip to content

Commit 0aefb9e

Browse files
Update source/discussions/single_source_version.rst
Co-authored-by: Philipp A. <[email protected]>
1 parent f130e81 commit 0aefb9e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/discussions/single_source_version.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ Single-sourcing the Project Version
1010
One of the challenges in building packages is that the version string can be required in multiple places.
1111

1212
* It needs to be specified when building the package (e.g. in :file:`pyproject.toml`)
13-
- That will assure that it is properly assigned in the distribution file name, and in the installed package metadata.
13+
This will make it available in the installed package’s metadata, from where it will be accessible at runtime using ``importlib.metadata.version("distribution_name")``.
1414

15-
* A package may set a top level ``__version__`` attribute to provide runtime access to the version of the imported package. If this is done, the value of ``__version__`` attribute and that used by the build system to set the distribution's version should be kept in sync in :ref:`the build systems's recommended way <Build system version handling>`.
15+
* A package may set a top level ``__version__`` attribute to provide an alternative means of runtime access to the version of the imported package. If this is done, the value of ``__version__`` attribute and that used by the build system to set the distribution's version should be kept in sync in :ref:`the build systems's recommended way <Build system version handling>`.
1616

17-
In any case, The installed distribution version should be accessible using ``importlib.metadata.version("distribution_name")``.
17+
* If the code is in in a version control system (VCS), e.g. Git, the version may appear in a *tag* such as ``v1.2.3``.
1818

1919
To ensure that version numbers do not get out of sync, it is recommended that there is a single source of truth for the version number.
2020

0 commit comments

Comments
 (0)