Skip to content

Commit

Permalink
reorders package manager to default
Browse files Browse the repository at this point in the history
  • Loading branch information
sachin-sandhu committed Dec 23, 2024
1 parent 1fdcded commit 5e9bcf7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/lib/dependabot/python/file_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ def package_manager
def detected_package_manager
setup_python_environment if Dependabot::Experiments.enabled?(:enable_file_parser_python_local)

return PipCompilePackageManager.new(T.must(detect_pipcompile_version)) if detect_pipcompile_version

return PipenvPackageManager.new(T.must(detect_pipenv_version)) if detect_pipenv_version

return PoetryPackageManager.new(T.must(detect_poetry_version)) if detect_poetry_version

return PipCompilePackageManager.new(T.must(detect_pipcompile_version)) if detect_pipcompile_version

PipPackageManager.new(detect_pip_version)
end

Expand Down
13 changes: 13 additions & 0 deletions python/spec/dependabot/python/file_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,19 @@
)
end
end

it "returns the correct ecosystem and package manager set" do
parser.parse do |parser|
ecosystem = parser.ecosystem
package_manager = ecosystem.package_manager
language = ecosystem.language

puts(package_manager.name)
expect(ecosystem.name).to eq "python"
expect(package_manager.name).to "pip-compile"
expect(language.name).to eq "python"
end
end
end
end

Expand Down

0 comments on commit 5e9bcf7

Please sign in to comment.