Skip to content

Commit

Permalink
Replace deprecated pipenv lock with pipenv requirements
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jeffwidman committed Aug 8, 2023
1 parent 727ba26 commit dcc729c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def generated_requirements_files(type)

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

def generate_updated_requirements_files
req_content = run_pipenv_command(
"pyenv exec pipenv lock -r"
"pyenv exec pipenv requirements"
)
File.write("req.txt", req_content)

dev_req_content = run_pipenv_command(
"pyenv exec pipenv lock -r -d"
"pyenv exec pipenv requirements --dev"
)
File.write("dev-req.txt", dev_req_content)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@
context "with a requirements.txt" do
let(:dependency_files) { [pipfile, lockfile, requirements_file] }

context "that looks like the output of `pipenv lock -r`" do
context "that looks like the output of `pipenv requirements`" do
let(:pipfile_fixture_name) { "hard_names" }
let(:lockfile_fixture_name) { "hard_names.lock" }
let(:requirements_file) do
Expand Down Expand Up @@ -471,7 +471,7 @@
end
end

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

0 comments on commit dcc729c

Please sign in to comment.