dependabot-python 0.198.0 → 0.201.0

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: 941d0fac4b28e5144d4688da00937ed04fbcdfb1c113116e178a51c831b92fde
4
- data.tar.gz: 89bbc2f136b6e5170628f689e355b0aa4411f90d92c1e3a2815ed5a04687f1e9
3
+ metadata.gz: 691608193e4e83233c5e6df04c3f7c81eb67d67d1ecdd0507f6be9521d9b1075
4
+ data.tar.gz: e9e88024c6696b0d106078ac8e6766ce8f20b098d8f0545ce4bb8de94245d33a
5
5
  SHA512:
6
- metadata.gz: 9c5b8816596b35eb024f80c57bf9d96a66c59da8635835ac04d6acf6d30559be3b5c6510cb670bbe0c2196b56988ee2e1b9d1fd6a496970cc90aff1ef471555e
7
- data.tar.gz: 568c28e3ff03fb48da4ae6799200021abe050dd7d28c163833ce879da00f95a55cd813a4516b0ee4a1976d0fc156220408d2efece7771c52b177d97378512654
6
+ metadata.gz: 77457b46061285262798c842528d341b8618d4fd7dac815da3d57b1054465f7beba288516b30bad4791b87df15abc4e8dfad8560b56e15ef278c393581e9850b
7
+ data.tar.gz: b027f54369922502281ae431ebc296a01e335a5b873df88ab0494690aaa44b98c4b3d0d677ba2d1556dc9d56dd7e7e75be1a9e375a5fd8245dbb0eec748eb89b
@@ -37,7 +37,7 @@ def parse_requirements(directory):
37
37
  )
38
38
  for parsed_req in requirements:
39
39
  install_req = install_req_from_parsed_requirement(parsed_req)
40
- if install_req.original_link:
40
+ if install_req.req is None:
41
41
  continue
42
42
 
43
43
  pattern = r"-[cr] (.*) \(line \d+\)"
@@ -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.198.0
4
+ version: 0.201.0
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-15 00:00:00.000000000 Z
11
+ date: 2022-07-22 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.198.0
19
+ version: 0.201.0
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.198.0
26
+ version: 0.201.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debase
29
29
  requirement: !ruby/object:Gem::Requirement