bibliothecary 8.8.0 → 8.8.1
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/lib/bibliothecary/parsers/pypi.rb +20 -6
- data/lib/bibliothecary/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dc9dd3ee94e4de1a66c6dabac392832a1ba6805dbef22398665697a85bc8a420
|
|
4
|
+
data.tar.gz: 800a427c7e9fbe6d12d116c1c0e57373136421dd99b6fc272218fad3c47db72d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d8da425a16d0378c3a73658df752804af3f9c78d31eccb7a26e0abf0b469f0dfa9c8a1d17f907c77255015499e9f947b1b63823641762be161cb4248afb8a2b6
|
|
7
|
+
data.tar.gz: 16d78e7dc17c53d79a6b634dde2ca7b73d8cccaa9db4435956ef752de6fa7c73a6d92a8486576beab838bc12a328016274ca850f2b54ed7e875110c1e38f0a74
|
|
@@ -9,8 +9,8 @@ module Bibliothecary
|
|
|
9
9
|
# Optional Group 2 is [extras].
|
|
10
10
|
# Capture Group 3 is Version
|
|
11
11
|
REQUIRE_REGEXP = /([a-zA-Z0-9]+[a-zA-Z0-9\-_\.]+)(?:\[.*?\])*([><=\w\.,]+)?/
|
|
12
|
-
|
|
13
12
|
REQUIREMENTS_REGEXP = /^#{REQUIRE_REGEXP}/
|
|
13
|
+
|
|
14
14
|
MANIFEST_REGEXP = /.*require[^\/]*(\/)?[^\/]*\.(txt|pip|in)$/
|
|
15
15
|
# TODO: can this be a more specific regexp so it doesn't match something like ".yarn/cache/create-require-npm-1.0.0.zip"?
|
|
16
16
|
PIP_COMPILE_REGEXP = /.*require.*$/
|
|
@@ -45,6 +45,10 @@ module Bibliothecary
|
|
|
45
45
|
kind: "lockfile",
|
|
46
46
|
parser: :parse_requirements_txt,
|
|
47
47
|
},
|
|
48
|
+
match_filename("pip-dependency-graph.json") => { # Exported from pipdeptree --json
|
|
49
|
+
kind: "lockfile",
|
|
50
|
+
parser: :parse_dependency_tree_json,
|
|
51
|
+
},
|
|
48
52
|
match_filename("setup.py") => {
|
|
49
53
|
kind: "manifest",
|
|
50
54
|
parser: :parse_setup_py,
|
|
@@ -226,6 +230,18 @@ module Bibliothecary
|
|
|
226
230
|
# should be treated as.
|
|
227
231
|
NoEggSpecified = Class.new(ArgumentError)
|
|
228
232
|
|
|
233
|
+
def self.parse_dependency_tree_json(file_contents, options: {})
|
|
234
|
+
JSON.parse(file_contents)
|
|
235
|
+
.map do |pkg|
|
|
236
|
+
{
|
|
237
|
+
name: pkg.dig("package", "package_name"),
|
|
238
|
+
requirement: pkg.dig("package", "installed_version"),
|
|
239
|
+
type: "runtime",
|
|
240
|
+
}
|
|
241
|
+
end
|
|
242
|
+
.uniq
|
|
243
|
+
end
|
|
244
|
+
|
|
229
245
|
# Parses a requirements.txt file, following the
|
|
230
246
|
# https://pip.pypa.io/en/stable/cli/pip_install/#requirement-specifiers
|
|
231
247
|
# and https://pip.pypa.io/en/stable/topics/vcs-support/#git.
|
|
@@ -252,10 +268,7 @@ module Bibliothecary
|
|
|
252
268
|
deps << result.merge(
|
|
253
269
|
type: type
|
|
254
270
|
)
|
|
255
|
-
|
|
256
|
-
match = line.delete(" ").match(REQUIREMENTS_REGEXP)
|
|
257
|
-
next unless match
|
|
258
|
-
|
|
271
|
+
elsif (match = line.delete(" ").match(REQUIREMENTS_REGEXP))
|
|
259
272
|
deps << {
|
|
260
273
|
name: match[1],
|
|
261
274
|
requirement: match[-1] || "*",
|
|
@@ -263,7 +276,8 @@ module Bibliothecary
|
|
|
263
276
|
}
|
|
264
277
|
end
|
|
265
278
|
end
|
|
266
|
-
|
|
279
|
+
|
|
280
|
+
deps.uniq
|
|
267
281
|
end
|
|
268
282
|
|
|
269
283
|
def self.parse_requirements_txt_url(url)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bibliothecary
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 8.8.
|
|
4
|
+
version: 8.8.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Nesbitt
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-05-
|
|
11
|
+
date: 2024-05-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: tomlrb
|
|
@@ -248,7 +248,7 @@ dependencies:
|
|
|
248
248
|
- - ">="
|
|
249
249
|
- !ruby/object:Gem::Version
|
|
250
250
|
version: '0'
|
|
251
|
-
description:
|
|
251
|
+
description:
|
|
252
252
|
email:
|
|
253
253
|
- andrewnez@gmail.com
|
|
254
254
|
executables:
|
|
@@ -326,7 +326,7 @@ homepage: https://github.com/librariesio/bibliothecary
|
|
|
326
326
|
licenses:
|
|
327
327
|
- AGPL-3.0
|
|
328
328
|
metadata: {}
|
|
329
|
-
post_install_message:
|
|
329
|
+
post_install_message:
|
|
330
330
|
rdoc_options: []
|
|
331
331
|
require_paths:
|
|
332
332
|
- lib
|
|
@@ -341,8 +341,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
341
341
|
- !ruby/object:Gem::Version
|
|
342
342
|
version: '0'
|
|
343
343
|
requirements: []
|
|
344
|
-
rubygems_version: 3.
|
|
345
|
-
signing_key:
|
|
344
|
+
rubygems_version: 3.3.22
|
|
345
|
+
signing_key:
|
|
346
346
|
specification_version: 4
|
|
347
347
|
summary: Find and parse manifests
|
|
348
348
|
test_files: []
|