@@ -641,9 +641,9 @@ def test_editable_install__local_dir_no_setup_py(
641
641
642
642
msg = result .stderr
643
643
if deprecated_python :
644
- assert 'File "setup.py" not found. ' in msg
644
+ assert 'File "setup.py" or "setup.cfg" not found. ' in msg
645
645
else :
646
- assert msg .startswith ('ERROR: File "setup.py" not found. ' )
646
+ assert msg .startswith ('ERROR: File "setup.py" or "setup.cfg" not found. ' )
647
647
assert 'pyproject.toml' not in msg
648
648
649
649
@@ -663,9 +663,9 @@ def test_editable_install__local_dir_no_setup_py_with_pyproject(
663
663
664
664
msg = result .stderr
665
665
if deprecated_python :
666
- assert 'File "setup.py" not found. ' in msg
666
+ assert 'File "setup.py" or "setup.cfg" not found. ' in msg
667
667
else :
668
- assert msg .startswith ('ERROR: File "setup.py" not found. ' )
668
+ assert msg .startswith ('ERROR: File "setup.py" or "setup.cfg" not found. ' )
669
669
assert 'A "pyproject.toml" file was found' in msg
670
670
671
671
@@ -1034,15 +1034,13 @@ def test_install_package_with_prefix(script, data):
1034
1034
result .did_create (install_path )
1035
1035
1036
1036
1037
- def test_install_editable_with_prefix (script ):
1037
+ def _test_install_editable_with_prefix (script , files ):
1038
1038
# make a dummy project
1039
1039
pkga_path = script .scratch_path / 'pkga'
1040
1040
pkga_path .mkdir ()
1041
- pkga_path .joinpath ("setup.py" ).write_text (textwrap .dedent ("""
1042
- from setuptools import setup
1043
- setup(name='pkga',
1044
- version='0.1')
1045
- """ ))
1041
+
1042
+ for fn , contents in files .items ():
1043
+ pkga_path .joinpath (fn ).write_text (textwrap .dedent (contents ))
1046
1044
1047
1045
if hasattr (sys , "pypy_version_info" ):
1048
1046
site_packages = os .path .join (
@@ -1087,6 +1085,28 @@ def test_install_editable_with_target(script):
1087
1085
result .did_create (script .scratch / 'target' / 'watching_testrunner.py' )
1088
1086
1089
1087
1088
+ def test_install_editable_with_prefix_setup_py (script ):
1089
+ setup_py = """
1090
+ from setuptools import setup
1091
+ setup(name='pkga', version='0.1')
1092
+ """
1093
+ _test_install_editable_with_prefix (script , {"setup.py" : setup_py })
1094
+
1095
+
1096
+ def test_install_editable_with_prefix_setup_cfg (script ):
1097
+ setup_cfg = """[metadata]
1098
+ name = pkga
1099
+ version = 0.1
1100
+ """
1101
+ pyproject_toml = """[build-system]
1102
+ requires = ["setuptools", "wheel"]
1103
+ build-backend = "setuptools.build_meta"
1104
+ """
1105
+ _test_install_editable_with_prefix (
1106
+ script , {"setup.cfg" : setup_cfg , "pyproject.toml" : pyproject_toml }
1107
+ )
1108
+
1109
+
1090
1110
def test_install_package_conflict_prefix_and_user (script , data ):
1091
1111
"""
1092
1112
Test installing a package using pip install --prefix --user errors out
0 commit comments