From 3f457aa0c1630b746e982e7f0d9f1fab65bc1106 Mon Sep 17 00:00:00 2001 From: khanhdq Date: Wed, 31 Aug 2022 00:35:40 +0900 Subject: [PATCH 1/3] Fixes checking constraint throws deprecation messages. --- pipenv/utils/dependencies.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pipenv/utils/dependencies.py b/pipenv/utils/dependencies.py index 5b7c6e8345..a9990995d0 100644 --- a/pipenv/utils/dependencies.py +++ b/pipenv/utils/dependencies.py @@ -4,7 +4,10 @@ from pipenv.patched.pip._vendor.packaging.markers import Marker from pipenv.patched.pip._vendor.packaging.version import parse -from pipenv.vendor.requirementslib.models.requirements import Requirement +from pipenv.vendor.requirementslib.models.requirements import ( + InstallRequirement, + Requirement, +) from .constants import SCHEME_LIST, VCS_LIST from .shell import temp_path @@ -270,16 +273,14 @@ def convert_deps_to_pip( def get_constraints_from_deps(deps): """Get contraints from Pipfile-formatted dependency""" - from pipenv.patched.pip._internal.req.req_install import ( - check_invalid_constraint_type, - ) - from pipenv.vendor.requirementslib.models.requirements import Requirement + + def is_constraints(dep: InstallRequirement) -> bool: + return dep.name and not dep.editable and not dep.extras constraints = [] for dep_name, dep in deps.items(): new_dep = Requirement.from_pipfile(dep_name, dep) - problem = check_invalid_constraint_type(new_dep.as_ireq()) - if not problem: + if is_constraints(new_dep.as_ireq()): c = new_dep.as_line().strip() constraints.append(c) return constraints From c732a3719c10fa24ebc9c2623641af923d08ae00 Mon Sep 17 00:00:00 2001 From: khanhdq Date: Wed, 31 Aug 2022 00:47:21 +0900 Subject: [PATCH 2/3] Add news fragments. --- news/5309.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/5309.bugfix.rst diff --git a/news/5309.bugfix.rst b/news/5309.bugfix.rst new file mode 100644 index 0000000000..cfd928eb15 --- /dev/null +++ b/news/5309.bugfix.rst @@ -0,0 +1 @@ +Fix 5273, use our own method for checking if a package is a valid constraint. From 09cb10df608bfe51688f465e2dea3046afd768e6 Mon Sep 17 00:00:00 2001 From: khanhdq Date: Wed, 31 Aug 2022 00:50:54 +0900 Subject: [PATCH 3/3] Typo --- news/5309.bugfix.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/5309.bugfix.rst b/news/5309.bugfix.rst index cfd928eb15..8e46a761c0 100644 --- a/news/5309.bugfix.rst +++ b/news/5309.bugfix.rst @@ -1 +1 @@ -Fix 5273, use our own method for checking if a package is a valid constraint. +Fix #5273, use our own method for checking if a package is a valid constraint.