dependabot-python 0.107.44 → 0.107.45

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9311029b8906b5ab2a35456e8e6541d90830a8f333b560d4aefabe700775effe
4
- data.tar.gz: 1394673ed94221a9c402986da6bf977b23b67fb64080360ceff38d6d230609f8
3
+ metadata.gz: 6374dc5aec985c18310a4c3cbbe12b9d3a829a8a81b5315019e3d5e1cf989bd4
4
+ data.tar.gz: 8e93a3bf1bc85a936a76bca68685aaa3a09e8eeb5169b6f94cc4ee7a844019b7
5
5
  SHA512:
6
- metadata.gz: f2b3d0e9f30bc8f77913588ef83651e7d558bf32dd035550995e540082e5a8c1ecf5d73ddbfec1111390916ce6ab93a8c99e7000d924453c0ee5d029f83cf3f8
7
- data.tar.gz: ef83412fc21e9953f38352487ab3dc12d8619f8e1069b5af08e756bfdfaf7a8d3761394ac8ff405005703ef7d025438fe54981077c6716cc98f64ec499b3aed2
6
+ metadata.gz: 99c42ab69f01eef089c1966df4941363288929459ceef5d00b321ba258a66f5e4258265f579673dca774bfaa8ad3084639f90ddd189e9743cef396bc169c452b
7
+ data.tar.gz: 9f4639d8dd902c9df3aff4380d151ef553c1f7b8980e40f6b427578403d1db88b3abe1b784021f932ad9706bb667f88d9534284e0d5fd7de4ebc32316f12717d
@@ -5,6 +5,7 @@ require "toml-rb"
5
5
  require "dependabot/python/file_parser"
6
6
  require "dependabot/python/file_updater"
7
7
  require "dependabot/python/authed_url_builder"
8
+ require "securerandom"
8
9
 
9
10
  module Dependabot
10
11
  module Python
@@ -97,7 +98,13 @@ module Dependabot
97
98
  @config_variable_sources ||=
98
99
  credentials.
99
100
  select { |cred| cred["type"] == "python_index" }.
100
- map { |c| { "url" => AuthedUrlBuilder.authed_url(credential: c) } }
101
+ map do |c|
102
+ {
103
+ "url" => AuthedUrlBuilder.authed_url(credential: c),
104
+ "name" => SecureRandom.hex[0..3],
105
+ "default" => c["replaces-base"]
106
+ }.compact
107
+ end
101
108
  end
102
109
 
103
110
  def parsed_lockfile
@@ -14,6 +14,7 @@ require "dependabot/python/native_helpers"
14
14
  require "dependabot/python/python_versions"
15
15
  require "dependabot/python/authed_url_builder"
16
16
 
17
+ # rubocop:disable Metrics/ClassLength
17
18
  module Dependabot
18
19
  module Python
19
20
  class UpdateChecker
@@ -239,6 +240,7 @@ module Dependabot
239
240
 
240
241
  def updated_pyproject_content(updated_requirement:)
241
242
  content = pyproject.content
243
+ content = add_private_sources(content)
242
244
  content = sanitize_pyproject_content(content)
243
245
  content = freeze_other_dependencies(content)
244
246
  content = set_target_dependency_req(content, updated_requirement)
@@ -247,6 +249,7 @@ module Dependabot
247
249
 
248
250
  def sanitized_pyproject_content
249
251
  content = pyproject.content
252
+ content = add_private_sources(content)
250
253
  content = sanitize_pyproject_content(content)
251
254
  content
252
255
  end
@@ -257,6 +260,12 @@ module Dependabot
257
260
  sanitize
258
261
  end
259
262
 
263
+ def add_private_sources(pyproject_content)
264
+ Python::FileUpdater::PyprojectPreparer.
265
+ new(pyproject_content: pyproject_content).
266
+ replace_sources(credentials)
267
+ end
268
+
260
269
  def freeze_other_dependencies(pyproject_content)
261
270
  Python::FileUpdater::PyprojectPreparer.
262
271
  new(pyproject_content: pyproject_content, lockfile: lockfile).
@@ -351,3 +360,4 @@ module Dependabot
351
360
  end
352
361
  end
353
362
  end
363
+ # rubocop:enable Metrics/ClassLength
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.107.44
4
+ version: 0.107.45
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.107.44
19
+ version: 0.107.45
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.107.44
26
+ version: 0.107.45
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement