bibliothecary 14.0.0 → 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 +18 -0
- data/lib/bibliothecary/analyser/analysis.rb +1 -1
- data/lib/bibliothecary/multi_parsers/cyclonedx.rb +2 -2
- data/lib/bibliothecary/multi_parsers/spdx.rb +2 -2
- 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,24 @@ 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
|
+
|
28
|
+
## [14.0.1] - 2025-07-24
|
29
|
+
|
30
|
+
### Changed
|
31
|
+
|
32
|
+
- Bugfix: implement Bibliothecary::ParserResult in SPDX parser too, and add an integration test.
|
33
|
+
|
16
34
|
## [14.0.0] - 2025-07-24
|
17
35
|
|
18
36
|
### Added
|
@@ -41,7 +41,7 @@ module Bibliothecary
|
|
41
41
|
# For example see conda.rb
|
42
42
|
kind = determine_kind_from_info(info)
|
43
43
|
parser_result = parse_file(info.relative_path, info.contents, options: options)
|
44
|
-
parser_result = ParserResult.new if parser_result.nil? # work around any legacy parsers that return nil
|
44
|
+
parser_result = ParserResult.new(dependencies: []) if parser_result.nil? # work around any legacy parsers that return nil
|
45
45
|
|
46
46
|
Bibliothecary::Analyser.create_analysis(platform_name, info.relative_path, kind, parser_result)
|
47
47
|
rescue Bibliothecary::FileParsingError => e
|
@@ -106,7 +106,7 @@ module Bibliothecary
|
|
106
106
|
component["purl"]
|
107
107
|
end
|
108
108
|
|
109
|
-
ParserResult.new(dependencies: entries[platform_name.to_sym])
|
109
|
+
ParserResult.new(dependencies: entries[platform_name.to_sym] || [])
|
110
110
|
end
|
111
111
|
|
112
112
|
def parse_cyclonedx_xml(file_contents, options: {})
|
@@ -131,7 +131,7 @@ module Bibliothecary
|
|
131
131
|
component.locate("purl").first&.text
|
132
132
|
end
|
133
133
|
|
134
|
-
ParserResult.new(dependencies: entries[platform_name.to_sym])
|
134
|
+
ParserResult.new(dependencies: entries[platform_name.to_sym] || [])
|
135
135
|
end
|
136
136
|
end
|
137
137
|
end
|
@@ -50,7 +50,7 @@ module Bibliothecary
|
|
50
50
|
|
51
51
|
raise NoEntries if entries.empty?
|
52
52
|
|
53
|
-
entries[platform_name.to_sym]
|
53
|
+
Bibliothecary::ParserResult.new(dependencies: entries[platform_name.to_sym] || [])
|
54
54
|
end
|
55
55
|
|
56
56
|
def parse_spdx_tag_value_file_contents(file_contents, source = nil)
|
@@ -104,7 +104,7 @@ module Bibliothecary
|
|
104
104
|
|
105
105
|
raise NoEntries if entries.empty?
|
106
106
|
|
107
|
-
entries[platform_name.to_sym]
|
107
|
+
Bibliothecary::ParserResult.new(dependencies: entries[platform_name.to_sym] || [])
|
108
108
|
end
|
109
109
|
|
110
110
|
def parse_spdx_json_file_contents(file_contents, source = nil)
|
@@ -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
|