We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e8739f commit 9c727eeCopy full SHA for 9c727ee
README.rst
@@ -37,8 +37,12 @@ To use setuptools_scm just modify your project's setup.py file like this:
37
38
.. code:: python
39
40
- import pkg_resources
41
- __version__ = pkg_resources.get_distribution(__name__).version
+ from pkg_resources import get_distribution, DistributionNotFound
+ try:
42
+ __version__ = get_distribution(__name__).version
43
+ except DistributionNotFound:
44
+ # package is not installed
45
+ pass
46
47
48
Programmatic usage
0 commit comments