Skip to content

Commit b0d17f1

Browse files
Merge pull request #133 from reece/master
closes #132: adds instructions for passing dict to use_scm_version
2 parents 951ad9f + 5338d77 commit b0d17f1

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

README.rst

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ To use setuptools_scm just modify your project's setup.py file like this:
1818
1. Add :code:`'setuptools_scm'` to the :code:`setup_requires` parameter
1919
2. Add the :code:`use_scm_version` parameter and set it to ``True``
2020

21-
2221
E.g.:
2322

2423
.. code:: python
@@ -31,6 +30,20 @@ To use setuptools_scm just modify your project's setup.py file like this:
3130
...,
3231
)
3332
33+
Arguments to ``get_version()`` (see below) may be passed as a
34+
dictionary to ``use_scm_version``. For example:
35+
36+
.. code:: python
37+
38+
from setuptools import setup
39+
setup(
40+
...,
41+
use_scm_version = {"root": "..", "relative_to": __file__},
42+
setup_requires=['setuptools_scm'],
43+
...,
44+
)
45+
46+
3447
3. Access the version number in your package via :code:`pkg_resources`
3548

3649
E.g. (`PEP-0396 <https://www.python.org/dev/peps/pep-0396>`_):
@@ -48,14 +61,16 @@ To use setuptools_scm just modify your project's setup.py file like this:
4861
Programmatic usage
4962
------------------
5063

51-
In order to use setuptools_scm from code
52-
that one directory deeper than the project's root, you can use:
64+
In order to use ``setuptools_scm`` from code that one directory deeper
65+
than the project's root, you can use:
5366

5467
.. code:: python
5568
5669
from setuptools_scm import get_version
5770
version = get_version(root='..', relative_to=__file__)
5871
72+
See `setup.py Usage`_ above for how to use this within setup.py.
73+
5974

6075
Usage from sphinx
6176
-----------------

0 commit comments

Comments
 (0)