Skip to content

Commit 9d353a7

Browse files
a few more edits from the PR comments, and adding it back to the index (in the right place?)
1 parent 01f66a9 commit 9d353a7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

source/single_source_version.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ One of the challenges in building packages is that the version string can be req
1212
* It needs to be specified when building the package (e.g. in :file:`pyproject.toml`)
1313
- That will assure that it is properly assigned in the distribution file name, and in the installed package metadata.
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 <how_to_set_version_links>`.
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>`.
1616

17-
In the cases where a package does not set a top level ``__version__`` attribute, the version may still be accessible using ``importlib.metadata.version("distribution_name")``.
17+
In any case, The installed distribution version should be accessible using ``importlib.metadata.version("distribution_name")``.
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

@@ -29,11 +29,13 @@ In general, the options are:
2929

3030
Consult your build system's documentation for their recommended method.
3131

32-
.. _how_to_set_version_links:
32+
.. _Build system version handling:
3333

3434
Build System Version Handling
3535
-----------------------------
3636

37+
The following are links to some build system's documentation for handling version strings.
38+
3739
* `Flit <https://flit.pypa.io/en/stable/>`_
3840

3941
* `Hatchling <https://hatch.pypa.io/1.9/version/>`_

0 commit comments

Comments
 (0)