Skip to content

Commit 0e8739f

Browse files
authored
suggest pkg_resources for __version__ export
1 parent 4ab48a3 commit 0e8739f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

README.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,14 @@ To use setuptools_scm just modify your project's setup.py file like this:
3131
...,
3232
)
3333
34-
3. If you will be distributing your package via {s,b}dist, consider using :code:`write_to` (see *Configuration Parameters* below) for visibility after the build process strips vcs data.
34+
3. Access the version number in your package via :code:`pkg_resources`
35+
36+
E.g. (`PEP-0396 <https://www.python.org/dev/peps/pep-0396>`_):
37+
38+
.. code:: python
39+
40+
import pkg_resources
41+
__version__ = pkg_resources.get_distribution(__name__).version
3542
3643
3744
Programmatic usage

0 commit comments

Comments
 (0)