Skip to content

Commit

Permalink
Default to "runtime" type, and keep "develop"
Browse files Browse the repository at this point in the history
  • Loading branch information
tiegz committed Dec 9, 2023
1 parent 3ed4225 commit f334469
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions lib/bibliothecary/parsers/pypi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ def self.parse_pyproject(file_contents, options: {})
poetry_manifest = file_contents.fetch('tool', {}).fetch('poetry', {})
# Poetry 1.0.0-1.2.0 way of defining dev deps
deps += map_dependencies(poetry_manifest['dependencies'], 'runtime')
deps += map_dependencies(poetry_manifest['dev-dependencies'], 'development')
deps += map_dependencies(poetry_manifest['dev-dependencies'], 'develop')
# Poetry's 1.2.0+ of defining dev deps
poetry_manifest
.fetch("group", {})
.each_pair do |group_name, obj|
group_name = "development" if group_name == "dev"
group_name = "develop" if group_name == "dev"
deps += map_dependencies(obj.fetch("dependencies", {}), group_name)
end

Expand Down Expand Up @@ -187,10 +187,10 @@ def self.parse_poetry_lock(file_contents, options: {})
manifest["package"].each do |package|
# next if group == "_meta"
group = case package['category']
when 'main'
'runtime'
when 'dev'
'develop'
else
'runtime'
end

deps << {
Expand Down
4 changes: 2 additions & 2 deletions spec/parsers/pypi_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@
dependencies: [
{ name: "python", requirement: "^3.7", type: "runtime" },
{ name: "django", requirement: "^3.0.7", type: "runtime" },
{ name: "pytest", requirement: "^5.2", type: "development" },
{ name: "wcwidth", requirement: "*", type: "development" },
{ name: "pytest", requirement: "^5.2", type: "develop" },
{ name: "wcwidth", requirement: "*", type: "develop" },
],
kind: 'manifest',
success: true
Expand Down

0 comments on commit f334469

Please sign in to comment.