diff options
| author | Bernat Gabor <bgabor8@bloomberg.net> | 2020-02-26 15:12:44 +0000 |
|---|---|---|
| committer | Bernat Gabor <bgabor8@bloomberg.net> | 2020-02-26 15:19:14 +0000 |
| commit | 734fe023f11458f993c49f91b158de774c94d4a4 (patch) | |
| tree | 3832b6298e0aaaad84ebe538410aa58f80b8423a | |
| parent | f352f56998813332a58f009bc463ccedc0cb48c8 (diff) | |
| download | virtualenv-734fe023f11458f993c49f91b158de774c94d4a4.tar.gz | |
Disable distutils fixup for python 3
Until https://github.com/pypa/pip/issues/7778 is fixed and released.
Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
| -rw-r--r-- | docs/changelog/1669.bugfix.rst | 2 | ||||
| -rw-r--r-- | setup.py | 5 | ||||
| -rw-r--r-- | src/virtualenv/create/via_global_ref/api.py | 2 | ||||
| -rw-r--r-- | tests/unit/create/test_creator.py | 3 |
4 files changed, 7 insertions, 5 deletions
diff --git a/docs/changelog/1669.bugfix.rst b/docs/changelog/1669.bugfix.rst new file mode 100644 index 0000000..5fa952b --- /dev/null +++ b/docs/changelog/1669.bugfix.rst @@ -0,0 +1,2 @@ +Disable distutils fixup for python 3 until `pypa/pip #7778 <https://github.com/pypa/pip/issues/7778>`_ is fixed and +released - by :user:`gaborbernat`. @@ -5,8 +5,5 @@ if int(__version__.split(".")[0]) < 41: setup( use_scm_version={"write_to": "src/virtualenv/version.py", "write_to_template": '__version__ = "{version}"'}, - setup_requires=[ - # this cannot be enabled until https://github.com/pypa/pip/issues/7778 is addressed - # "setuptools_scm >= 2" - ], + setup_requires=["setuptools_scm >= 2"], ) diff --git a/src/virtualenv/create/via_global_ref/api.py b/src/virtualenv/create/via_global_ref/api.py index 8ee0c5c..0d39073 100644 --- a/src/virtualenv/create/via_global_ref/api.py +++ b/src/virtualenv/create/via_global_ref/api.py @@ -53,6 +53,8 @@ class ViaGlobalRefApi(Creator): def patch_distutils_via_pth(self): """Patch the distutils package to not be derailed by its configuration files""" + if self.interpreter.version_info.major == 3: + return # TODO: remove this, for her to bypass: https://github.com/pypa/pip/issues/7778 patch_file = Path(__file__).parent / "_distutils_patch_virtualenv.py" with ensure_file_on_disk(patch_file, self.app_data) as resolved_path: text = resolved_path.read_text() diff --git a/tests/unit/create/test_creator.py b/tests/unit/create/test_creator.py index f66218e..a4eb6b4 100644 --- a/tests/unit/create/test_creator.py +++ b/tests/unit/create/test_creator.py @@ -19,7 +19,7 @@ from virtualenv.__main__ import run, run_with_catch from virtualenv.create.creator import DEBUG_SCRIPT, Creator, get_env_debug_info from virtualenv.discovery.builtin import get_interpreter from virtualenv.discovery.py_info import PythonInfo -from virtualenv.info import IS_PYPY, fs_supports_symlink +from virtualenv.info import IS_PYPY, PY3, fs_supports_symlink from virtualenv.pyenv_cfg import PyEnvCfg from virtualenv.run import cli_run, session_via_cli from virtualenv.util.path import Path @@ -351,6 +351,7 @@ def test_create_long_path(current_fastest, tmp_path): subprocess.check_call([str(result.creator.script("pip")), "--version"]) +@pytest.mark.skipif(PY3, reason="https://github.com/pypa/pip/issues/7778") @pytest.mark.parametrize("creator", set(PythonInfo.current_system().creators().key_to_class) - {"builtin"}) def test_create_distutils_cfg(creator, tmp_path, monkeypatch): cmd = [ |
