dependabot-uv 0.372.0 → 0.374.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: 5b800f6ffdf570bc834de464268bdb32c5051b2af1f7e9e7b522430d6ce4f237
4
- data.tar.gz: c4da6008928f94391a149957c5e13bd0274adc0bca2602bc5b0408de8b01676b
3
+ metadata.gz: 2e6bf92dbfeb4d2c7671701d936b8176e501b09c321ad64801540e0a322f7bc7
4
+ data.tar.gz: 9fbff1b9ec1f035932b1e8183d51d0c2b3c1fba55ecf5d7432ec9933f1262f98
5
5
  SHA512:
6
- metadata.gz: 41b72c005c15263ccdf177000a5ced804ba43b73cf8170dfcb4f65cc4a1ef0a2d02e79146a2a94d81e859b9895a20c665c4e5d3e6fa4663e1af91c58ae858946
7
- data.tar.gz: b086ec486967b5a6c78f29611b8fe0adbbff911a4e8f46fc3188efb48d1791d0d2a6be24c7e6c0431bc6a46306b73c95c5bc6bc1a32c254495a0bcd3727a26ba
6
+ metadata.gz: 7c6e4c28cf13c55e33b75dbdf0c262e7b3897008de927df2ae56802d39cd798af3b1c1b65f3fd01d6d0c49788a1ca4cb754d612ca29c6d859814185119273289
7
+ data.tar.gz: 4d9bd0393f2c71a08aa867c81440a4ee0aefa7d770bf0c4da9ed428badce9d78e4599937512336123b85bc0c036dea96bc14c48abe6a395efaf8ae2aefe075a1
@@ -7,7 +7,7 @@ plette==2.1.0
7
7
  poetry==1.8.5
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.0.1
10
- uv==0.10.9
10
+ uv==0.11.8
11
11
 
12
12
  # Some dependencies will only install if Cython is present
13
13
  Cython==3.0.10
@@ -84,7 +84,9 @@ module Dependabot
84
84
  rels[parent].concat(lockfile_child_names(package_data))
85
85
  end
86
86
  rescue StandardError => e
87
- Dependabot.logger.warn("Failed to parse uv.lock relationships: #{e.message}")
87
+ errored_fetching_subdependencies!
88
+ @subdependency_error = e
89
+ Dependabot.logger.error("Failed to parse uv.lock relationships: #{e.message}")
88
90
  {}
89
91
  end
90
92
 
@@ -31,6 +31,7 @@ module Dependabot
31
31
  dependency_set = Dependabot::FileParsers::Base::DependencySet.new
32
32
 
33
33
  dependency_set += pyproject_dependencies if using_poetry? || using_pep621? || using_pep735?
34
+ dependency_set += workspace_member_dependencies if workspace_member_pyproject_files.any?
34
35
  dependency_set += lockfile_dependencies if using_poetry? && lockfile
35
36
 
36
37
  dependency_set
@@ -46,7 +47,7 @@ module Dependabot
46
47
  if using_poetry?
47
48
  poetry_dependencies
48
49
  else
49
- pep621_pep735_dependencies
50
+ pep621_pep735_dependencies(T.must(pyproject))
50
51
  end
51
52
  end
52
53
 
@@ -71,8 +72,8 @@ module Dependabot
71
72
  dependencies
72
73
  end
73
74
 
74
- sig { returns(Dependabot::FileParsers::Base::DependencySet) }
75
- def pep621_pep735_dependencies
75
+ sig { params(pyproject_file: Dependabot::DependencyFile).returns(Dependabot::FileParsers::Base::DependencySet) }
76
+ def pep621_pep735_dependencies(pyproject_file)
76
77
  dependencies = Dependabot::FileParsers::Base::DependencySet.new
77
78
 
78
79
  # PDM is not yet supported, so we want to ignore it for now because in
@@ -81,7 +82,7 @@ module Dependabot
81
82
  # undesirable. Leave PDM alone until properly supported
82
83
  return dependencies if using_pdm?
