Add test and news fragment.

This commit is contained in:
Matt Davis
2023-06-30 23:02:17 -04:00
parent 7787050bc9
commit 9a98977997
2 changed files with 41 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
Fix issue in requirementslib 3.0.0 where dependencies defined in pyproject.toml were not being included in the lock file.
+40
View File
@@ -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):