Skip to content
forked from pypa/pip

Commit

Permalink
Merge pull request #1 from uranusjr/setupcfg_only_devinstall
Browse files Browse the repository at this point in the history
This should fix the test errors
  • Loading branch information
KOLANICH authored Feb 23, 2021
2 parents 0655f47 + 0d24994 commit fcada1f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
11 changes: 4 additions & 7 deletions src/pip/_internal/req/constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,9 @@ def parse_editable(editable_req):
url_no_extras, extras = _strip_extras(url)

if os.path.isdir(url_no_extras):
if (
not os.path.exists(os.path.join(url_no_extras, 'setup.py'))
and
not os.path.exists(os.path.join(url_no_extras, 'setup.cfg'))
):
setup_py = os.path.join(url_no_extras, 'setup.py')
setup_cfg = os.path.join(url_no_extras, 'setup.cfg')
if not os.path.exists(setup_py) and not os.path.exists(setup_cfg):
msg = (
'File "setup.py" or "setup.cfg" not found. Directory cannot be '
'installed in editable mode: {}'
Expand All @@ -96,8 +94,7 @@ def parse_editable(editable_req):
if os.path.isfile(pyproject_path):
msg += (
'\n(A "pyproject.toml" file was found, but editable '
'mode currently requires a setuptools-based build'
' ("setup.py" or "setup.cfg" or both).)'
'mode currently requires a setuptools-based build.)'
)
raise InstallationError(msg)

Expand Down
12 changes: 6 additions & 6 deletions tests/functional/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -1070,19 +1070,19 @@ def test_install_editable_with_prefix_setup_cfg(script):
"""
pyproject_toml = """[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta
build-backend = "setuptools.build_meta"
"""
_test_install_editable_with_prefix(
script, {"setup.cfg": setup_cfg, "pyproject.toml": pyproject_toml}
)


def test_install_editable_with_prefix(script):
_test_install_editable_with_prefix(script, """
from setuptools import setup
setup(name='pkga',
version='0.1')
""")
setup_py = """
from setuptools import setup
setup(name='pkga', version='0.1')
"""
_test_install_editable_with_prefix(script, {"setup.py": setup_py})


def test_install_package_conflict_prefix_and_user(script, data):
Expand Down

0 comments on commit fcada1f

Please sign in to comment.