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 <bgabor8@bloomberg.net>
  • Loading branch information
gaborbernat committed Feb 26, 2020
1 parent f352f56 commit 435b2e4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 2 additions & 0 deletions 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 changes: 1 addition & 4 deletions setup.py
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
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
4 changes: 2 additions & 2 deletions tests/unit/seed/test_boostrap_link_via_app_data.py
Expand Up @@ -7,7 +7,7 @@
import pytest

from virtualenv.discovery.py_info import PythonInfo
from virtualenv.info import fs_supports_symlink
from virtualenv.info import PY3, fs_supports_symlink
from virtualenv.run import cli_run
from virtualenv.seed.embed.wheels import BUNDLE_SUPPORT
from virtualenv.seed.embed.wheels.acquire import BUNDLE_FOLDER
Expand Down Expand Up @@ -115,7 +115,7 @@ def read_only_folder(temp_app_data):
os.chmod(str(temp_app_data), S_IWUSR | S_IREAD)


@pytest.mark.skipif(sys.platform == "win32", reason="Windows only applies R/O to files")
@pytest.mark.skipif(sys.platform == "win32" or PY3, reason="Windows only applies R/O to files")
def test_base_bootstrap_link_via_app_data_not_writable(tmp_path, current_fastest, read_only_folder, monkeypatch):
dest = tmp_path / "venv"
result = cli_run(["--seeder", "app-data", "--creator", current_fastest, "--clear-app-data", "-vv", str(dest)])
Expand Down

0 comments on commit 435b2e4

Please sign in to comment.