bibliothecary 12.1.7 → 12.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18bfbedc4fbc53fe3e7f4ee02ee42ba27462dbc488efd3ee48a87e2ad12cd1e2
4
- data.tar.gz: 5210a4d460815bf40f21639b0a2d887a59b9672fdb64d97981809ab87cbae744
3
+ metadata.gz: 38a42d90ccaf9bb96b2be9c736b5559a3c3fa81286bbea8c404a33f3a4cb89be
4
+ data.tar.gz: 36b09c415f331863ba6ab1a82eff0a78cc759b01ae0bad339c9e6cc80c6789c1
5
5
  SHA512:
6
- metadata.gz: e0a2503b63e500193ba491ee1875ba0ded58a01d5fa6bed2eefae36cf2e4e6f0111a1f84dd1334b8bd3bf0b728065dcba299d19b7414d476f606554031840b7b
7
- data.tar.gz: dd586eb81b390826b23021edf014ff2adc2f6738487c18a51a1e08dc9ad0b10a6b8d9e20b79219411b45f3323221b9d0c0f0c8bc977feb7e90d66af8ce329fda
6
+ metadata.gz: 769fe185aedefda6b8c95c6c66700a070a4b7448a0ee452c8b1cbaf1507e3443945f6bef6ff7ead4e17458c43f81afbc86b2e0f592bb779d6f603b379a09fed6
7
+ data.tar.gz: 05d1709b1cb6410ff3250ea2472cefa2eec4f7dff5eca9864d9eb5837f107ec6aaf3fc629f6ba476e49b382e9a05951fdb25abbe04099d1b95124219891bb149
data/CHANGELOG.md CHANGED
@@ -13,6 +13,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
13
 
14
14
  ### Removed
15
15
 
16
+ ## [12.1.9] - 2025-05-16
17
+
18
+ ### Added
19
+
20
+ ### Changed
21
+
22
+ - Fix 12.1.8 Poetry regression that ignored deps with no category or group.
23
+
24
+ ### Removed
25
+
26
+ ## [12.1.8] - 2025-05-16
27
+
28
+ ### Added
29
+
30
+ - Support multiple requirements for a single package in poetry.lock.
31
+
32
+ ### Changed
33
+
34
+ ### Removed
35
+
16
36
  ## [12.1.7] - 2025-04-29
17
37
 
18
38
  ### Added
@@ -95,7 +115,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
95
115
 
96
116
  ### Added
97
117
 
98
- - Populate Bibliothecary::Dependency#source field in all parsers. This makes the source field useful when consuming
118
+ - Populate Bibliothecary::Dependency#source field in all parsers. This makes the source field useful when consuming
99
119
  from Bibliothecary, and removes a step from consumers having to populate this field themselves.
100
120
 
101
121
  ### Changed
@@ -138,9 +158,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
138
158
 
139
159
  ### Added
140
160
 
141
- - Support parsing *.spdx.json files
161
+ - Support parsing \*.spdx.json files
142
162
 
143
163
  ### Changed
164
+
144
165
  - `Bibliothecary::PURL_TYPE_MAPPING` has changed to `Bibliothecary::PurlUtil::PURL_TYPE_MAPPING`
145
166
  - `Bibliothecary::MultiParsers::CycloneDX::ManifestEntries.full_name_for_purl` has changed to `Bibliothecary::PurlUtil.full_name`
146
167
 
@@ -122,12 +122,6 @@ module Bibliothecary
122
122
  deps.uniq
123
123
  end
124
124
 
125
- # TODO: this was deprecated in 8.6.0. Remove this in any major version bump >= 9.*
126
- def self.parse_poetry(file_contents, options: {})
127
- puts "Warning: parse_poetry() is deprecated, use parse_pyproject() instead."
128
- parse_pyproject(file_contents, options)
129
- end
130
-
131
125
  def self.parse_conda(file_contents, options: {})
132
126
  contents = YAML.safe_load(file_contents)
133
127
  return [] unless contents
@@ -142,16 +136,31 @@ module Bibliothecary
142
136
  def self.map_dependencies(packages, type, source = nil)
143
137
  return [] unless packages
144
138
 
145
- packages.map do |name, package_info|
139
+ packages.flat_map do |name, package_info|
146
140
  local = true if package_info.is_a?(Hash) && (package_info.key?("path") || package_info.key?("file"))
147
141
 
148
- Dependency.new(
149
- name: name,
150
- requirement: map_requirements(package_info),
151
- type: type,
152
- source: source,
153
- local: local
154
- )
142
+ if package_info.is_a?(Array)
143
+ # Poetry supports multiple requirements with differing specifiers for the same
144
+ # package. Break these out into a separate dep per requirement.
145
+ # https://python-poetry.org/docs/dependency-specification/#multiple-constraints-dependencies
146
+ package_info.map do |info|
147
+ Dependency.new(
148
+ name: name,
149
+ requirement: map_requirements(info),
150
+ type: type,
151
+ source: source,
152
+ local: local
153
+ )
154
+ end
155
+ else
156
+ Dependency.new(
157
+ name: name,
158
+ requirement: map_requirements(package_info),
159
+ type: type,
160
+ source: source,
161
+ local: local
162
+ )
163
+ end
155
164
  end
156
165
  end
157
166
 
@@ -160,7 +169,7 @@ module Bibliothecary
160
169
  if info["version"]
161
170
  info["version"]
162
171
  elsif info["git"]
163
- "#{info['git']}##{info['ref']}"
172
+ "#{info['git']}##{info['ref'] || info['tag']}"
164
173
  else
165
174
  "*"
166
175
  end
@@ -186,19 +195,28 @@ module Bibliothecary
186
195
  deps = []
187
196
  manifest["package"].each do |package|
188
197
  # next if group == "_meta"
189
- group = case package["category"]
190
- when "dev"
191
- "develop"
192
- else
193
- "runtime"
194
- end
195
198
 
196
- deps << Dependency.new(
197
- name: package["name"],
198
- requirement: map_requirements(package),
199
- type: group,
200
- source: options.fetch(:filename, nil)
201
- )
199
+ # Poetry <1.2.0 used singular "category" for kind
200
+ # Poetry >=1.2.0 uses plural "groups" field for kind(s)
201
+ groups = package.values_at("category", "groups").flatten.compact
202
+ .map do |g|
203
+ if g == "dev"
204
+ "develop"
205
+ else
206
+ (g == "main" ? "runtime" : g)
207
+ end
208
+ end
209
+
210
+ groups = ["runtime"] if groups.empty?
211
+
212
+ groups.each do |group|
213
+ deps << Dependency.new(
214
+ name: package["name"],
215
+ requirement: map_requirements(package),
216
+ type: group,
217
+ source: options.fetch(:filename, nil)
218
+ )
219
+ end
202
220
  end
203
221
  deps
204
222
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bibliothecary
4
- VERSION = "12.1.7"
4
+ VERSION = "12.1.9"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bibliothecary
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.1.7
4
+ version: 12.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Nesbitt
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-04-30 00:00:00.000000000 Z
10
+ date: 2025-05-17 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: commander