diff --git a/python/lib/dependabot/python/file_parser.rb b/python/lib/dependabot/python/file_parser.rb index 9d540be242..2c8bc1cfac 100644 --- a/python/lib/dependabot/python/file_parser.rb +++ b/python/lib/dependabot/python/file_parser.rb @@ -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 = [ { @@ -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 diff --git a/python/spec/dependabot/python/file_parser_spec.rb b/python/spec/dependabot/python/file_parser_spec.rb index 8e3f5bd602..e7b8d79d5a 100644 --- a/python/spec/dependabot/python/file_parser_spec.rb +++ b/python/spec/dependabot/python/file_parser_spec.rb @@ -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