File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ To use setuptools_scm just modify your project's setup.py file like this:
18
18
1. Add :code: `'setuptools_scm' ` to the :code: `setup_requires ` parameter
19
19
2. Add the :code: `use_scm_version ` parameter and set it to ``True ``
20
20
21
-
22
21
E.g.:
23
22
24
23
.. code :: python
@@ -31,6 +30,20 @@ To use setuptools_scm just modify your project's setup.py file like this:
31
30
... ,
32
31
)
33
32
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
+
34
47
3. Access the version number in your package via :code: `pkg_resources `
35
48
36
49
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:
48
61
Programmatic usage
49
62
------------------
50
63
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:
53
66
54
67
.. code :: python
55
68
56
69
from setuptools_scm import get_version
57
70
version = get_version(root = ' ..' , relative_to = __file__ )
58
71
72
+ See `setup.py Usage `_ above for how to use this within setup.py.
73
+
59
74
60
75
Usage from sphinx
61
76
-----------------
You can’t perform that action at this time.
0 commit comments