dependabot-python 0.98.40 → 0.98.41

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: f2149254c88cad4a314ed5079edc0f4404f277b805b96655bd84318f489d26c6
4
- data.tar.gz: 8a6f319934bf0838fe1cf07118080f784c39e7e0895ed1a79144baef3b8775d7
3
+ metadata.gz: a117326ce7c8572e24c1d937ee3e3317731c3e67755bf3bdfab75d780ec5821d
4
+ data.tar.gz: 4aee70dd22b844a03ea1416b2e2ef3a17dad95b1810ff692321eb2c26524758a
5
5
  SHA512:
6
- metadata.gz: 22949505d1565c1369b42f2b157631483171ee87f9b8a03459a04b1b98e9b4ebc299612b00010fcd94f6fba24f2b51419fa1b572edd7a2cdf0f5ef02748d3af1
7
- data.tar.gz: 2e27c9d438ab873b0ec6541af22a5f94bf4368adcbc90beb42b82079c420b7a77df084b9345ffa0d3ed0b49a6f12d70de71c965efc912e127829aa5bf2170090
6
+ metadata.gz: 6beeb80824ae7e04998cbb807c52a4d453002c280b5dff46fe717353cef5f28334240d1b68928bffc37ff776cba2842f12a953449c131c9f50add2e0ba0172fa
7
+ data.tar.gz: fa22c6c85a1b7747af7416e64255b184d330ac1cba857f0986f96397ff701a23ceca92c71e96cb7d0eba1cc929d3de975db9e25dc6813476fcd9a455b6f3e6a9
@@ -212,14 +212,36 @@ module Dependabot
212
212
 
213
213
  def clean_check_and_remove_environment_variables(url)
214
214
  url = url.strip.gsub(%r{/*$}, "") + "/"
215
- url = url.gsub(%r{#{ENVIRONMENT_VARIABLE_REGEX}/?}, "")
216
- authed_base_url(url)
215
+
216
+ unless url.match?(ENVIRONMENT_VARIABLE_REGEX)
217
+ return authed_base_url(url)
218
+ end
219
+
220
+ config_variable_urls =
221
+ [
222
+ config_variable_index_urls[:main],
223
+ *config_variable_index_urls[:extra]
224
+ ].
225
+ compact.
226
+ map { |u| u.strip.gsub(%r{/*$}, "") + "/" }
227
+
228
+ regexp = url.split(ENVIRONMENT_VARIABLE_REGEX).
229
+ map { |part| Regexp.quote(part) }.
230
+ join(".+")
231
+ authed_url = config_variable_urls.find { |u| u.match?(regexp) }
232
+ return authed_url if authed_url
233
+
234
+ cleaned_url = url.gsub(%r{#{ENVIRONMENT_VARIABLE_REGEX}/?}, "")
235
+ authed_url = authed_base_url(cleaned_url)
236
+ return authed_url unless authed_url == cleaned_url
237
+
238
+ raise PrivateSourceAuthenticationFailure, url
217
239
  end
218
240
 
219
241
  def authed_base_url(base_url)
220
242
  cred = credentials.
221
- select { |c| c["type"] == "python_index" }.
222
- find { |c| c.fetch("index-url").include?(base_url) }
243
+ select { |c| c["type"] == "python_index" }.
244
+ find { |c| c.fetch("index-url").include?(base_url) }
223
245
  return base_url unless cred
224
246
 
225
247
  AuthedUrlBuilder.authed_url(credential: cred)
@@ -94,7 +94,8 @@ module Dependabot
94
94
  end
95
95
 
96
96
  def handle_poetry_errors(error)
97
- raise unless error.message.include?("SolverProblemError")
97
+ raise unless error.message.include?("SolverProblemError") ||
98
+ error.message.include?("PackageNotFound")
98
99
 
99
100
  check_original_requirements_resolvable
100
101
 
@@ -117,7 +118,8 @@ module Dependabot
117
118
 
118
119
  true
119
120
  rescue SharedHelpers::HelperSubprocessFailed => error
120
- raise unless error.message.include?("SolverProblemError")
121
+ raise unless error.message.include?("SolverProblemError") ||
122
+ error.message.include?("PackageNotFound")
121
123
 
122
124
  msg = clean_error_message(error.message)
123
125
  raise DependencyFileNotResolvable, msg
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.98.40
4
+ version: 0.98.41
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.98.40
19
+ version: 0.98.41
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.98.40
26
+ version: 0.98.41
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement