dependabot-uv 0.394.0 → 0.395.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9eee59202ca318e612e23d7303309e498d51999cda642a1660d41390a2bd4a8
4
- data.tar.gz: 3b3bb2ea60f190db5d8c9bd36f1ff01531097788c3755c6638d5a4e8e3ebf923
3
+ metadata.gz: c5e87aed24a3d0d1e38f69d064fa0d05ea3aa5db358ffe8b8aca51b0ba814f41
4
+ data.tar.gz: a79f5e14f753586b9a66310917f590bf7ac1065318cbd9f18cecf43c54a4ae24
5
5
  SHA512:
6
- metadata.gz: 2f6d9c0f1ea2c05bab8acea5563a4a74c016ab9b8bd77639afe9468a8f7b8cb18d238585b5bdc11b255bf8e8d0af01d7d470c07ab9b83792d8001156bb73a199
7
- data.tar.gz: '09c83e67c0b94adf7ad3f848f17521b57e282ef33db9d4ac0b5991d0ea8135024fc9eb5e78a1515a7f9f4c826f8db3347e25b24ed842ed85681a0b3dd8289e94'
6
+ metadata.gz: e5c993116408e7948b8d4622ad7d76e1a9a4a9fde594072883d0dd1d8e8275531a5f4d2be045fb599b61f26577d72bee2e1111a226fccb39f73058d826f66e1f
7
+ data.tar.gz: 3fb63ce5867dc87ee0ee729cb97d67c88069517f31b046d46ca9db30e27138d617af03499392543360bab156018b2ef67550d3b49c7f041468611acf50ad0097
@@ -7,7 +7,7 @@ plette==2.2.1
7
7
  poetry==2.4.1
8
8
  # TODO: Replace 3p package `tomli` with 3.11's new stdlib `tomllib` once we drop support for Python 3.10.
9
9
  tomli==2.4.1
10
- uv==0.12.5
10
+ uv==0.12.7
11
11
 
12
12
  # Some dependencies will only install if Cython is present
13
13
  Cython==3.3.0
@@ -18,7 +18,7 @@ require "dependabot/uv/authed_url_builder"
18
18
  module Dependabot
19
19
  module Uv
20
20
  class FileUpdater
21
- # rubocop:disable Metrics/ClassLength
21
+ # rubocop:disable-next Metrics/ClassLength
22
22
  class CompileFileUpdater
23
23
  extend T::Sig
24
24
 
@@ -434,12 +434,17 @@ module Dependabot
434
434
  args << index_url if index_url
435
435
 
436
436
  begin
437
+ helper_result = SharedHelpers.run_helper_subprocess(
438
+ command: "pyenv exec python3 #{NativeHelpers.python_helper_path}",
439
+ function: "get_dependency_hash",
440
+ args: args
441
+ )
442
+
443
+ # Skip this index if helper returned nil (can happen with unavailable registries)
444
+ next if helper_result.nil?
445
+
437
446
  native_helper_hashes = T.cast(
438
- SharedHelpers.run_helper_subprocess(
439
- command: "pyenv exec python3 #{NativeHelpers.python_helper_path}",
440
- function: "get_dependency_hash",
441
- args: args
442
- ),
447
+ helper_result,
443
448
  T::Array[T::Hash[String, String]]
444
449
  ).map { |h| "--hash=#{algorithm}:#{h['hash']}" }
445
450
 
@@ -451,6 +456,8 @@ module Dependabot
451
456
  end
452
457
  end
453
458
 
459
+ raise DependencyFileNotResolvable, "Unable to find hashes for package #{name}" if hashes.empty?
460
+
454
461
  hashes
455
462
  end
456
463
 
@@ -665,7 +672,6 @@ module Dependabot
665
672
  dependency_files.select { |f| f.name.end_with?(".txt") }
666
673
  end
667
674
  end
668
- # rubocop:enable Metrics/ClassLength
669
675
  end
670
676
  end
671
677
  end
@@ -18,7 +18,7 @@ require "dependabot/uv/requirement_suffix_helper"
18
18
  module Dependabot
19
19
  module Uv
20
20
  class FileUpdater
21
- # rubocop:disable Metrics/ClassLength
21
+ # rubocop:disable-next Metrics/ClassLength
22
22
  class LockFileUpdater
23
23
  extend T::Sig
24
24
 
@@ -798,7 +798,6 @@ module Dependabot
798
798
  )
799
799
  end
800
800
  end
