diff --git a/news/5766.bugfix.rst b/news/5766.bugfix.rst new file mode 100644 index 00000000..71aa5dfa --- /dev/null +++ b/news/5766.bugfix.rst @@ -0,0 +1 @@ +Fix issue in requirementslib 3.0.0 where dependencies defined in pyproject.toml were not being included in the lock file. diff --git a/tests/integration/test_lock.py b/tests/integration/test_lock.py index 16d5bdb0..665a6f96 100644 --- a/tests/integration/test_lock.py +++ b/tests/integration/test_lock.py @@ -25,6 +25,46 @@ RandomWords = "*" assert p.lockfile['default']['randomwords']['version'] == '==0.2.1' +@pytest.mark.lock +@pytest.mark.requirements +def test_lock_gathers_pyproject_dependencies(pipenv_instance_pypi): + """Ensure that running `pipenv install` doesn't install dev packages""" + with pipenv_instance_pypi(chdir=True) as p: + with open(p.pipfile_path, "w") as f: + contents = """ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +pipenvtest = { editable = true, path = "." } + """.strip() + f.write(contents) + + # Write the pyproject.toml + pyproject_toml_path = os.path.join(os.path.dirname(p.pipfile_path), "pyproject.toml") + with open(pyproject_toml_path, "w") as f: + contents = """ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "pipenvtest" +version = "0.0.1" +requires-python = ">=3.8" +dependencies = [ + "six" +] + """.strip() + f.write(contents) + c = p.pipenv("lock") + assert c.returncode == 0 + assert "six" in p.lockfile["default"] + + + @pytest.mark.lock @pytest.mark.requirements def test_lock_requirements_file(pipenv_instance_private_pypi):