Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable distutils fixup for python 3 #1671

Merged
merged 1 commit into from
Feb 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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