|
15 | 15 | import time
|
16 | 16 | import warnings
|
17 | 17 | import zipfile
|
18 |
| -from pathlib import Path |
19 | 18 | from typing import NamedTuple
|
20 | 19 | from unittest import mock
|
21 | 20 |
|
@@ -1410,67 +1409,3 @@ def test_use_correct_python_version_string(tmpdir, tmpdir_cwd, monkeypatch):
|
1410 | 1409 | assert cmd.config_vars['py_version'] == '3.10.1'
|
1411 | 1410 | assert cmd.config_vars['py_version_short'] == '3.10'
|
1412 | 1411 | 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