dependabot-python 0.91.4 → 0.91.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb67d611ca3732852116d6a1e72dee932d639aa549893d8626dc991bbd73c4d5
4
- data.tar.gz: f1f970c75a447a58bdb69b9e94624f2dbeae38d9dc36727f4a26d418122f4eb0
3
+ metadata.gz: 292a4a8341c97357705a20e98ba03f8f9a53b5e9419fd444fc9725a811ef63d2
4
+ data.tar.gz: c45dc4123b2fed3f799659b38dcc8901fc2ae49f315900c28f21e5a4280ee77b
5
5
  SHA512:
6
- metadata.gz: 20fd0665a928dc393e09de399ac286e00bce8bb1f4b80ea8d33c2f0167a918040e388bc25fe3cc7386181f3b4bf1cf9f4c34e958904f6b8ead479b616a9da5ed
7
- data.tar.gz: ec426c47256542e9807bdac9adf50c198af0b20c5e2e4ac1de598512fec52c81f1d3e5fd745e7b137e39962522406f98d8b41ebbee10444c52ac847464847d88
6
+ metadata.gz: 85288aac3fd40dce151d06165ea9fc88766da4d27203af0ecaeec5df0cb92a9a4a0115f005f85a95631c83a74cd782e317214287a92a7969abd16cc0c45bb0f7
7
+ data.tar.gz: 169dccb747223412017616f5e879507b108b482f63e850eb373eb2c2384719cbd26137b82fdc3569f2fef09de63c007af0e0bdd9e3b2f3b84250ac6d2667f990
@@ -10,7 +10,7 @@ require "dependabot/errors"
10
10
  module Dependabot
11
11
  module Python
12
12
  class FileFetcher < Dependabot::FileFetchers::Base
13
- CHILD_REQUIREMENT_REGEX = /^-r\s?(?<path>.*\.txt)/.freeze
13
+ CHILD_REQUIREMENT_REGEX = /^-r\s?(?<path>.*\.(?:txt|in))/.freeze
14
14
  CONSTRAINT_REGEX = /^-c\s?(?<path>\..*)/.freeze
15
15
 
16
16
  def self.required_files_in?(filenames)
@@ -51,7 +51,13 @@ module Dependabot
51
51
  fetched_files << python_version if python_version
52
52
 
53
53
  check_required_files_present
54
- fetched_files.uniq
54
+ uniq_files(fetched_files)
55
+ end
56
+
57
+ def uniq_files(fetched_files)
58
+ uniq_files = fetched_files.reject(&:support_file?).uniq
59
+ uniq_files += fetched_files.
60
+ reject { |f| uniq_files.map(&:name).include?(f.name) }
55
61
  end
56
62
 
57
63
  def pipenv_files
@@ -65,7 +71,7 @@ module Dependabot
65
71
  def requirement_files
66
72
  [
67
73
  *requirements_txt_files,
68
- *child_requirement_files,
74
+ *child_requirement_txt_files,
69
75
  *constraints_files
70
76
  ]
71
77
  end
@@ -123,7 +129,8 @@ module Dependabot
123
129
  end
124
130
 
125
131
  def requirements_in_files
126
- req_txt_and_in_files.select { |f| f.name.end_with?(".in") }
132
+ req_txt_and_in_files.select { |f| f.name.end_with?(".in") } +
133
+ child_requirement_in_files
127
134
  end
128
135
 
129
136
  def parsed_pipfile
@@ -165,11 +172,19 @@ module Dependabot
165
172
  select { |f| requirements_file?(f) }
166
173
  end
167
174
 
175
+ def child_requirement_txt_files
176
+ child_requirement_files.select { |f| f.name.end_with?(".txt") }
177
+ end
178
+
179
+ def child_requirement_in_files
180
+ child_requirement_files.select { |f| f.name.end_with?(".in") }
181
+ end
182
+
168
183
  def child_requirement_files
169
184
  @child_requirement_files ||=
170
185
  begin
171
- fetched_files = requirements_txt_files.dup
172
- requirements_txt_files.flat_map do |requirement_file|
186
+ fetched_files = req_txt_and_in_files.dup
187
+ req_txt_and_in_files.flat_map do |requirement_file|
173
188
  child_files = fetch_child_requirement_files(
174
189
  file: requirement_file,
175
190
  previously_fetched_files: fetched_files
@@ -203,7 +218,7 @@ module Dependabot
203
218
 
204
219
  def constraints_files
205
220
  all_requirement_files = requirements_txt_files +
206
- child_requirement_files
221
+ child_requirement_txt_files
207
222
 
208
223
  constraints_paths = all_requirement_files.map do |req_file|
209
224
  req_file.content.scan(CONSTRAINT_REGEX).flatten
@@ -264,7 +279,7 @@ module Dependabot
264
279
  end
265
280
 
266
281
  def requirement_txt_path_setup_file_paths
267
- (requirements_txt_files + child_requirement_files).map do |req_file|
282
+ (requirements_txt_files + child_requirement_txt_files).map do |req_file|
268
283
  uneditable_reqs =
269
284
  req_file.content.
270
285
  scan(/^['"]?(?<path>\..*?)(?=\[|#|'|"|$)/).
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.91.4
4
+ version: 0.91.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-17 00:00:00.000000000 Z
11
+ date: 2019-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dependabot-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.91.4
19
+ version: 0.91.5
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.91.4
26
+ version: 0.91.5
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement