dependabot-python 0.110.1 → 0.110.2

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: 6f74aca362db29898ff19b3aaf657c152f6559261f8dff6fcb81d365a1bb97f1
4
- data.tar.gz: 32f5cea98627f6b78fd31f69b7ed39b714b952ba05f6d41af8ad47876a223d5d
3
+ metadata.gz: 9db7c02e8f8d561352ab5c4284f67c80fa61f8037502343a3ffc61c087f02f39
4
+ data.tar.gz: b3732c30ab057f3889c838c5692867f63c21f3fdd34e0cacb5b4fdb8e228dcee
5
5
  SHA512:
6
- metadata.gz: 0e6ce4a48bcb1e271fbb5d97efc359ae56725b4680d4fe50ad121a78dea7752d2d4e1fe638861e3d425a81f3f9c489f5935684d54923b33f1e42a0ba7f0e9882
7
- data.tar.gz: 14ca787fff1c3bce63368bc70682c16f66dd5d757ab88ab2f19c507ccb801b68127add77bf64e75bb7ee34a4754933045faee5448aad739bb968aeddea1efe10
6
+ metadata.gz: ef6084afd1fb2d917a16b7a57d3a8aed8d9e0edd0a4d75053db2a4940f5313f1b99e543f06e18af8ef9b42425f7683263512ac229531005bc752cb4451610b61
7
+ data.tar.gz: 2172c4efe4b167006adb7882b73ec3171f171a2535792956285846b8a42f1c4d1ef75ee767afce48bc9a9610cda0c0f4444bd6377d1d18e1e76100689abb338e
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "cgi"
4
4
  require "excon"
5
+ require "nokogiri"
5
6
 
6
7
  require "dependabot/python/update_checker"
7
8
  require "dependabot/shared_helpers"
@@ -13,9 +14,6 @@ module Dependabot
13
14
  class LatestVersionFinder
14
15
  require_relative "index_finder"
15
16
 
16
- PYTHON_REQUIREMENT_REGEX =
17
- /data-requires-python\s*=\s*["'](?<requirement>[^"']+)["']/m.freeze
18
-
19
17
  def initialize(dependency:, dependency_files:, credentials:,
20
18
  ignored_versions:, security_advisories:)
21
19
  @dependency = dependency
@@ -153,8 +151,9 @@ module Dependabot
153
151
  end
154
152
 
155
153
  def version_details_from_link(link)
156
- filename = link.match(%r{<a\s.*?>(.*?)</a>}m).captures.first
157
- return unless filename.match?(name_regex)
154
+ doc = Nokogiri::XML(link)
155
+ filename = doc.at_css("a")&.content
156
+ return unless filename&.match?(name_regex)
158
157
 
159
158
  version = get_version_from_filename(filename)
160
159
  return unless version_class.correct?(version)
@@ -173,10 +172,11 @@ module Dependabot
173
172
  end
174
173
 
175
174
  def build_python_requirement_from_link(link)
176
- req_string = link.
177
- match(PYTHON_REQUIREMENT_REGEX)&.
178
- named_captures&.
179
- fetch("requirement")
175
+ req_string = Nokogiri::XML(link).
176
+ at_css("a")&.
177
+ attribute("data-requires-python")&.
178
+ content
179
+
180
180
  return unless req_string
181
181
 
182
182
  requirement_class.new(CGI.unescapeHTML(req_string))
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.110.1
4
+ version: 0.110.2
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.110.1
19
+ version: 0.110.2
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.110.1
26
+ version: 0.110.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement