From 39a37c0758f43b130e5163156facffbbe89cf9fa Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 16 May 2020 22:18:25 -0400 Subject: Disable test on Python 2. --- changelog.d/1753.change.rst | 4 ++-- setuptools/tests/test_config.py | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/changelog.d/1753.change.rst b/changelog.d/1753.change.rst index c8b68026..08fa9ea4 100644 --- a/changelog.d/1753.change.rst +++ b/changelog.d/1753.change.rst @@ -1,4 +1,4 @@ ``attr:`` now extracts variables through rudimentary examination of the AST, -thereby supporting modules with third-party imports. If examining the AST +thereby supporting modules with third-party imports. If examining the AST fails to find the variable, ``attr:`` falls back to the old behavior of -importing the module. +importing the module. Works on Python 3 only. diff --git a/setuptools/tests/test_config.py b/setuptools/tests/test_config.py index 77b853eb..67992c04 100644 --- a/setuptools/tests/test_config.py +++ b/setuptools/tests/test_config.py @@ -10,6 +10,7 @@ from mock import patch from setuptools.dist import Distribution, _Distribution from setuptools.config import ConfigHandler, read_configuration from setuptools.extern.six.moves import configparser +from setuptools.extern import six from . import py2_only, py3_only from .textwrap import DALS @@ -310,6 +311,10 @@ class TestMetadata: with get_dist(tmpdir) as dist: assert dist.metadata.version == '2016.11.26' + if six.PY2: + # static version loading is unsupported on Python 2 + return + config.write( '[metadata]\n' 'version = attr: fake_package.subpkg_b.mod.VERSION\n' -- cgit v1.2.3