Skip to content

Commit 460dcf6

Browse files
authored
Replace deprecated pipenv lock with pipenv requirements (#7764)
In the versions between what we are currently on in `dependaobt-core` and the latest versions of `pipenv`, they deprecated and then completely removed the `pipenv lock [-d]` command in favor of `pipenv requirements [--dev]` command. Since our current version of `pipenv` supports the `pipenv requirements` command, let's proactively switch to it now. That will make the future upgrade in #7715 easier. More context: * pypa/pipenv#5069 * pypa/pipenv#5091 * pypa/pipenv#5198 * pypa/pipenv#5200
1 parent 727ba26 commit 460dcf6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

python/lib/dependabot/python/file_updater/pipfile_file_updater.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def generated_requirements_files(type)
9292

9393
# Find any requirement files that list the same dependencies as
9494
# the (old) Pipfile.lock. Any such files were almost certainly
95-
# generated using `pipenv lock -r`
95+
# generated using `pipenv requirements`
9696
requirements_files.select do |req_file|
9797
deps = []
9898
req_file.content.scan(regex) { deps << Regexp.last_match }
@@ -237,12 +237,12 @@ def post_process_lockfile(updated_lockfile_content)
237237

238238
def generate_updated_requirements_files
239239
req_content = run_pipenv_command(
240-
"pyenv exec pipenv lock -r"
240+
"pyenv exec pipenv requirements"
241241
)
242242
File.write("req.txt", req_content)
243243

244244
dev_req_content = run_pipenv_command(
245-
"pyenv exec pipenv lock -r -d"
245+
"pyenv exec pipenv requirements --dev"
246246
)
247247
File.write("dev-req.txt", dev_req_content)
248248
end

python/spec/dependabot/python/file_updater/pipfile_file_updater_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@
406406
context "with a requirements.txt" do
407407
let(:dependency_files) { [pipfile, lockfile, requirements_file] }
408408

409-
context "that looks like the output of `pipenv lock -r`" do
409+
context "that looks like the output of `pipenv requirements`" do
410410
let(:pipfile_fixture_name) { "hard_names" }
411411
let(:lockfile_fixture_name) { "hard_names.lock" }
412412
let(:requirements_file) do
@@ -471,7 +471,7 @@
471471
end
472472
end
473473

474-
context "that looks like the output of `pipenv lock -r -d`" do
474+
context "that looks like the output of `pipenv requirements --dev`" do
475475
let(:requirements_file) do
476476
Dependabot::DependencyFile.new(
477477
name: "req-dev.txt",

0 commit comments

Comments
 (0)