bibliothecary 14.0.1 → 14.0.2

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: 473d02467e27047374ca2a13db7d60fa63bdb749e043eadbbc455a64b42366d3
4
- data.tar.gz: 31e31e7cb80446f4a8e0e8a9ce59c4a7af8eb9d76086168a442e3eac47732495
3
+ metadata.gz: bded2f923188e40707913d6539d5e876d2ff0334233985528a1b4caa3e686037
4
+ data.tar.gz: 49f76a339d1141d4b8f0940ad4dc66eb3533773e37d288825c71685f8f78ca3e
5
5
  SHA512:
6
- metadata.gz: f0de19e738a8b76dd4afdbdacfb7f008bbafe61860cea67367613e3f1eee964a08e0f672b7e7fd3b7e6afd4c05cb1342926ba935ad8928fc12b9eb9ed3006000
7
- data.tar.gz: dd653fed08d2c0ca27ab9c9276f547eca550060ecbd85dddfb5bd65fa8757216f7289909a4fa0b3405cb6cf20c05b448cac539fe1668813847e54894fc26525f
6
+ metadata.gz: 3f9e93bbf8341d3a27b22a2661a79225ae64721f3ea63348364d215ca4b73e19bbce6b3a8409cb590851f332fc9c404b1dd18bd0c621418cd139f216e9ed509c
7
+ data.tar.gz: 8483dc5f0ff491a9259f909e1cc8734a2c159c408733736e50d11c71b07810e0632e00d75bc8f05b5ab342389bfa0f271b430a6ea2ab74e80b3e3fdb9f05a26c
data/CHANGELOG.md CHANGED
@@ -13,6 +13,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
13
 
14
14
  ### Removed
15
15
 
16
+ ## [14.0.2] - 2025-07-29
17
+
18
+ ### Added
19
+
20
+ - Add support in Pypi parser for PEP-751's newly official "pylock.toml" lockfile
21
+
22
+ ### Changed
23
+
24
+ - Added a regression test to ensure "file" entries in Pipfile/Pipfile.lock are considered local.
25
+
26
+ ### Removed
27
+
16
28
  ## [14.0.1] - 2025-07-24
17
29
 
18
30
  ### Changed
@@ -20,6 +20,10 @@ module Bibliothecary
20
20
  # Adapted from https://peps.python.org/pep-0508/#names
21
21
  PEP_508_NAME_REGEXP = /^([A-Z0-9][A-Z0-9._-]*[A-Z0-9]|[A-Z0-9])/i
22
22
 
23
+ # A modified version of the regexp from the docs, to catch all cases:
24
+ # https://packaging.python.org/en/latest/specifications/pylock-toml/
25
+ PEP_751_LOCKFILE_REGEXP = /^pylock(\.[^.]+)?\.toml$/
26
+
23
27
  def self.mapping
24
28
  {
25
29
  match_filenames("requirements-dev.txt", "requirements/dev.txt",
@@ -72,6 +76,11 @@ module Bibliothecary
72
76
  kind: "lockfile",
73
77
  parser: :parse_poetry_lock,
74
78
  },
79
+ # PEP-751: official python lockfile format (https://peps.python.org/pep-0751/)
80
+ ->(p) { PEP_751_LOCKFILE_REGEXP.match(p) } => {
81
+ kind: "lockfile",
82
+ parser: :parser_pylock,
83
+ },
75
84
  }
76
85
  end
77
86
 
@@ -79,6 +88,22 @@ module Bibliothecary
79
88
  add_multi_parser(Bibliothecary::MultiParsers::DependenciesCSV)
80
89
  add_multi_parser(Bibliothecary::MultiParsers::Spdx)
81
90
 
91
+ def self.parser_pylock(file_contents, options: {})
92
+ lockfile = Tomlrb.parse(file_contents)
93
+ dependencies = lockfile["packages"].map do |d|
94
+ is_local = true if d.key?("archive") || d.key?("directory")
95
+ Dependency.new(
96
+ platform: platform_name,
97
+ name: d["name"],
98
+ type: "runtime",
99
+ source: options.fetch(:filename, nil),
100
+ requirement: d["version"] || "*",
101
+ local: is_local
102
+ )
103
+ end
104
+ ParserResult.new(dependencies: dependencies)
105
+ end
106
+
82
107
  def self.parse_pipfile(file_contents, options: {})
83
108
  manifest = Tomlrb.parse(file_contents)
84
109
  dependencies = map_dependencies(manifest["packages"], "runtime", options.fetch(:filename, nil)) +
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bibliothecary
4
- VERSION = "14.0.1"
4
+ VERSION = "14.0.2"
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: 14.0.1
4
+ version: 14.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Nesbitt
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-07-24 00:00:00.000000000 Z
10
+ date: 2025-07-29 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: commander