diff --git a/lib/bibliothecary/parsers/pypi.rb b/lib/bibliothecary/parsers/pypi.rb index 02c2e079..511e6903 100644 --- a/lib/bibliothecary/parsers/pypi.rb +++ b/lib/bibliothecary/parsers/pypi.rb @@ -101,14 +101,14 @@ def self.parse_pyproject(file_contents, options: {}) # Parse poetry [tool.poetry] deps 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') + # Poetry 1.0.0-1.2.0 way of defining dev deps + 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 @@ -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 << { diff --git a/spec/fixtures/pyproject.toml b/spec/fixtures/pyproject.toml index 35a1f8ab..b7d86cd5 100644 --- a/spec/fixtures/pyproject.toml +++ b/spec/fixtures/pyproject.toml @@ -8,11 +8,11 @@ authors = ["Tyrel Souza "] python = "^3.7" django = "^3.0.7" -# Old way to defining dev deps (<1.2.0) +# Old way to define dev deps (<1.2.0) [tool.poetry.dev-dependencies] pytest = "^5.2" -# New way to defining dev deps (>=1.2.0) +# New way to define dev deps (>=1.2.0) [tool.poetry.group.dev.dependencies] wcwidth = "*" diff --git a/spec/parsers/pypi_spec.rb b/spec/parsers/pypi_spec.rb index 567ccbff..b02d7eee 100644 --- a/spec/parsers/pypi_spec.rb +++ b/spec/parsers/pypi_spec.rb @@ -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