bibliothecary 12.1.7 → 12.1.8

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: 77ce2638e657925c2ce0457675ddafea27858758ec53f68f996667eb21ac290c
4
+ data.tar.gz: 7027d2ce73799ee52fdb6665fbaa115d2d630676cf777a740d62fae5ffa90534
5
5
  SHA512:
6
- metadata.gz: e0a2503b63e500193ba491ee1875ba0ded58a01d5fa6bed2eefae36cf2e4e6f0111a1f84dd1334b8bd3bf0b728065dcba299d19b7414d476f606554031840b7b
7
- data.tar.gz: dd586eb81b390826b23021edf014ff2adc2f6738487c18a51a1e08dc9ad0b10a6b8d9e20b79219411b45f3323221b9d0c0f0c8bc977feb7e90d66af8ce329fda
6
+ metadata.gz: 9f12ee44667a46ec862d620870f1372755efe70af26243320b785e854c37e6ed7047d0988eadbe9758a9194c32d5f85772f5b2f9d69ee2a9e19e13a9873f937a
7
+ data.tar.gz: 660b68966106543fbc7c8326a77ca5cc89947321dacf8f35a19aa1ee6818e4d077a1f1f0e86f1f8a7d6e52da6d377a7f8c90ac43d1b809158fe65c94dbaeb5c5
data/CHANGELOG.md CHANGED
@@ -13,6 +13,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
13
 
14
14
  ### Removed
15
15
 
16
+ ## [12.1.8] - 2025-05-16
17
+
18
+ ### Added
19
+
20
+ - Support multiple requirements for a single package in poetry.lock.
21
+
22
+ ### Changed
23
+
24
+ ### Removed
25
+
16
26
  ## [12.1.7] - 2025-04-29
17
27
 
18
28
  ### Added
@@ -95,7 +105,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
95
105
 
96
106
  ### Added
97
107
 
98
- - Populate Bibliothecary::Dependency#source field in all parsers. This makes the source field useful when consuming
108
+ - Populate Bibliothecary::Dependency#source field in all parsers. This makes the source field useful when consuming
99
109
  from Bibliothecary, and removes a step from consumers having to populate this field themselves.
100
110
 
101
111
  ### Changed
@@ -138,9 +148,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
138
148
 
139
149
  ### Added
140
150
 
141
- - Support parsing *.spdx.json files
151
+ - Support parsing \*.spdx.json files
142
152
 
143
153
  ### Changed
154
+
144
155
  - `Bibliothecary::PURL_TYPE_MAPPING` has changed to `Bibliothecary::PurlUtil::PURL_TYPE_MAPPING`
145
156
  - `Bibliothecary::MultiParsers::CycloneDX::ManifestEntries.full_name_for_purl` has changed to `Bibliothecary::PurlUtil.full_name`
146
157
 
@@ -142,16 +142,31 @@ module Bibliothecary
142
142
  def self.map_dependencies(packages, type, source = nil)
143
143
  return [] unless packages
144
144
 
145
- packages.map do |name, package_info|
145
+ packages.flat_map do |name, package_info|
146
146
  local = true if package_info.is_a?(Hash) && (package_info.key?("path") || package_info.key?("file"))
147
147
 
148
- Dependency.new(
149
- name: name,
150
- requirement: map_requirements(package_info),
151
- type: type,
152
- source: source,
153
- local: local
154
- )
148
+ if package_info.is_a?(Array)
149
+ # Poetry supports multiple requirements with differing specifiers for the same
150
+ # package. Break these out into a separate dep per requirement.
151
+ # https://python-poetry.org/docs/dependency-specification/#multiple-constraints-dependencies
152
+ package_info.map do |info|
153
+ Dependency.new(
154
+ name: name,
155
+ requirement: map_requirements(info),
156
+ type: type,
157
+ source: source,
158
+ local: local
159
+ )
160
+ end
161
+ else
162
+ Dependency.new(
163
+ name: name,
164
+ requirement: map_requirements(package_info),
165
+ type: type,
166
+ source: source,
167
+ local: local
168
+ )
169
+ end
155
170
  end
156
171
  end
157
172
 
@@ -160,7 +175,7 @@ module Bibliothecary
160
175
  if info["version"]
161
176
  info["version"]
162
177
  elsif info["git"]
163
- "#{info['git']}##{info['ref']}"
178
+ "#{info['git']}##{info['ref'] || info['tag']}"
164
179
  else
165
180
  "*"
166
181
  end
@@ -186,19 +201,25 @@ module Bibliothecary
186
201
  deps = []
187
202
  manifest["package"].each do |package|
188
203
  # next if group == "_meta"
189
- group = case package["category"]
190
- when "dev"
191
- "develop"
192
- else
193
- "runtime"
194
- end
195
204
 
196
- deps << Dependency.new(
197
- name: package["name"],
198
- requirement: map_requirements(package),
199
- type: group,
200
- source: options.fetch(:filename, nil)
201
- )
205
+ # Poetry <1.2.0 used singular "category" for kind
206
+ # Poetry >=1.2.0 uses plural "groups" field for kind(s)
207
+ package.values_at("category", "groups").flatten.compact
208
+ .map do |g|
209
+ if g == "dev"
210
+ "develop"
211
+ else
212
+ (g == "main" ? "runtime" : g)
213
+ end
214
+ end
215
+ .each do |group|
216
+ deps << Dependency.new(
217
+ name: package["name"],
218
+ requirement: map_requirements(package),
219
+ type: group,
220
+ source: options.fetch(:filename, nil)
221
+ )
222
+ end
202
223
  end
203
224
  deps
204
225
  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.8"
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.8
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-16 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: commander