We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 70fb13c + 7737a58 commit 29aea30Copy full SHA for 29aea30
1 file changed
source/guides/single-sourcing-package-version.rst
@@ -33,6 +33,22 @@ number of your project:
33
...
34
)
35
36
+ .. note::
37
+
38
+ As of the release of setuptools 46.4.0, one can accomplish the same
39
+ thing by instead placing the following in the project's ``setup.cfg``
40
+ file (replacing "package" with the import name of the package):
41
42
+ .. code-block:: ini
43
44
+ [metadata]
45
+ version = attr: package.__version__
46
47
+ Earlier versions of setuptools implemented the ``attr:`` directive by
48
+ importing the module, but setuptools 46.4.0 added rudimentary AST
49
+ analysis so that ``attr:`` can function without having to import any of
50
+ the package's dependencies.
51
52
53
#. Use an external build tool that either manages updating both locations, or
54
offers an API that both locations can use.
0 commit comments