Skip to content

Commit 9fe4b68

Browse files
authored
Merge pull request #5339 from pypa/replace-pipfile-with-plette
Replace usage of pipfile
2 parents 62b57b9 + 9c774f7 commit 9fe4b68

File tree

17 files changed

+99
-696
lines changed

17 files changed

+99
-696
lines changed

news/5339.behavior.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Remove usage of pipfile module in favour of Plette.
2+
pipfile is not actively maintained anymore. Plette is actively maintained,
3+
and has stricter checking of the Pipefile and Pipefile.lock. As a result,
4+
Pipefile with unnamed package indecies will fail to lock. If a Pipefile
5+
was hand crafeted, and the source is anonymous an error will be thrown.
6+
The solution is simple, add a name to your index, e.g, replace::
7+
8+
[[source]]
9+
url = "https://pypi.acme.com/simple"
10+
verify_ssl = true
11+
12+
With::
13+
14+
[[source]]
15+
url = "https://pypi.acme.com/simple"
16+
verify_ssl = true
17+
name = acmes_private_index

pipenv/core.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
from pipenv import environments, exceptions, pep508checker
1616
from pipenv._compat import decode_for_output, fix_utf8
17-
from pipenv.patched import pipfile
1817
from pipenv.patched.pip._internal.build_env import _get_runnable_pip
1918
from pipenv.patched.pip._internal.exceptions import PipError
2019
from pipenv.patched.pip._internal.network.session import PipSession
@@ -49,7 +48,7 @@
4948
system_which,
5049
)
5150
from pipenv.utils.spinner import create_spinner
52-
from pipenv.vendor import click, vistir
51+
from pipenv.vendor import click, plette, vistir
5352
from pipenv.vendor.requirementslib.models.requirements import Requirement
5453

5554
if MYPY_RUNNING:
@@ -1029,7 +1028,6 @@ def do_lock(
10291028
pypi_mirror=None,
10301029
):
10311030
"""Executes the freeze functionality."""
1032-
10331031
cached_lockfile = {}
10341032
if not pre:
10351033
pre = project.settings.get("allow_prereleases")
@@ -2782,10 +2780,11 @@ def do_check(
27822780
)
27832781
sys.exit(1)
27842782
# Load the pipfile.
2785-
p = pipfile.Pipfile.load(project.pipfile_location)
2783+
p = plette.Pipfile.load(open(project.pipfile_location))
2784+
p = plette.Lockfile.with_meta_from(p)
27862785
failed = False
27872786
# Assert each specified requirement.
2788-
for marker, specifier in p.data["_meta"]["requires"].items():
2787+
for marker, specifier in p._data["_meta"]["requires"].items():
27892788
if marker in results:
27902789
try:
27912790
assert results[marker] == specifier

pipenv/patched/pipfile/LICENSE

Lines changed: 0 additions & 3 deletions
This file was deleted.

pipenv/patched/pipfile/LICENSE.APACHE

Lines changed: 0 additions & 177 deletions
This file was deleted.

pipenv/patched/pipfile/LICENSE.BSD

Lines changed: 0 additions & 23 deletions
This file was deleted.

pipenv/patched/pipfile/__about__.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

pipenv/patched/pipfile/__init__.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)