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 +4 -4
- data/helpers/lib/parser.py +4 -2
- data/lib/dependabot/python/file_parser.rb +3 -3
- data/lib/dependabot/python/file_parser/setup_file_parser.rb +3 -3
- data/lib/dependabot/python/file_updater/requirement_replacer.rb +1 -1
- data/lib/dependabot/python/name_normaliser.rb +9 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31f1b15224468c2b083b003dae0beff4898adb81e7fc2794d4c6ee4c98dfaa86
|
4
|
+
data.tar.gz: 140ae5c9b14cf137667d5520a5a10ed7da3ba3d4fab95c702faa0a8bf94953ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 669e60c59d0a8dcc536d084e71cc198c75d8266026f09fa8655d384833ec36fc0ba4bb63955290ae01d9a337d4acaac28f03f8e97671074d16541f24814d657a
|
7
|
+
data.tar.gz: 4dd4962d15839c0461205cb5cc135a3a5b66ce2f3f8ea5734ebd635221a554d436569ed35bb09ea014706b5774b014e5ef4c76b2a4fa7c6a20366dcf1402c82d
|
data/helpers/lib/parser.py
CHANGED
@@ -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.
|
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.
|
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
|
-
|
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.
|
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-
|
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.
|
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.
|
26
|
+
version: 0.113.28
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: byebug
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|