801
- # rubocop:enable Metrics/ClassLength
802
801
  end
803
802
  end
804
803
  end
@@ -1,4 +1,4 @@
1
- # typed: strict
1
+ # typed: strong
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "toml-rb"
@@ -13,6 +13,8 @@ module Dependabot
13
13
  class VersionConfigParser
14
14
  extend T::Sig
15
15
 
16
+ ObjectHash = T.type_alias { T::Hash[String, Object] }
17
+
16
18
  class VersionConfig < T::Struct
17
19
  extend T::Sig
18
20
 
@@ -32,7 +34,7 @@ module Dependabot
32
34
  @pyproject_content = pyproject_content
33
35
  @base_path = base_path
34
36
  @repo_root = repo_root
35
- @parsed_pyproject = T.let(nil, T.nilable(T::Hash[String, T.untyped]))
37
+ @parsed_pyproject = T.let(nil, T.nilable(ObjectHash))
36
38
  end
37
39
 
38
40
  sig { returns(VersionConfig) }
@@ -56,15 +58,46 @@ module Dependabot
56
58
  sig { returns(String) }
57
59
  attr_reader :repo_root
58
60
 
59
- sig { returns(T::Hash[String, T.untyped]) }
61
+ sig { returns(ObjectHash) }
60
62
  def parsed_pyproject
61
63
  return @parsed_pyproject unless @parsed_pyproject.nil?
62
64
 
63
- @parsed_pyproject = TomlRB.parse(pyproject_content)
65
+ @parsed_pyproject = object_hash(T.cast(TomlRB.parse(pyproject_content), Object))
64
66
  rescue TomlRB::ParseError, TomlRB::ValueOverwriteError
65
67
  @parsed_pyproject = {}
66
68
  end
67
69
 
70
+ sig { params(value: Object).returns(ObjectHash) }
71
+ def object_hash(value)
72
+ raise TypeError, "Version configuration must be a table" unless value.is_a?(Hash)
73
+
74
+ result = T.let({}, ObjectHash)
75
+ value.each do |raw_key, raw_value|
76
+ key = T.cast(raw_key, Object)
77
+ raise TypeError, "Version configuration keys must be strings" unless key.is_a?(String)
78
+
79
+ result[key] = T.cast(raw_value, Object)
80
+ end
81
+ result
82
+ end
83
+
84
+ sig { params(path: T::Array[String]).returns(Object) }
85
+ def config_value(path)
86
+ value = T.let(parsed_pyproject, Object)
87
+ path.each do |key|
88
+ return nil if value.nil?
89
+
90
+ value = object_hash(value)[key]
91
+ end
92
+ value
93
+ end
94
+
95
+ sig { params(path: T::Array[String]).returns(T.nilable(ObjectHash)) }
96
+ def config_table(path)
97
+ value = config_value(path)
98
+ object_hash(value) if value.is_a?(Hash)
99
+ end
100
+
68
101
  sig { returns(T::Array[String]) }
69
102
  def collect_write_paths
70
103
  paths = []
@@ -82,8 +115,8 @@ module Dependabot
82
115
 
83
116
  sig { returns(T::Array[String]) }
84
117
  def setuptools_scm_write_paths
85
- scm_config = parsed_pyproject.dig("tool", "setuptools_scm")
86
- return [] unless scm_config.is_a?(Hash)
118
+ scm_config = config_table(%w(tool setuptools_scm))
119
+ return [] unless scm_config
87
120
 
88
121
  paths = []
89
122
 
@@ -98,8 +131,8 @@ module Dependabot
98
131
 
99
132
  sig { returns(T::Array[String]) }
100
133
  def hatch_vcs_build_hook_write_paths
101
- vcs_hook = parsed_pyproject.dig("tool", "hatch", "build", "hooks", "vcs")
102
- return [] unless vcs_hook.is_a?(Hash)
134
+ vcs_hook = config_table(%w(tool hatch build hooks vcs))
135
+ return [] unless vcs_hook
103
136
 
104
137
  paths = []
105
138
 
@@ -111,8 +144,8 @@ module Dependabot
111
144
 
112
145
  sig { returns(T::Array[String]) }
113
146
  def hatch_version_source_paths
114
- hatch_version = parsed_pyproject.dig("tool", "hatch", "version")
115
- return [] unless hatch_version.is_a?(Hash)
147
+ hatch_version = config_table(%w(tool hatch version))
148
+ return [] unless hatch_version
116
149
 
117
150
  paths = []
118
151
 
@@ -124,14 +157,14 @@ module Dependabot
124
157
 
125
158
  sig { returns(T.nilable(String)) }
126
159
  def extract_fallback_version
127
- scm_config = parsed_pyproject.dig("tool", "setuptools_scm")
128
- if scm_config.is_a?(Hash)
160
+ scm_config = config_table(%w(tool setuptools_scm))
161
+ if scm_config
129
162
  fallback = scm_config["fallback_version"]
130
163
  return fallback if fallback.is_a?(String)
131
164
  end
132
165
 
133
- raw_options = parsed_pyproject.dig("tool", "hatch", "version", "raw-options")
134
- if raw_options.is_a?(Hash)
166
+ raw_options = config_table(%w(tool hatch version raw-options))
167
+ if raw_options
135
168
  fallback = raw_options["fallback_version"]
136
169
  return fallback if fallback.is_a?(String)
137
170
  end
@@ -141,7 +174,7 @@ module Dependabot
141
174
 
142
175
  sig { returns(T.nilable(String)) }
143
176
  def extract_package_name
144
- name = parsed_pyproject.dig("project", "name")
177
+ name = config_value(%w(project name))
145
178
  return name if name.is_a?(String)
146
179
 
147
180
  nil
@@ -24,7 +24,7 @@ module Dependabot
24
24
  # This class does version resolution for pip-compile. Its approach is:
25
25
  # - Unlock the dependency we're checking in the requirements.in file
26
26
  # - Run `pip-compile` and see what the result is
27
- # rubocop:disable Metrics/ClassLength
27
+ # rubocop:disable-next Metrics/ClassLength
28
28
  class PipCompileVersionResolver
29
29
  extend T::Sig
30
30
 
@@ -595,7 +595,6 @@ module Dependabot
595
595
  dependency_files.select { |f| f.name.end_with?("setup.cfg") }
596
596
  end
597
597
  end
598
- # rubocop:enable Metrics/ClassLength
599
598
  end
600
599
 
601
600
  class PipCompileErrorHandler
@@ -228,11 +228,11 @@ module Dependabot
228
228
  requirement_files.any? { |f| f.end_with?("requirements.txt") }
229
229
  end
230
230
 
231
- sig { override.returns(T.nilable(T::Hash[String, T.untyped])) }
231
+ sig { override.returns(T.nilable(PyprojectDocument::ProjectMetadata)) }
232
232
  def library_details
233
233
  @library_details ||= T.let(
234
- standard_details || build_system_details,
235
- T.nilable(T::Hash[String, T.untyped])
234
+ pyproject_document.project_metadata || pyproject_document.build_system_metadata,
235
+ T.nilable(PyprojectDocument::ProjectMetadata)
236
236
  )
237
237
  end
238
238
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-uv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.394.0
4
+ version: 0.395.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
@@ -15,28 +15,28 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 0.394.0
18
+ version: 0.395.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.394.0
25
+ version: 0.395.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: dependabot-python
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - '='
31
31
  - !ruby/object:Gem::Version
32
- version: 0.394.0
32
+ version: 0.395.0
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - '='
38
38
  - !ruby/object:Gem::Version
39
- version: 0.394.0
39
+ version: 0.395.0
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: debug
42
42
  requirement: !ruby/object:Gem::Requirement
@@ -192,19 +192,19 @@ dependencies:
192
192
  - !ruby/object:Gem::Version
193
193
  version: '1.1'
194
194
  - !ruby/object:Gem::Dependency
195
- name: turbo_tests
195
+ name: turbo_tests2
196
196
  requirement: !ruby/object:Gem::Requirement
197
197
  requirements:
198
198
  - - "~>"
199
199
  - !ruby/object:Gem::Version
200
- version: 2.2.5
200
+ version: 3.2.7
201
201
  type: :development
202
202
  prerelease: false
203
203
  version_requirements: !ruby/object:Gem::Requirement
204
204
  requirements:
205
205
  - - "~>"
206
206
  - !ruby/object:Gem::Version
207
- version: 2.2.5
207
+ version: 3.2.7
208
208
  - !ruby/object:Gem::Dependency
209
209
  name: vcr
210
210
  requirement: !ruby/object:Gem::Requirement
@@ -301,7 +301,7 @@ licenses:
301
301
  - MIT
302
302
  metadata:
303
303
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
304
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.394.0
304
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.395.0
305
305
  rdoc_options: []
306
306
  require_paths:
307
307
  - lib