Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid trying to parse poetry.lock if pyproject.toml is invalid for Poetry #8223

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def dependency_set
dependency_set = Dependabot::FileParsers::Base::DependencySet.new

dependency_set += pyproject_dependencies if using_poetry? || using_pep621?
dependency_set += lockfile_dependencies if lockfile
dependency_set += lockfile_dependencies if using_poetry? && lockfile

dependency_set
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,23 @@
subject(:dependencies) { parser.dependency_set.dependencies }

its(:length) { is_expected.to eq(0) }

context "and a leftover poetry.lock" do
let(:poetry_lock) do
Dependabot::DependencyFile.new(
name: "poetry.lock",
content: poetry_lock_body
)
end
let(:poetry_lock_body) do
fixture("poetry_locks", poetry_lock_fixture_name)
end
let(:poetry_lock_fixture_name) { "poetry.lock" }

let(:files) { [pyproject, pdm_lock, poetry_lock] }

its(:length) { is_expected.to eq(0) }
end
end

context "with optional dependencies" do
Expand Down