File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -35,13 +35,12 @@ version_file = "pkg/_version.py"
35
35
Where `` pkg `` is the name of your package.
36
36
37
37
38
- .. code-block:: shell
39
-
40
- $ python -m setuptools_scm
41
-
42
- # To explore other options, try:
43
- $ python -m setuptools_scm --help
38
+ ``` commandline
39
+ $ python -m setuptools_scm
44
40
41
+ # To explore other options, try:
42
+ $ python -m setuptools_scm --help
43
+ ```
45
44
46
45
## as cli tool
47
46
@@ -103,9 +102,9 @@ version = get_version(root='..', relative_to=__file__)
103
102
### version at runtime
104
103
105
104
If you have opted not to hardcode the version number inside the package,
106
- you can retrieve it at runtime from PEP-0566 _ metadata using
105
+ you can retrieve it at runtime from [ PEP-0566 ] ( https://www.python.org/dev/peps/pep-0566/ ) metadata using
107
106
`` importlib.metadata `` from the standard library (added in Python 3.8)
108
- or the ` importlib_metadata ` _ backport:
107
+ or the [ ` importlib_metadata ` ] ( https://pypi.org/project/importlib-metadata/ ) backport:
109
108
110
109
``` python title="package_name/__init__.py"
111
110
from importlib.metadata import version, PackageNotFoundError
@@ -117,9 +116,6 @@ except PackageNotFoundError:
117
116
pass
118
117
```
119
118
120
- .. _ PEP-0566: https://www.python.org/dev/peps/pep-0566/
121
- .. _ importlib_metadata: https://pypi.org/project/importlib-metadata/
122
-
123
119
124
120
### Usage from Sphinx
125
121
You can’t perform that action at this time.
0 commit comments