83
84
 
84
- parse_pep621_pep735_dependencies.each do |dep|
85
+ parse_pep621_pep735_dependencies(pyproject_file).each do |dep|
85
86
  # If a requirement has a `<` or `<=` marker then updating it is
86
87
  # probably blocked. Ignore it.
87
88
  next if dep["markers"]&.include?("<")
@@ -106,6 +107,22 @@ module Dependabot
106
107
  dependencies
107
108
  end
108
109
 
110
+ sig { returns(T::Array[Dependabot::DependencyFile]) }
111
+ def workspace_member_pyproject_files
112
+ dependency_files.select { |file| file.support_file? && file.name.end_with?("pyproject.toml") }
113
+ end
114
+
115
+ sig { returns(Dependabot::FileParsers::Base::DependencySet) }
116
+ def workspace_member_dependencies
117
+ dependencies = Dependabot::FileParsers::Base::DependencySet.new
118
+
119
+ workspace_member_pyproject_files.each do |pyproject_file|
120
+ dependencies += pep621_pep735_dependencies(pyproject_file)
121
+ end
122
+
123
+ dependencies
124
+ end
125
+
109
126
  sig do
110
127
  params(
111
128
  type: String,
@@ -298,24 +315,24 @@ module Dependabot
298
315
  poetry_lock
299
316
  end
300
317
 
301
- sig { returns(T.untyped) }
302
- def parse_pep621_pep735_dependencies
318
+ sig { params(pyproject_file: Dependabot::DependencyFile).returns(T.untyped) }
319
+ def parse_pep621_pep735_dependencies(pyproject_file)
303
320
  SharedHelpers.in_a_temporary_directory do
304
- write_temporary_pyproject
321
+ write_temporary_pyproject(pyproject_file)
305
322
 
306
323
  SharedHelpers.run_helper_subprocess(
307
324
  command: "pyenv exec python3 #{NativeHelpers.python_helper_path}",
308
325
  function: "parse_pep621_pep735_dependencies",
309
- args: [T.must(pyproject).name]
326
+ args: [pyproject_file.name]
310
327
  )
311
328
  end
312
329
  end
313
330
 
314
- sig { returns(Integer) }
315
- def write_temporary_pyproject
316
- path = T.must(pyproject).name
331
+ sig { params(pyproject_file: Dependabot::DependencyFile).returns(Integer) }
332
+ def write_temporary_pyproject(pyproject_file)
333
+ path = pyproject_file.name
317
334
  FileUtils.mkdir_p(Pathname.new(path).dirname)
318
- File.write(path, T.must(pyproject).content)
335
+ File.write(path, pyproject_file.content)
319
336
  end
320
337
 
321
338
  sig { returns(T.untyped) }
@@ -93,14 +93,13 @@ module Dependabot
93
93
  def fetch_updated_dependency_files
94
94
  return [] unless create_or_update_lock_file?
95
95
 
96
- updated_files = []
97
-
98
- if file_changed?(pyproject)
99
- updated_files <<
100
- updated_file(
101
- file: T.must(pyproject),
102
- content: T.must(updated_pyproject_content)
103
- )
96
+ updated_files = pyproject_files.filter_map do |file|
97
+ next unless file_changed?(file)
98
+
99
+ updated_file(
100
+ file: file,
101
+ content: T.must(updated_pyproject_content_for(file))
102
+ )
104
103
  end
105
104
 
106
105
  if lockfile && !build_system_only_dependency?
@@ -117,15 +116,20 @@ module Dependabot
117
116
 
118
117
  sig { returns(T.nilable(String)) }
119
118
  def updated_pyproject_content
120
- content = T.must(pyproject).content
121
- return content unless file_changed?(T.must(pyproject))
119
+ updated_pyproject_content_for(T.must(pyproject))
120
+ end
121
+
122
+ sig { params(file: Dependabot::DependencyFile).returns(T.nilable(String)) }
123
+ def updated_pyproject_content_for(file)
124
+ content = T.must(file.content)
125
+ return content unless file_changed?(file)
122
126
 
123
127
  updated_content = content.dup
124
128
 
125
129
  T.must(dependency).requirements.zip(T.must(T.must(dependency).previous_requirements)).each do |new_r, old_r|
126
- next unless new_r[:file] == T.must(pyproject).name && T.must(old_r)[:file] == T.must(pyproject).name
130
+ next unless new_r[:file] == file.name && T.must(old_r)[:file] == file.name
127
131
 
128
- updated_content = replace_dep(T.must(dependency), T.must(updated_content), new_r, T.must(old_r))
132
+ updated_content = replace_dep(T.must(dependency), updated_content, new_r, T.must(old_r))
129
133
  end
130
134
 
131
135
  raise DependencyFileContentNotChanged, "Content did not change!" if content == updated_content
@@ -302,12 +306,17 @@ module Dependabot
302
306
  dependency_files.each do |file|
303
307
  path = file.name
304
308
  FileUtils.mkdir_p(Pathname.new(path).dirname)
305
- File.write(path, file.content)
309
+ content = if file.name == "pyproject.toml"
310
+ pyproject_content
311
+ elsif file.name.end_with?("pyproject.toml") && file_changed?(file)
312
+ T.must(updated_pyproject_content_for(file))
313
+ else
314
+ T.must(file.content)
315
+ end
316
+
317
+ File.write(path, content)
306
318
  end
307
319
 
308
- # Overwrite the pyproject with updated content
309
- File.write("pyproject.toml", pyproject_content)
310
-
311
320
  ensure_version_file_directories
312
321
  end
313
322
 
@@ -598,6 +607,11 @@ module Dependabot
598
607
  )
