dependabot-python 0.113.27 → 0.113.28

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: 88003eb9888610599fd8ca91af6e563a3cba580eae1c30f206612b955798c60a
4
- data.tar.gz: 0f43f3e67692cfecd7b22d4ab8eaee870275e173b1966088b2556031bda74265
3
+ metadata.gz: 31f1b15224468c2b083b003dae0beff4898adb81e7fc2794d4c6ee4c98dfaa86
4
+ data.tar.gz: 140ae5c9b14cf137667d5520a5a10ed7da3ba3d4fab95c702faa0a8bf94953ac
5
5
  SHA512:
6
- metadata.gz: '09c2048e951bbf33e11903544602b0f0f6329a3eb85383b41e718028ffa688c4a5259e5e3a2102a70842b228029cc0a5888e840947d25706ba26a42c1a63b769'
7
- data.tar.gz: 9d205befe8f551fdc5b5b056a170b3263c78044426626da8cc081fd0e226dc4a7041ab6b54d930e75a76c4b8e8ae9c15665a1b0727bc2816dfb76b033f9304b2
6
+ metadata.gz: 669e60c59d0a8dcc536d084e71cc198c75d8266026f09fa8655d384833ec36fc0ba4bb63955290ae01d9a337d4acaac28f03f8e97671074d16541f24814d657a
7
+ data.tar.gz: 4dd4962d15839c0461205cb5cc135a3a5b66ce2f3f8ea5734ebd635221a554d436569ed35bb09ea014706b5774b014e5ef4c76b2a4fa7c6a20366dcf1402c82d
@@ -58,7 +58,8 @@ def parse_requirements(directory):
58
58
  "version": version_from_install_req(install_req),
59
59
  "markers": str(install_req.markers) or None,
60
60
  "file": rel_path,
61
- "requirement": str(install_req.specifier) or None
61
+ "requirement": str(install_req.specifier) or None,
62
+ "extras": sorted(list(install_req.extras))
62
63
  })
63
64
  except Exception as e:
64
65
  print(json.dumps({ "error": repr(e) }))
@@ -85,7 +86,8 @@ def parse_setup(directory):
85
86
  "markers": str(install_req.markers) or None,
86
87
  "file": "setup.py",
87
88
  "requirement": str(install_req.specifier) or None,
88
- "requirement_type": req_type
89
+ "requirement_type": req_type,
90
+ "extras": sorted(list(install_req.extras))
89
91
  })
90
92
 
91
93
  def setup(*args, **kwargs):
@@ -92,7 +92,7 @@ module Dependabot
92
92
 
93
93
  dependencies <<
94
94
  Dependency.new(
95
- name: normalised_name(dep["name"]),
95
+ name: normalised_name(dep["name"], dep["extras"]),
96
96
  version: dep["version"]&.include?("*") ? nil : dep["version"],
97
97
  requirements: requirements,
98
98
  package_manager: "pip"
@@ -192,8 +192,8 @@ module Dependabot
192
192
  join
193
193
  end
194
194
 
195
- def normalised_name(name)
196
- NameNormaliser.normalise(name)
195
+ def normalised_name(name, extras = [])
196
+ NameNormaliser.normalise_including_extras(name, extras)
197
197
  end
198
198
 
199
199
  def check_required_files
@@ -37,7 +37,7 @@ module Dependabot
37
37
 
38
38
  dependencies <<
39
39
  Dependency.new(
40
- name: normalised_name(dep["name"]),
40
+ name: normalised_name(dep["name"], dep["extras"]),
41
41
  version: dep["version"]&.include?("*") ? nil : dep["version"],
42
42
  requirements: [{
43
43
  requirement: dep["requirement"],
@@ -164,8 +164,8 @@ module Dependabot
164
164
  0
165
165
  end
166
166
 
167
- def normalised_name(name)
168
- NameNormaliser.normalise(name)
167
+ def normalised_name(name, extras)
168
+ NameNormaliser.normalise_including_extras(name, extras)
169
169
  end
170
170
 
171
171
  def setup_file
@@ -14,7 +14,7 @@ module Dependabot
14
14
  def initialize(content:, dependency_name:, old_requirement:,
15
15
  new_requirement:, new_hash_version: nil)
16
16
  @content = content
17
- @dependency_name = dependency_name
17
+ @dependency_name = normalise(dependency_name)
18
18
  @old_requirement = old_requirement
19
19
  @new_requirement = new_requirement
20
20
  @new_hash_version = new_hash_version
@@ -4,7 +4,15 @@ module Dependabot
4
4
  module Python
5
5
  module NameNormaliser
6
6
  def self.normalise(name)
7
- name.downcase.gsub(/[-_.]+/, "-")
7
+ extras_regex = /\[.+\]/
8
+ name.downcase.gsub(/[-_.]+/, "-").gsub(extras_regex, "")
9
+ end
10
+
11
+ def self.normalise_including_extras(name, extras)
12
+ normalised_name = normalise(name)
13
+ return normalised_name if extras.empty?
14
+
15
+ normalised_name + "[" + extras.join(",") + "]"
8
16
  end
9
17
  end
10
18
  end
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.113.27
4
+ version: 0.113.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-09 00:00:00.000000000 Z
11
+ date: 2019-12-12 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.113.27
19
+ version: 0.113.28
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.113.27
26
+ version: 0.113.28
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement