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 27, 2024
1 parent 946813d commit eb63f7c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/lib/dependabot/python/file_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class FileParser < Dependabot::FileParsers::Base
require_relative "file_parser/pipfile_files_parser"
require_relative "file_parser/pyproject_files_parser"
require_relative "file_parser/setup_file_parser"
require_relative "file_parser/python_requirement_parser"

DEPENDENCY_GROUP_KEYS = [
{
Expand Down Expand Up @@ -97,12 +98,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
8 changes: 8 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,14 @@
)
end
end

it "returns the correct ecosystem and package manager set" do
ecosystem = parser.ecosystem

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

Expand Down

0 comments on commit eb63f7c

Please sign in to comment.