bibliothecary 12.1.9 → 12.1.10

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: 38a42d90ccaf9bb96b2be9c736b5559a3c3fa81286bbea8c404a33f3a4cb89be
4
- data.tar.gz: 36b09c415f331863ba6ab1a82eff0a78cc759b01ae0bad339c9e6cc80c6789c1
3
+ metadata.gz: dfc52a5290fe4f0518906698b7dc69cf16b2a7747a130796162d8b8c431b6d9b
4
+ data.tar.gz: a68f8983ff54598396bf82d02a844ca867bd29a62044bede38ba13354d0a3386
5
5
  SHA512:
6
- metadata.gz: 769fe185aedefda6b8c95c6c66700a070a4b7448a0ee452c8b1cbaf1507e3443945f6bef6ff7ead4e17458c43f81afbc86b2e0f592bb779d6f603b379a09fed6
7
- data.tar.gz: 05d1709b1cb6410ff3250ea2472cefa2eec4f7dff5eca9864d9eb5837f107ec6aaf3fc629f6ba476e49b382e9a05951fdb25abbe04099d1b95124219891bb149
6
+ metadata.gz: '08a5bd08b3864366e22eb1baf58b1a35bd819997fc59a51adf412b6e5090b3d7534f045f8793ac79315be49aa151bb1d18b5dba33d53b0a9c5cbe72c7909c190'
7
+ data.tar.gz: c0574ce28cb9bcb5b3e03bab3e69859eb0e679fb809a0750d5bf7c3ba3efcf2585f61c65dbebf0c2d94edf3cd9b86b14bfea153c242a91a4b057443887c965c2
data/CHANGELOG.md CHANGED
@@ -13,6 +13,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
13
 
14
14
  ### Removed
15
15
 
16
+ ## [12.1.10] - 2025-05-23
17
+
18
+ ### Added
19
+
20
+ ### Changed
21
+
22
+ - Normalize package names in Poetry manifests, storing the original in
23
+ Dependency#original_name if it differs. This is because Poetry normalizes/canoncalizes
24
+ names in its lockfile according to PyPa's rules, but doesn't provide the original name.
25
+ Storing the original_name will provide a connection from manifest to lockfile.
26
+
27
+ ### Removed
28
+
16
29
  ## [12.1.9] - 2025-05-16
17
30
 
18
31
  ### Added
@@ -119,7 +119,15 @@ module Bibliothecary
119
119
 
120
120
  # We're combining both poetry+PEP621 deps instead of making them mutually exclusive, until we
121
121
  # find a reason not to ingest them both.
122
- deps.uniq
122
+ deps = deps.uniq
123
+
124
+ # Poetry normalizes names in lockfiles but doesn't provide the original, so we need to keep
125
+ # track of the original name so the dep is connected between manifest+lockfile.
126
+ deps.map do |dep|
127
+ normalized_name = normalize_name(dep.name)
128
+ Dependency.new(**dep.to_h, name: normalized_name,
129
+ original_name: normalized_name == dep.name ? nil : dep.name)
130
+ end
123
131
  end
124
132
 
125
133
  def self.parse_conda(file_contents, options: {})
@@ -210,8 +218,12 @@ module Bibliothecary
210
218
  groups = ["runtime"] if groups.empty?
211
219
 
212
220
  groups.each do |group|
221
+ # Poetry lockfiles should already contain normalizated names, but we'll
222
+ # apply it here as well just to be consistent with pyproject.toml parsing.
223
+ normalized_name = normalize_name(package["name"])
213
224
  deps << Dependency.new(
214
- name: package["name"],
225
+ name: normalized_name,
226
+ original_name: normalized_name == package["name"] ? nil : package["name"],
215
227
  requirement: map_requirements(package),
216
228
  type: group,
217
229
  source: options.fetch(:filename, nil)
@@ -332,6 +344,12 @@ module Bibliothecary
332
344
  requirement = "*" if requirement == ""
333
345
  [name, requirement]
334
346
  end
347
+
348
+ # Apply PyPa's name normalization rules to the package name
349
+ # https://packaging.python.org/en/latest/specifications/name-normalization/#name-normalization
350
+ def self.normalize_name(name)
351
+ name.downcase.gsub(/[-_.]+/, "-")
352
+ end
335
353
  end
336
354
  end
337
355
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bibliothecary
4
- VERSION = "12.1.9"
4
+ VERSION = "12.1.10"
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.9
4
+ version: 12.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Nesbitt
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-05-17 00:00:00.000000000 Z
10
+ date: 2025-05-23 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: commander