Skip to content

Commit

Permalink
Disable distutils fixup for python 3
Browse files Browse the repository at this point in the history
Until pypa/pip#7778 is fixed and released.

Signed-off-by: Bernat Gabor <[email protected]>
  • Loading branch information
gaborbernat committed Feb 26, 2020
1 parent f352f56 commit 734fe02
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions docs/changelog/1669.bugfix.rst
Original file line number Diff line number Diff line change
@@ -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 changes: 1 addition & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@

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"],
)
2 changes: 2 additions & 0 deletions src/virtualenv/create/via_global_ref/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ def create(self):

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()
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/create/test_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
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
Expand Down Expand Up @@ -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 = [
Expand Down

0 comments on commit 734fe02

Please sign in to comment.