dependabot-python 0.199.0 → 0.201.1

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: fa2efdb728ace10c8f93f21234b1b43cf9e911816f38027da3dbc1db112da69f
4
- data.tar.gz: 8b50a54ab4f43fc40ec8967b522505f65791c4b645ac3e3fd9d039ca26ebc7b0
3
+ metadata.gz: fe06a7e603a96cbfa88516081259862bf8cd2eaf1d03e26b01bafe57094fe2a9
4
+ data.tar.gz: 7941b264c4d82aa6ba453992f0a59336b581bdd1075a59e38ed33e3c8ad88267
5
5
  SHA512:
6
- metadata.gz: 7672806dbc6115cd90f8e831d07da9bb4c626b15abc4df427e7d318ddfa2031a36e978fad9933c5300977b762f6e508f5a7241fa077e1cfb0bbe2860f5703aea
7
- data.tar.gz: 1519ff9d9bbc684aaee4ae681598896a094206cf2700c901f2c50a2a60f9b45636c263d2b0ad999e91c41e91cb61488873e05b2efa8803d328b3f26db01fd318
6
+ metadata.gz: f7c2f3a131c9653faff986e6dfdffde317610e249b5f3e288ca78e17f7156bfca5c9a3ad446da50ad0905a4b81dc50820796bf06bee359754a2718d20a047d8a
7
+ data.tar.gz: ed834c6b86378ba62480d337b6de73f1a4bfce2b6eaab6b6923b524e9084ab5883b906e5257f939681bb1178dee54fd05611d218a2240037676cfb884df26d51
@@ -290,7 +290,10 @@ module Dependabot
290
290
  fetch_submodules: true
291
291
  ).tap { |f| f.support_file = true }
292
292
  rescue Dependabot::DependencyFileNotFound
293
- raise unless allow_pyproject
293
+ # For Poetry projects attempt to fetch a pyproject.toml at the
294
+ # given path instead of a setup.py. We do not require a
295
+ # setup.py to be present, so if none can be found, simply return
296
+ return [] unless allow_pyproject
294
297
 
295
298
  fetch_file_from_host(
296
299
  path.gsub("setup.py", "pyproject.toml"),
@@ -5,7 +5,7 @@ require "uri"
5
5
 
6
6
  require "dependabot/metadata_finders"
7
7
  require "dependabot/metadata_finders/base"
8
- require "dependabot/shared_helpers"
8
+ require "dependabot/registry_client"
9
9
  require "dependabot/python/authed_url_builder"
10
10
  require "dependabot/python/name_normaliser"
11
11
 
@@ -65,11 +65,7 @@ module Dependabot
65
65
  @source_from_description ||=
66
66
  potential_source_urls.find do |url|
67
67
  full_url = Source.from_url(url).url
68
- response = Excon.get(
69
- full_url,
70
- idempotent: true,
71
- **SharedHelpers.excon_defaults
72
- )
68
+ response = Dependabot::RegistryClient.get(url: full_url)
73
69
  next unless response.status == 200
74
70
 
75
71
  response.body.include?(normalised_dependency_name)
@@ -94,11 +90,7 @@ module Dependabot
94
90
  @source_from_homepage ||=
95
91
  potential_source_urls.find do |url|
96
92
  full_url = Source.from_url(url).url
97
- response = Excon.get(
98
- full_url,
99
- idempotent: true,
100
- **SharedHelpers.excon_defaults
101
- )
93
+ response = Dependabot::RegistryClient.get(url: full_url)
102
94
  next unless response.status == 200
103
95
 
104
96
  response.body.include?(normalised_dependency_name)
@@ -116,11 +108,7 @@ module Dependabot
116
108
 
117
109
  @homepage_response ||=
118
110
  begin
119
- Excon.get(
120
- homepage_url,
121
- idempotent: true,
122
- **SharedHelpers.excon_defaults
123
- )
111
+ Dependabot::RegistryClient.get(url: homepage_url)
124
112
  rescue Excon::Error::Timeout, Excon::Error::Socket,
125
113
  Excon::Error::TooManyRedirects, ArgumentError
126
114
  nil
@@ -153,15 +141,15 @@ module Dependabot
153
141
  Regexp.last_match.captures[1].include?("@")
154
142
  protocol, user, pass, url = Regexp.last_match.captures
155
143
 
156
- Excon.get(
157
- "#{protocol}://#{url}",
158
- user: user,
159
- password: pass,
160
- idempotent: true,
161
- **SharedHelpers.excon_defaults
144
+ Dependabot::RegistryClient.get(
145
+ url: "#{protocol}://#{url}",
146
+ options: {
147
+ user: user,
148
+ password: pass
149
+ }
162
150
  )
163
151
  else
164
- Excon.get(url, idempotent: true, **SharedHelpers.excon_defaults)
152
+ Dependabot::RegistryClient.get(url: url)
165
153
  end
166
154
  end
167
155
 
@@ -7,7 +7,7 @@ require "nokogiri"
7
7
  require "dependabot/dependency"
8
8
  require "dependabot/python/update_checker"
9
9
  require "dependabot/update_checkers/version_filters"
10
- require "dependabot/shared_helpers"
10
+ require "dependabot/registry_client"
11
11
  require "dependabot/python/authed_url_builder"
12
12
  require "dependabot/python/name_normaliser"
13
13
 
@@ -214,18 +214,16 @@ module Dependabot
214
214
  end
215
215
 
216
216
  def registry_response_for_dependency(index_url)
217
- Excon.get(
218
- index_url + normalised_name + "/",
219
- idempotent: true,
220
- **SharedHelpers.excon_defaults(headers: { "Accept" => "text/html" })
217
+ Dependabot::RegistryClient.get(
218
+ url: index_url + normalised_name + "/",
219
+ headers: { "Accept" => "text/html" }
221
220
  )
222
221
  end
223
222
 
224
223
  def registry_index_response(index_url)
225
- Excon.get(
226
- index_url,
227
- idempotent: true,
228
- **SharedHelpers.excon_defaults(headers: { "Accept" => "text/html" })
224
+ Dependabot::RegistryClient.get(
225
+ url: index_url,
226
+ headers: { "Accept" => "text/html" }
229
227
  )
230
228
  end
231
229
 
@@ -6,7 +6,7 @@ require "toml-rb"
6
6
  require "dependabot/dependency"
7
7
  require "dependabot/update_checkers"
8
8
  require "dependabot/update_checkers/base"
9
- require "dependabot/shared_helpers"
9
+ require "dependabot/registry_client"
10
10
  require "dependabot/errors"
11
11
  require "dependabot/python/requirement"
12
12
  require "dependabot/python/requirement_parser"
@@ -274,10 +274,8 @@ module Dependabot
274
274
  details = TomlRB.parse(pyproject.content).dig("tool", "poetry")
275
275
  return false unless details
276
276
 
277
- index_response = Excon.get(
278
- "https://pypi.org/pypi/#{normalised_name(details['name'])}/json/",
279
- idempotent: true,
280
- **SharedHelpers.excon_defaults
277
+ index_response = Dependabot::RegistryClient.get(
278
+ url: "https://pypi.org/pypi/#{normalised_name(details['name'])}/json/"
281
279
  )
282
280
 
283
281
  return false unless index_response.status == 200
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-python
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.199.0
4
+ version: 0.201.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-19 00:00:00.000000000 Z
11
+ date: 2022-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dependabot-common
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.199.0
19
+ version: 0.201.1
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.199.0
26
+ version: 0.201.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debase
29
29
  requirement: !ruby/object:Gem::Requirement