599
608
  end
600
609
 
610
+ sig { returns(T::Array[Dependabot::DependencyFile]) }
611
+ def pyproject_files
612
+ dependency_files.select { |file| file.name.end_with?("pyproject.toml") }
613
+ end
614
+
601
615
  sig { returns(String) }
602
616
  def directory
603
617
  dependency_files.first&.directory || "/"
@@ -18,8 +18,8 @@ module Dependabot
18
18
 
19
19
  sig { override.returns(T::Array[DependencyFile]) }
20
20
  def updated_dependency_files
21
- updated_files = updated_pip_compile_based_files
22
- updated_files += updated_uv_lock_files
21
+ updated_files = updated_pip_compile_based_files + updated_uv_lock_files
22
+ updated_files = updated_files.reverse.uniq(&:name).reverse
23
23
 
24
24
  if updated_files.none? ||
25
25
  updated_files.sort_by(&:name) == dependency_files.sort_by(&:name)
@@ -158,7 +158,7 @@ module Dependabot
158
158
  requirement = reqs.find do |r|
159
159
  file = r[:file]
160
160
 
161
- file == "uv.lock" || file == "pyproject.toml" || file.end_with?(".in") || file.end_with?(".txt")
161
+ file == "uv.lock" || file.end_with?("pyproject.toml") || file.end_with?(".in") || file.end_with?(".txt")
162
162
  end
163
163
 
164
164
  requirement&.fetch(:requirement)
@@ -235,6 +235,11 @@ module Dependabot
235
235
  false
236
236
  end
237
237
 
238
+ sig { returns(T::Boolean) }
239
+ def updating_pyproject?
240
+ requirement_files.any? { |file| file.end_with?("pyproject.toml") }
241
+ end
242
+
238
243
  sig { returns(T::Boolean) }
239
244
  def updating_uv_lock?
240
245
  requirement_files.any?("uv.lock")
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.372.0
4
+ version: 0.374.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.372.0
18
+ version: 0.374.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.372.0
25
+ version: 0.374.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.372.0
32
+ version: 0.374.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.372.0
39
+ version: 0.374.0
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: debug
42
42
  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.372.0
304
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.374.0
305
305
  rdoc_options: []
306
306
  require_paths:
307
307
  - lib