bibliothecary 8.8.0 → 9.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +19 -11
- data/.rubocop.yml +1 -1
- data/.ruby-version +1 -1
- data/README.md +1 -1
- data/lib/bibliothecary/parsers/pypi.rb +20 -6
- data/lib/bibliothecary/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ee8f5b235766985dfe5ebab204d9102ab1ccaaa9d554bfe554717e5714a4d6a
|
4
|
+
data.tar.gz: 7c151adfd305c726b1fb071e057499b6db8e9ed23af5cae870faed1237ca3f12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23631d08bd943cf601e1304bcc4dfc02eb61dc23813919e5f3c3fc46c747ebb38d827f11ae559f80004c47751e74adc4aa98792d0176bec0ff3edff239018827
|
7
|
+
data.tar.gz: 3216f53aa721364f9f0209cb30a8b6a000e672a7ba874f4b5d2282a100611c5f1a26d9c921020fd3c4bf3e39ee0cb89ccbd63d91bfe462967ac85c28cd5b5e79
|
data/.circleci/config.yml
CHANGED
@@ -1,37 +1,45 @@
|
|
1
1
|
version: 2.1
|
2
2
|
orbs:
|
3
|
-
ruby: circleci/ruby@
|
3
|
+
ruby: circleci/ruby@2.1.3
|
4
4
|
|
5
5
|
executors:
|
6
6
|
bibliothecary:
|
7
7
|
docker:
|
8
|
-
- image: cimg/ruby:
|
8
|
+
- image: cimg/ruby:3.0.7
|
9
9
|
working_directory: ~/bibliothecary
|
10
10
|
|
11
|
+
|
12
|
+
commands:
|
13
|
+
setup-ruby-env:
|
14
|
+
description: "Some requirements to ensure that the ruby orb install-deps works"
|
15
|
+
steps:
|
16
|
+
- run:
|
17
|
+
name: Prep ruby
|
18
|
+
command: |
|
19
|
+
touch /tmp/ruby-project-lockfile
|
20
|
+
bundle lock --add-platform x86_64-linux
|
21
|
+
- ruby/install-deps:
|
22
|
+
bundler-version: "2.3"
|
23
|
+
|
24
|
+
|
11
25
|
jobs:
|
12
26
|
test:
|
13
27
|
executor: bibliothecary
|
14
28
|
steps:
|
15
29
|
- checkout
|
16
|
-
-
|
17
|
-
name: Which bundler?
|
18
|
-
command: bundle -v
|
19
|
-
- ruby/bundle-install
|
30
|
+
- setup-ruby-env
|
20
31
|
- run:
|
21
32
|
name: Run specs
|
22
33
|
command: bundle exec rake spec
|
23
34
|
- run:
|
24
35
|
name: CodeClimate
|
25
|
-
command: bundle exec codeclimate-test-reporter
|
36
|
+
command: bundle exec codeclimate-test-reporter
|
26
37
|
|
27
38
|
lint:
|
28
39
|
executor: bibliothecary
|
29
40
|
steps:
|
30
41
|
- checkout
|
31
|
-
-
|
32
|
-
name: Which bundler?
|
33
|
-
command: bundle -v
|
34
|
-
- ruby/bundle-install
|
42
|
+
- setup-ruby-env
|
35
43
|
- run:
|
36
44
|
name: Run specs
|
37
45
|
command: bundle exec rake lint
|
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.7
|
data/README.md
CHANGED
@@ -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:
|
4
|
+
version: 9.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Nesbitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tomlrb
|
@@ -341,7 +341,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
341
341
|
- !ruby/object:Gem::Version
|
342
342
|
version: '0'
|
343
343
|
requirements: []
|
344
|
-
rubygems_version: 3.
|
344
|
+
rubygems_version: 3.2.33
|
345
345
|
signing_key:
|
346
346
|
specification_version: 4
|
347
347
|
summary: Find and parse manifests
|