File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
``attr: `` now extracts variables through rudimentary examination of the AST,
2
- thereby supporting modules with third-party imports. If examining the AST
2
+ thereby supporting modules with third-party imports. If examining the AST
3
3
fails to find the variable, ``attr: `` falls back to the old behavior of
4
- importing the module.
4
+ importing the module. Works on Python 3 only.
Original file line number Diff line number Diff line change 10
10
from setuptools .dist import Distribution , _Distribution
11
11
from setuptools .config import ConfigHandler , read_configuration
12
12
from setuptools .extern .six .moves import configparser
13
+ from setuptools .extern import six
13
14
from . import py2_only , py3_only
14
15
from .textwrap import DALS
15
16
@@ -310,6 +311,10 @@ def test_version(self, tmpdir):
310
311
with get_dist (tmpdir ) as dist :
311
312
assert dist .metadata .version == '2016.11.26'
312
313
314
+ if six .PY2 :
315
+ # static version loading is unsupported on Python 2
316
+ return
317
+
313
318
config .write (
314
319
'[metadata]\n '
315
320
'version = attr: fake_package.subpkg_b.mod.VERSION\n '
You can’t perform that action at this time.
0 commit comments