Skip to content

Commit

Permalink
Move the Pipfile/Pipfile.lock fixtures to a clearly named folder (d…
Browse files Browse the repository at this point in the history
…ependabot#7700)

This does two things:
1. Moves the files in the `lockfiles` directory to the `pipfile_files` directory.
2. Moves the files in the `pipfiles` directory to the `pipfile_files`
   directory.

All the files in `lockfiles` are actually specific to `pipenv` and their
`pipfile.lock` file format. So I was a bit surprised because `poetry`
also has a lockfile format... but those are over in `pyproject_locks`
dir.

I think what happened is that when `pipenv` popularized the
`Pipfile`/`Pipfile.lock` format, there was a lot of initial excitement
that it might become _the_ lockfile format within Python. So Grey may
have called it `lockfile` assuming that other tooling would start to
migrate towards this. However, `pipenv` made some design choices that
made it a ["fails-to-take-over-the-world-because-it-tries-to-do-too-much"](https://hynek.me/articles/python-app-deps-2018/) type of
tool.

At first I started by merely renaming the folder from `lockfiles` to
`pipfile_lockfiles`.

However, while I was working regenerating the `pipfile.lock` files
(dependabot#7697) I found it a
royal pain to jump back and forth between two folders where one holds the
input `Pipfile` and the other holds the output `Pipfile.lock` files. And
the lockfiles already have a `.lock` suffix. So instead merging them
into a single folder makes it easier to spot when a file should be
regenerated into a lockfile vs when it'll fail to even generate a
lockfile.

So this hopefully makes things a lot clearer / less ambiguous for anyone
working on this section of code.
  • Loading branch information
jeffwidman authored Aug 2, 2023
1 parent 3e39085 commit b21fe8f
Show file tree
Hide file tree
Showing 69 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
let(:lockfile) do
Dependabot::DependencyFile.new(name: "Pipfile.lock", content: lockfile_body)
end
let(:pipfile_body) { fixture("pipfiles", pipfile_fixture_name) }
let(:lockfile_body) { fixture("lockfiles", lockfile_fixture_name) }
let(:pipfile_body) { fixture("pipfile_files", pipfile_fixture_name) }
let(:lockfile_body) { fixture("pipfile_files", lockfile_fixture_name) }
let(:pipfile_fixture_name) { "version_not_specified" }
let(:lockfile_fixture_name) { "version_not_specified.lock" }

Expand Down
8 changes: 4 additions & 4 deletions python/spec/dependabot/python/file_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1080,9 +1080,9 @@
)
end

let(:pipfile_body) { fixture("pipfiles", pipfile_fixture_name) }
let(:pipfile_body) { fixture("pipfile_files", pipfile_fixture_name) }
let(:lockfile_body) do
fixture("lockfiles", lockfile_fixture_name)
fixture("pipfile_files", lockfile_fixture_name)
end
let(:pipfile_fixture_name) { "version_not_specified" }
let(:lockfile_fixture_name) { "version_not_specified.lock" }
Expand Down Expand Up @@ -1139,7 +1139,7 @@
let(:pipfile) do
Dependabot::DependencyFile.new(
name: "Pipfile",
content: fixture("pipfiles", "version_not_specified")
content: fixture("pipfile_files", "version_not_specified")
)
end

Expand Down Expand Up @@ -1168,7 +1168,7 @@
let(:pipfile) do
Dependabot::DependencyFile.new(
name: "Pipfile",
content: fixture("pipfiles", "version_not_specified")
content: fixture("pipfile_files", "version_not_specified")
)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
let(:pipfile) do
Dependabot::DependencyFile.new(
name: "Pipfile",
content: fixture("pipfiles", pipfile_fixture_name)
content: fixture("pipfile_files", pipfile_fixture_name)
)
end
let(:lockfile) do
Dependabot::DependencyFile.new(
name: "Pipfile.lock",
content: fixture("lockfiles", lockfile_fixture_name)
content: fixture("pipfile_files", lockfile_fixture_name)
)
end
let(:pipfile_fixture_name) { "version_not_specified" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
let(:manifest) do
Dependabot::DependencyFile.new(
name: "Pipfile",
content: fixture("pipfiles", pipfile_fixture_name)
content: fixture("pipfile_files", pipfile_fixture_name)
)
end
let(:pipfile_fixture_name) { "version_not_specified" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
end

let(:pipfile_content) do
fixture("pipfiles", pipfile_fixture_name)
fixture("pipfile_files", pipfile_fixture_name)
end
let(:pipfile_fixture_name) { "version_not_specified" }

Expand Down Expand Up @@ -46,7 +46,7 @@
let(:lockfile) do
Dependabot::DependencyFile.new(
name: "Pipfile.lock",
content: fixture("lockfiles", lockfile_fixture_name)
content: fixture("pipfile_files", lockfile_fixture_name)
)
end
let(:pipfile_fixture_name) { "version_not_specified" }
Expand Down Expand Up @@ -128,7 +128,7 @@
let(:lockfile) do
Dependabot::DependencyFile.new(
name: "Pipfile.lock",
content: fixture("lockfiles", lockfile_fixture_name)
content: fixture("pipfile_files", lockfile_fixture_name)
)
end
let(:pipfile_fixture_name) { "version_not_specified" }
Expand Down
6 changes: 3 additions & 3 deletions python/spec/dependabot/python/file_updater_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@
let(:pipfile) do
Dependabot::DependencyFile.new(
name: "Pipfile",
content: fixture("pipfiles", "version_not_specified")
content: fixture("pipfile_files", "version_not_specified")
)
end
let(:lockfile) do
Dependabot::DependencyFile.new(
name: "Pipfile.lock",
content: fixture("lockfiles", "version_not_specified.lock")
content: fixture("pipfile_files", "version_not_specified.lock")
)
end

Expand Down Expand Up @@ -135,7 +135,7 @@
let(:pipfile) do
Dependabot::DependencyFile.new(
name: "Pipfile",
content: fixture("pipfiles", "exact_version")
content: fixture("pipfile_files", "exact_version")
)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
let(:pipfile) do
Dependabot::DependencyFile.new(
name: "Pipfile",
content: fixture("pipfiles", pipfile_fixture_name)
content: fixture("pipfile_files", pipfile_fixture_name)
)
end
let(:pipfile_fixture_name) { "exact_version" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
let(:pipfile) do
Dependabot::DependencyFile.new(
name: "Pipfile",
content: fixture("pipfiles", pipfile_fixture_name)
content: fixture("pipfile_files", pipfile_fixture_name)
)
end
let(:pipfile_fixture_name) { "exact_version" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
let(:pipfile) do
Dependabot::DependencyFile.new(
name: "Pipfile",
content: fixture("pipfiles", pipfile_fixture_name)
content: fixture("pipfile_files", pipfile_fixture_name)
)
end
let(:pipfile_fixture_name) { "exact_version" }
let(:lockfile) do
Dependabot::DependencyFile.new(
name: "Pipfile.lock",
content: fixture("lockfiles", lockfile_fixture_name)
content: fixture("pipfile_files", lockfile_fixture_name)
)
end
let(:lockfile_fixture_name) { "exact_version.lock" }
Expand Down
4 changes: 2 additions & 2 deletions python/spec/dependabot/python/update_checker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
let(:pipfile) do
Dependabot::DependencyFile.new(
name: "Pipfile",
content: fixture("pipfiles", pipfile_fixture_name)
content: fixture("pipfile_files", pipfile_fixture_name)
)
end
let(:pipfile_fixture_name) { "exact_version" }
Expand Down Expand Up @@ -530,7 +530,7 @@
let(:lockfile) do
Dependabot::DependencyFile.new(
name: "Pipfile.lock",
content: fixture("lockfiles", "exact_version.lock")
content: fixture("pipfile_files", "exact_version.lock")
)
end

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit b21fe8f

Please sign in to comment.