Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5d46db7
fix(python): handle Poetry groups without dependencies table
julia-thorn Apr 10, 2026
b779d01
Merge branch 'main' into main
julia-thorn Apr 10, 2026
98cba57
Fix lint issue
julia-thorn Apr 10, 2026
93b7b66
Fix CoPilot suggestions
julia-thorn Apr 10, 2026
8ec7b81
Potential fix for pull request finding
julia-thorn Apr 10, 2026
7c37afb
Merge branch 'main' into main
julia-thorn Apr 14, 2026
c6d32ea
Merge branch 'main' into main
julia-thorn Apr 22, 2026
0ba52f1
Fix flaky smoke test
julia-thorn Apr 22, 2026
2cc12a3
Merge branch 'main' into main
julia-thorn Apr 22, 2026
133a269
Fix security alert
julia-thorn Apr 22, 2026
a189512
Revert "Fix security alert"
julia-thorn Apr 22, 2026
ec7d833
Revert "Fix flaky smoke test"
julia-thorn Apr 22, 2026
9b724ec
Merge branch 'main' into main
julia-thorn Apr 22, 2026
1807ab5
Merge branch 'main' into main
julia-thorn Apr 24, 2026
3c44fe0
Merge branch 'main' into main
julia-thorn May 1, 2026
09016db
trigger ci
julia-thorn May 1, 2026
67e1462
trigger ci
julia-thorn May 4, 2026
c860ee3
trigger ci
julia-thorn May 4, 2026
e12d623
trigger ci
julia-thorn May 4, 2026
99348ab
Merge branch 'main' into main
julia-thorn May 8, 2026
d286126
Merge branch 'main' into main
julia-thorn May 13, 2026
1217433
Merge branch 'main' into main
julia-thorn May 14, 2026
18768d8
Merge branch 'main' into main
julia-thorn May 15, 2026
043fe42
Merge branch 'main' into main
julia-thorn May 15, 2026
7267577
Merge branch 'main' into main
julia-thorn May 18, 2026
7dcc88f
Merge branch 'main' into main
markhallen May 20, 2026
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 @@ -113,12 +113,12 @@ def pep621_pep735_dependencies
sig do
params(
type: String,
deps_hash: T::Hash[String,
T.untyped]
deps_hash: T.nilable(T::Hash[String, T.untyped])
).returns(Dependabot::FileParsers::Base::DependencySet)
end
def parse_poetry_dependency_group(type, deps_hash)
dependencies = Dependabot::FileParsers::Base::DependencySet.new
return dependencies if deps_hash.nil?

Comment thread
julia-thorn marked this conversation as resolved.
deps_hash.each do |name, req|
next if normalise(name) == "python"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,10 @@ def set_target_dependency_req(pyproject_content, updated_requirement)
TomlRB.dump(pyproject_object)
end

sig { params(toml_node: T::Hash[String, T.untyped], requirement: String).void }
sig { params(toml_node: T.nilable(T::Hash[String, T.untyped]), requirement: String).void }
def update_dependency_requirement(toml_node, requirement)
return unless toml_node

names = toml_node.keys
pkg_name = names.find { |nm| normalise(nm) == dependency.name }
return unless pkg_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,21 @@
end
end

context "with optional poetry group metadata and pep735 groups" do
subject(:dependency_names) { dependencies.map(&:name) }

let(:pyproject_fixture_name) { "poetry_group_optional_without_dependencies.toml" }

it "parses without error when tool.poetry.group has no dependencies table" do
expect { parser.dependency_set }.not_to raise_error
end

it "includes dependencies declared in dependency-groups" do
expect(dependency_names).to include("requests")
expect(dependency_names).to include("onnxruntime-gpu")
end
end

context "with a group that has no dependencies key" do
subject(:dependency_names) { dependencies.map(&:name) }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@
it { is_expected.to eq(Gem::Version.new("2.18.4")) }
end

context "with a metadata-only poetry group" do
let(:pyproject_fixture_name) { "poetry_metadata_only_group.toml" }

it "resolves the latest version when a poetry group has no dependencies table" do
expect(latest_resolvable_version).to eq(Gem::Version.new("2.18.4"))
end
end

context "with a non-package mode project" do
let(:pyproject_fixture_name) { "poetry_non_package_mode_simple.toml" }
let(:lockfile_fixture_name) { "version_not_specified.lock" }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[tool.poetry]
name = "poetry-group-optional-without-dependencies"
version = "0.1.0"
description = ""
authors = ["Dependabot <support@dependabot.com>"]

[tool.poetry.dependencies]
python = ">=3.11"

[dependency-groups]
dev = [
"requests==2.18.0",
]
gpu = [
"onnxruntime-gpu==1.23.2",
]

[tool.poetry.group.gpu]
optional = true
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[tool.poetry]
name = "poetry-metadata-only-group"
version = "2.0.0"
homepage = "https://github.com/roghu/py3_projects"
license = "MIT"
readme = "README.md"
authors = ["Dependabot <support@dependabot.com>"]
description = "Various small python projects."

[tool.poetry.dependencies]
python = "3.11.1"
requests = "2.18.0"

[dependency-groups]
gpu = [
"onnxruntime-gpu==1.23.2",
]

[tool.poetry.group.gpu]
optional = true
Loading