Skip to content

Commit a5f02fe

Browse files
committed
Remove another test relying on setup.py develop.
1 parent 86f11f0 commit a5f02fe

File tree

1 file changed

+0
-65
lines changed

1 file changed

+0
-65
lines changed

setuptools/tests/test_easy_install.py

-65
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import time
1616
import warnings
1717
import zipfile
18-
from pathlib import Path
1918
from typing import NamedTuple
2019
from unittest import mock
2120

@@ -1410,67 +1409,3 @@ def test_use_correct_python_version_string(tmpdir, tmpdir_cwd, monkeypatch):
14101409
assert cmd.config_vars['py_version'] == '3.10.1'
14111410
assert cmd.config_vars['py_version_short'] == '3.10'
14121411
assert cmd.config_vars['py_version_nodot'] == '310'
1413-
1414-
1415-
@pytest.mark.xfail(
1416-
sys.platform == "darwin",
1417-
reason="https://github.com/pypa/setuptools/pull/4716#issuecomment-2447624418",
1418-
)
1419-
def test_editable_user_and_build_isolation(setup_context, monkeypatch, tmp_path):
1420-
"""`setup.py develop` should honor `--user` even under build isolation"""
1421-
1422-
# == Arrange ==
1423-
# Pretend that build isolation was enabled
1424-
# e.g pip sets the environment variable PYTHONNOUSERSITE=1
1425-
monkeypatch.setattr('site.ENABLE_USER_SITE', False)
1426-
1427-
# Patching $HOME for 2 reasons:
1428-
# 1. setuptools/command/easy_install.py:create_home_path
1429-
# tries creating directories in $HOME.
1430-
# Given::
1431-
# self.config_vars['DESTDIRS'] = (
1432-
# "/home/user/.pyenv/versions/3.9.10 "
1433-
# "/home/user/.pyenv/versions/3.9.10/lib "
1434-
# "/home/user/.pyenv/versions/3.9.10/lib/python3.9 "
1435-
# "/home/user/.pyenv/versions/3.9.10/lib/python3.9/lib-dynload")
1436-
# `create_home_path` will::
1437-
# makedirs(
1438-
# "/home/user/.pyenv/versions/3.9.10 "
1439-
# "/home/user/.pyenv/versions/3.9.10/lib "
1440-
# "/home/user/.pyenv/versions/3.9.10/lib/python3.9 "
1441-
# "/home/user/.pyenv/versions/3.9.10/lib/python3.9/lib-dynload")
1442-
#
1443-
# 2. We are going to force `site` to update site.USER_BASE and site.USER_SITE
1444-
# To point inside our new home
1445-
monkeypatch.setenv('HOME', str(tmp_path / '.home'))
1446-
monkeypatch.setenv('USERPROFILE', str(tmp_path / '.home'))
1447-
monkeypatch.setenv('APPDATA', str(tmp_path / '.home'))
1448-
monkeypatch.setattr('site.USER_BASE', None)
1449-
monkeypatch.setattr('site.USER_SITE', None)
1450-
user_site = Path(site.getusersitepackages())
1451-
user_site.mkdir(parents=True, exist_ok=True)
1452-
1453-
sys_prefix = tmp_path / '.sys_prefix'
1454-
sys_prefix.mkdir(parents=True, exist_ok=True)
1455-
monkeypatch.setattr('sys.prefix', str(sys_prefix))
1456-
1457-
setup_script = (
1458-
"__import__('setuptools').setup(name='aproj', version=42, packages=[])\n"
1459-
)
1460-
(tmp_path / "setup.py").write_text(setup_script, encoding="utf-8")
1461-
1462-
# == Sanity check ==
1463-
assert list(sys_prefix.glob("*")) == []
1464-
assert list(user_site.glob("*")) == []
1465-
1466-
# == Act ==
1467-
run_setup('setup.py', ['develop', '--user'])
1468-
1469-
# == Assert ==
1470-
# Should not install to sys.prefix
1471-
assert list(sys_prefix.glob("*")) == []
1472-
# Should install to user site
1473-
installed = {f.name for f in user_site.glob("*")}
1474-
# sometimes easy-install.pth is created and sometimes not
1475-
installed = installed - {"easy-install.pth"}
1476-
assert installed == {'aproj.egg-link'}

0 commit comments

Comments
 (0)