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 +4 -4
- data/CHANGELOG.md +12 -0
- data/lib/bibliothecary/parsers/pypi.rb +25 -0
- data/lib/bibliothecary/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bded2f923188e40707913d6539d5e876d2ff0334233985528a1b4caa3e686037
|
4
|
+
data.tar.gz: 49f76a339d1141d4b8f0940ad4dc66eb3533773e37d288825c71685f8f78ca3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)) +
|
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.
|
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-
|
10
|
+
date: 2025-07-29 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: commander
|