dependabot-python 0.110.16 → 0.110.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dependabot/python/file_parser/python_requirement_parser.rb +15 -8
- data/lib/dependabot/python/file_updater/pip_compile_file_updater.rb +12 -7
- data/lib/dependabot/python/file_updater/pipfile_file_updater.rb +1 -1
- data/lib/dependabot/python/file_updater/poetry_file_updater.rb +5 -8
- data/lib/dependabot/python/update_checker/pip_compile_version_resolver.rb +12 -7
- data/lib/dependabot/python/update_checker/pip_version_resolver.rb +12 -7
- data/lib/dependabot/python/update_checker/pipenv_version_resolver.rb +1 -1
- data/lib/dependabot/python/update_checker/poetry_version_resolver.rb +6 -7
- 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: 92b0bdc62cbfd3cbef19f87843e133359f893c29f27b0abbc59d3d570ebc4b92
|
4
|
+
data.tar.gz: b8256f11710fa5c15b5254a455ef66241db66aeae53a724febcd0fcf1a34efc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 391c44dc7177193877550bb2bf80ed36f65e8b6da3ab43b61a609a8e3c55e0731f7443ea00cf98d8fe078dbdfeaa4b56fb793fb4b536af541b235e720a34dcef
|
7
|
+
data.tar.gz: 56600829da49450e9bd34b9039c015d1f82d113b51e6578587b2579c1d935f3927eaa101762edc9e54e4d559b596e45726c480b50b28426ab550e15751d90456
|
@@ -17,12 +17,14 @@ module Dependabot
|
|
17
17
|
@dependency_files = dependency_files
|
18
18
|
end
|
19
19
|
|
20
|
-
def
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
20
|
+
def user_specified_requirements
|
21
|
+
[
|
22
|
+
pipfile_python_requirement,
|
23
|
+
pyproject_python_requirement,
|
24
|
+
python_version_file_version,
|
25
|
+
runtime_file_python_version,
|
25
26
|
setup_file_requirement
|
27
|
+
].compact
|
26
28
|
end
|
27
29
|
|
28
30
|
# TODO: Add better Python version detection using dependency versions
|
@@ -91,9 +93,14 @@ module Dependabot
|
|
91
93
|
def setup_file_requirement
|
92
94
|
return unless setup_file
|
93
95
|
|
94
|
-
setup_file.content.
|
95
|
-
|
96
|
-
|
96
|
+
req = setup_file.content.
|
97
|
+
match(/python_requires\s*=\s*['"](?<req>[^'"]+)['"]/)&.
|
98
|
+
named_captures&.fetch("req")&.strip
|
99
|
+
|
100
|
+
requirement_class.new(req)
|
101
|
+
req
|
102
|
+
rescue Gem::Requirement::BadRequirementError
|
103
|
+
nil
|
97
104
|
end
|
98
105
|
|
99
106
|
def pyenv_versions
|
@@ -532,13 +532,14 @@ module Dependabot
|
|
532
532
|
end
|
533
533
|
|
534
534
|
def user_specified_python_version
|
535
|
-
|
535
|
+
unless python_requirement_parser.user_specified_requirements.any?
|
536
|
+
return
|
537
|
+
end
|
536
538
|
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
python_version_matching([user_specified_requirement])
|
539
|
+
user_specified_requirements =
|
540
|
+
python_requirement_parser.user_specified_requirements.
|
541
|
+
map { |r| Python::Requirement.requirements_array(r) }
|
542
|
+
python_version_matching(user_specified_requirements)
|
542
543
|
end
|
543
544
|
|
544
545
|
def python_version_matching_imputed_requirements
|
@@ -552,7 +553,11 @@ module Dependabot
|
|
552
553
|
def python_version_matching(requirements)
|
553
554
|
PythonVersions::SUPPORTED_VERSIONS_TO_ITERATE.find do |version_string|
|
554
555
|
version = Python::Version.new(version_string)
|
555
|
-
requirements.all?
|
556
|
+
requirements.all? do |req|
|
557
|
+
next req.any? { |r| r.satisfied_by?(version) } if req.is_a?(Array)
|
558
|
+
|
559
|
+
req.satisfied_by?(version)
|
560
|
+
end
|
556
561
|
end
|
557
562
|
end
|
558
563
|
|
@@ -232,20 +232,17 @@ module Dependabot
|
|
232
232
|
end
|
233
233
|
|
234
234
|
def python_version
|
235
|
-
|
236
|
-
requirements =
|
235
|
+
requirements = python_requirement_parser.user_specified_requirements
|
236
|
+
requirements = requirements.
|
237
|
+
map { |r| Python::Requirement.requirements_array(r) }
|
237
238
|
|
238
239
|
PythonVersions::SUPPORTED_VERSIONS_TO_ITERATE.find do |version|
|
239
|
-
requirements.
|
240
|
-
r.satisfied_by?(Python::Version.new(version))
|
240
|
+
requirements.all? do |reqs|
|
241
|
+
reqs.any? { |r| r.satisfied_by?(Python::Version.new(version)) }
|
241
242
|
end
|
242
243
|
end
|
243
244
|
end
|
244
245
|
|
245
|
-
def user_specified_python_requirement
|
246
|
-
python_requirement_parser.user_specified_requirement
|
247
|
-
end
|
248
|
-
|
249
246
|
def python_requirement_parser
|
250
247
|
@python_requirement_parser ||=
|
251
248
|
FileParser::PythonRequirementParser.new(
|
@@ -448,13 +448,14 @@ module Dependabot
|
|
448
448
|
end
|
449
449
|
|
450
450
|
def user_specified_python_version
|
451
|
-
|
451
|
+
unless python_requirement_parser.user_specified_requirements.any?
|
452
|
+
return
|
453
|
+
end
|
452
454
|
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
python_version_matching([user_specified_requirement])
|
455
|
+
user_specified_requirements =
|
456
|
+
python_requirement_parser.user_specified_requirements.
|
457
|
+
map { |r| Python::Requirement.requirements_array(r) }
|
458
|
+
python_version_matching(user_specified_requirements)
|
458
459
|
end
|
459
460
|
|
460
461
|
def python_version_matching_imputed_requirements
|
@@ -468,7 +469,11 @@ module Dependabot
|
|
468
469
|
def python_version_matching(requirements)
|
469
470
|
PythonVersions::SUPPORTED_VERSIONS_TO_ITERATE.find do |version_string|
|
470
471
|
version = Python::Version.new(version_string)
|
471
|
-
requirements.all?
|
472
|
+
requirements.all? do |req|
|
473
|
+
next req.any? { |r| r.satisfied_by?(version) } if req.is_a?(Array)
|
474
|
+
|
475
|
+
req.satisfied_by?(version)
|
476
|
+
end
|
472
477
|
end
|
473
478
|
end
|
474
479
|
|
@@ -54,13 +54,14 @@ module Dependabot
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def user_specified_python_version
|
57
|
-
|
57
|
+
unless python_requirement_parser.user_specified_requirements.any?
|
58
|
+
return
|
59
|
+
end
|
58
60
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
python_version_matching([user_specified_requirement])
|
61
|
+
user_specified_requirements =
|
62
|
+
python_requirement_parser.user_specified_requirements.
|
63
|
+
map { |r| Python::Requirement.requirements_array(r) }
|
64
|
+
python_version_matching(user_specified_requirements)
|
64
65
|
end
|
65
66
|
|
66
67
|
def python_version_matching_imputed_requirements
|
@@ -74,7 +75,11 @@ module Dependabot
|
|
74
75
|
def python_version_matching(requirements)
|
75
76
|
PythonVersions::SUPPORTED_VERSIONS_TO_ITERATE.find do |version_string|
|
76
77
|
version = Python::Version.new(version_string)
|
77
|
-
requirements.all?
|
78
|
+
requirements.all? do |req|
|
79
|
+
next req.any? { |r| r.satisfied_by?(version) } if req.is_a?(Array)
|
80
|
+
|
81
|
+
req.satisfied_by?(version)
|
82
|
+
end
|
78
83
|
end
|
79
84
|
end
|
80
85
|
|
@@ -189,11 +189,14 @@ module Dependabot
|
|
189
189
|
end
|
190
190
|
|
191
191
|
def python_version
|
192
|
-
|
193
|
-
requirements =
|
192
|
+
requirements = python_requirement_parser.user_specified_requirements
|
193
|
+
requirements = requirements.
|
194
|
+
map { |r| Python::Requirement.requirements_array(r) }
|
194
195
|
|
195
196
|
version = PythonVersions::SUPPORTED_VERSIONS_TO_ITERATE.find do |v|
|
196
|
-
requirements.
|
197
|
+
requirements.all? do |reqs|
|
198
|
+
reqs.any? { |r| r.satisfied_by?(Python::Version.new(v)) }
|
199
|
+
end
|
197
200
|
end
|
198
201
|
return version if version
|
199
202
|
|
@@ -204,10 +207,6 @@ module Dependabot
|
|
204
207
|
raise DependencyFileNotResolvable, msg
|
205
208
|
end
|
206
209
|
|
207
|
-
def user_specified_python_requirement
|
208
|
-
python_requirement_parser.user_specified_requirement
|
209
|
-
end
|
210
|
-
|
211
210
|
def python_requirement_parser
|
212
211
|
@python_requirement_parser ||=
|
213
212
|
FileParser::PythonRequirementParser.new(
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dependabot-python
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.110.
|
4
|
+
version: 0.110.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dependabot
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.110.
|
19
|
+
version: 0.110.17
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.110.
|
26
|
+
version: 0.110.17
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: byebug
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|