dependabot-python 0.401.0 → 0.403.0
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/helpers/requirements.txt +3 -1
- data/lib/dependabot/python/file_updater/requirement_file_updater.rb +23 -2
- data/lib/dependabot/python/file_updater/requirement_replacer.rb +4 -1
- data/lib/dependabot/python/language.rb +3 -2
- data/lib/dependabot/python/update_checker/poetry_version_resolver.rb +16 -0
- data/lib/dependabot/python/update_checker.rb +2 -0
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a356ce1516395b575e6b2e0c814c8e8eaa53bd908b24d2b12dbf9bacc62d91a6
|
|
4
|
+
data.tar.gz: b28b4cb49fdda64b59b84597d47e2a60f393cc081948b9cfc31d5787975d4d8d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 918c03f9e57b1c853ab0448403cd6b797c2b199d1247bba325cfb8ab0b042d04a17f1bf67626e98048412e697201ec29033655b17737da193a041f7e7eae8be3
|
|
7
|
+
data.tar.gz: 31703938bf24482e8fc74fb8705d858072a5e190330b415b51e667da46941c3c6bac78bbd0b58a0ccd6646b24096c5b7026e24ba4aa14a404c4727845fa4b20a
|
data/helpers/requirements.txt
CHANGED
|
@@ -2,7 +2,9 @@ pip==26.2.1
|
|
|
2
2
|
pip-tools==7.6.1
|
|
3
3
|
flake8==7.4.1
|
|
4
4
|
hashin==1.0.5
|
|
5
|
-
pipenv
|
|
5
|
+
# pipenv 2024.4.1 fails to import on Python 3.15 (typing.no_type_check_decorator was removed)
|
|
6
|
+
pipenv==2024.4.1; python_version < "3.15"
|
|
7
|
+
pipenv==2025.1.1; python_version >= "3.15"
|
|
6
8
|
plette==2.2.1
|
|
7
9
|
poetry==2.5.1
|
|
8
10
|
pytest==9.1.1
|
|
@@ -85,8 +85,8 @@ module Dependabot
|
|
|
85
85
|
def unique_requirement_changes
|
|
86
86
|
previous_reqs = dependency.previous_requirements || []
|
|
87
87
|
|
|
88
|
-
changes = dependency.requirements.filter_map do |new_req|
|
|
89
|
-
old_req =
|
|
88
|
+
changes = dependency.requirements.each_with_index.filter_map do |new_req, index|
|
|
89
|
+
old_req = matching_previous_requirement(new_req, previous_reqs, index)
|
|
90
90
|
next if new_req == old_req
|
|
91
91
|
|
|
92
92
|
T.let([new_req, old_req], RequirementChange)
|
|
@@ -99,6 +99,27 @@ module Dependabot
|
|
|
99
99
|
end
|
|
100
100
|
end
|
|
101
101
|
|
|
102
|
+
# Requirements and previous requirements are built in the same order, so
|
|
103
|
+
# pair them by position. The same package can be declared more than once
|
|
104
|
+
# in one file and group (e.g. with different environment markers), so
|
|
105
|
+
# matching on file and groups alone can pick the wrong declaration.
|
|
106
|
+
sig do
|
|
107
|
+
params(
|
|
108
|
+
new_req: Dependabot::DependencyRequirement,
|
|
109
|
+
previous_reqs: T::Array[Dependabot::DependencyRequirement],
|
|
110
|
+
index: Integer
|
|
111
|
+
).returns(T.nilable(Dependabot::DependencyRequirement))
|
|
112
|
+
end
|
|
113
|
+
def matching_previous_requirement(new_req, previous_reqs, index)
|
|
114
|
+
positional = previous_reqs[index]
|
|
115
|
+
if previous_reqs.length == dependency.requirements.length &&
|
|
116
|
+
positional&.file == new_req.file && positional&.groups == new_req.groups
|
|
117
|
+
return positional
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
previous_reqs.find { |r| r.file == new_req.file && r.groups == new_req.groups }
|
|
121
|
+
end
|
|
122
|
+
|
|
102
123
|
sig do
|
|
103
124
|
params(
|
|
104
125
|
content: String,
|
|
@@ -150,7 +150,10 @@ module Dependabot
|
|
|
150
150
|
after_escaped = Regexp.escape(after_name_extras)
|
|
151
151
|
# Match the dependency name with any extras (or none), followed by the requirement.
|
|
152
152
|
# This ensures a single gsub handles all extras variants of the same dependency.
|
|
153
|
-
|
|
153
|
+
# The requirement must end where the declaration's own specifiers end: ">=2.7.0" is the start of
|
|
154
|
+
# ">=2.7.0,<3.0.0" and ">=2.7.0,!=2.9.0; sys_platform == 'win32'", which are other declarations.
|
|
155
|
+
/(?<![\-\w\.\[])#{name_escaped}\s*\\?\s*(?:\[[^\]]*\])?\s*\\?\s*
|
|
156
|
+
#{after_escaped}(?![\-\w\.]|\s*,\s*\\?\s*[<>=!~])/x
|
|
154
157
|
end
|
|
155
158
|
|
|
156
159
|
sig { params(requirement: T.nilable(String)).returns(T::Boolean) }
|
|
@@ -16,8 +16,9 @@ module Dependabot
|
|
|
16
16
|
# e.g. ARG PY_3_13=3.13.x
|
|
17
17
|
# Note: uv ecosystem aliases this class, so updates here apply to both ecosystems.
|
|
18
18
|
PRE_INSTALLED_PYTHON_VERSIONS_RAW = %w(
|
|
19
|
-
3.
|
|
20
|
-
3.
|
|
19
|
+
3.15.2
|
|
20
|
+
3.14.9
|
|
21
|
+
3.13.17
|
|
21
22
|
3.12.13
|
|
22
23
|
3.11.15
|
|
23
24
|
3.10.20
|
|
@@ -421,6 +421,14 @@ module Dependabot
|
|
|
421
421
|
# if .toml has incorrect version specification i.e. <0.2.0app
|
|
422
422
|
INVALID_VERSION = /Could not parse version constraint: (?<ver>.*)/
|
|
423
423
|
|
|
424
|
+
# Poetry cannot read the poetry.lock: it has no lock-version (written by Poetry before 1.1), or its lock-version
|
|
425
|
+
# is newer than this Poetry reads. The warning for a merely newer lock-version says "might not be compatible".
|
|
426
|
+
LOCK_FILE_NOT_COMPATIBLE = /
|
|
427
|
+
The\slock\sfile\sis\snot\scompatible\swith\sthe\scurrent\sversion\sof\sPoetry\.\s+
|
|
428
|
+
(?:Upgrade\sPoetry\sto\sbe\sable\sto\sread\sthe\slock\sfile\sor,\salternatively,\sregenerate|Regenerate)
|
|
429
|
+
\sthe\slock\sfile\swith\sthe\s`poetry\slock`\scommand\.
|
|
430
|
+
/x
|
|
431
|
+
|
|
424
432
|
# dependency source link not accessible
|
|
425
433
|
INVALID_LINK = /No valid distribution links found for package: "(?<dep>.*)" version: "(?<ver>.*)"/
|
|
426
434
|
|
|
@@ -530,6 +538,7 @@ module Dependabot
|
|
|
530
538
|
raise DependencyFileNotResolvable, msg
|
|
531
539
|
end
|
|
532
540
|
|
|
541
|
+
handle_lock_file_not_compatible(error)
|
|
533
542
|
handle_enrich_constraints(error)
|
|
534
543
|
|
|
535
544
|
raise DependencyFileNotResolvable, error.message if error.message.match(PYTHON_RANGE_NOT_SATISFIED)
|
|
@@ -572,6 +581,13 @@ module Dependabot
|
|
|
572
581
|
|
|
573
582
|
private
|
|
574
583
|
|
|
584
|
+
sig { params(error: Exception).void }
|
|
585
|
+
def handle_lock_file_not_compatible(error)
|
|
586
|
+
return unless (msg = error.message.match(LOCK_FILE_NOT_COMPATIBLE))
|
|
587
|
+
|
|
588
|
+
raise DependencyFileNotResolvable, msg[0].to_s.gsub(/\s+/, " ")
|
|
589
|
+
end
|
|
590
|
+
|
|
575
591
|
sig { params(error: Exception).void }
|
|
576
592
|
def handle_enrich_constraints(error)
|
|
577
593
|
if (msg = error.message.match(INCOMPATIBLE_ENRICH_CONSTRAINTS))
|
|
@@ -420,6 +420,8 @@ module Dependabot
|
|
|
420
420
|
local_description = metadata.description
|
|
421
421
|
has_library_metadata = !local_description.nil?
|
|
422
422
|
|
|
423
|
+
return has_library_metadata if credentials.any? { |c| c["type"] == "python_index" && c.replaces_base? }
|
|
424
|
+
|
|
423
425
|
begin
|
|
424
426
|
response = Dependabot::RegistryClient.get(
|
|
425
427
|
url: "https://pypi.org/pypi/#{normalised_name(name)}/json/"
|
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.
|
|
4
|
+
version: 0.403.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dependabot
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - '='
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.
|
|
18
|
+
version: 0.403.0
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - '='
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.
|
|
25
|
+
version: 0.403.0
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: debug
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -331,7 +331,7 @@ licenses:
|
|
|
331
331
|
- MIT
|
|
332
332
|
metadata:
|
|
333
333
|
bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
|
|
334
|
-
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.
|
|
334
|
+
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.403.0
|
|
335
335
|
rdoc_options: []
|
|
336
336
|
require_paths:
|
|
337
337
|
- lib
|