dependabot-python 0.285.0 → 0.286.0

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: 01ee39fc41a1327118b2d9c671ec43d9e815357bf55d90b8eef20c841749ba83
4
- data.tar.gz: a752fc6bd758ac8d6637c3551199a59388c1ff185765728ce48220a3d3ca7dcc
3
+ metadata.gz: f0d961c2987fb16abd338a95638bd303b77320c4a99f41c7a39a5206e2a1e65d
4
+ data.tar.gz: d30ff4cd1e220c94ff705610612136b6625bee55d97ace1c0b7a2a0a7dd4320b
5
5
  SHA512:
6
- metadata.gz: 9efcad646528d23a6748191644b4b77fcaa14c6ef543be5981406fd0ac4efd28d6306423bd1e6bd44add27f54b6a9c3cd4ebc11b0dcd2ffd6ed9951b19f31990
7
- data.tar.gz: bb70f5ea2b15e2b71db1c83629aa3384a2fa58f11a1ea3f47650409304337841b9a99583d5cf0664d0face9b4af353faab56d63be2a2fb310ac014b77271154c
6
+ metadata.gz: 124e2e4f9959c406f1eabb31c42fa921ace79bdd8d299454081773d05a786e3837137ae94876593b7759b5a52d745ad96206adfeba663cb7024e9dded4a82f6a
7
+ data.tar.gz: 6517f85bfd0210426d366929c890ee7c966aa3f3f54c3f32319e6081a85bc76fa5067622ab38029550617242a5323e6771c66d624d69ef0164bca3d87ad21d89
@@ -24,7 +24,7 @@ COMMENT_RE = re.compile(r'(^|\s+)#.*$')
24
24
 
25
25
 
26
26
  def parse_pep621_dependencies(pyproject_path):
27
- project_toml = toml.load(pyproject_path)['project']
27
+ project_toml = toml.load(pyproject_path)
28
28
 
29
29
  def parse_toml_section_pep621_dependencies(pyproject_path, dependencies):
30
30
  requirement_packages = []
@@ -54,26 +54,36 @@ def parse_pep621_dependencies(pyproject_path):
54
54
 
55
55
  dependencies = []
56
56
 
57
- if 'dependencies' in project_toml:
58
- dependencies_toml = project_toml['dependencies']
57
+ if 'project' in project_toml:
58
+ project_section = project_toml['project']
59
59
 
60
- runtime_dependencies = parse_toml_section_pep621_dependencies(
61
- pyproject_path,
62
- dependencies_toml
63
- )
64
-
65
- dependencies.extend(runtime_dependencies)
66
-
67
- if 'optional-dependencies' in project_toml:
68
- optional_dependencies_toml = project_toml['optional-dependencies']
69
-
70
- for group in optional_dependencies_toml:
71
- group_dependencies = parse_toml_section_pep621_dependencies(
60
+ if 'dependencies' in project_section:
61
+ dependencies_toml = project_section['dependencies']
62
+ runtime_dependencies = parse_toml_section_pep621_dependencies(
72
63
  pyproject_path,
73
- optional_dependencies_toml[group]
64
+ dependencies_toml
74
65
  )
66
+ dependencies.extend(runtime_dependencies)
67
+
68
+ if 'optional-dependencies' in project_section:
69
+ optional_dependencies_toml = project_section[
70
+ 'optional-dependencies'
71
+ ]
72
+ for group in optional_dependencies_toml:
73
+ group_dependencies = parse_toml_section_pep621_dependencies(
74
+ pyproject_path,
75
+ optional_dependencies_toml[group]
76
+ )
77
+ dependencies.extend(group_dependencies)
75
78
 
76
- dependencies.extend(group_dependencies)
79
+ if 'build-system' in project_toml:
80
+ build_system_section = project_toml['build-system']
81
+ if 'requires' in build_system_section:
82
+ build_system_dependencies = parse_toml_section_pep621_dependencies(
83
+ pyproject_path,
84
+ build_system_section['requires']
85
+ )
86
+ dependencies.extend(build_system_dependencies)
77
87
 
78
88
  return json.dumps({"result": dependencies})
79
89
 
@@ -167,7 +167,8 @@ module Dependabot
167
167
 
168
168
  def using_pep621?
169
169
  !parsed_pyproject.dig("project", "dependencies").nil? ||
170
- !parsed_pyproject.dig("project", "optional-dependencies").nil?
170
+ !parsed_pyproject.dig("project", "optional-dependencies").nil? ||
171
+ !parsed_pyproject.dig("build-system", "requires").nil?
171
172
  end
172
173
 
173
174
  def poetry_root
@@ -325,7 +325,7 @@ module Dependabot
325
325
  end
326
326
 
327
327
  def library_details
328
- @library_details ||= poetry_details || standard_details
328
+ @library_details ||= poetry_details || standard_details || build_system_details
329
329
  end
330
330
 
331
331
  def poetry_details
@@ -336,6 +336,10 @@ module Dependabot
336
336
  @standard_details ||= toml_content["project"]
337
337
  end
338
338
 
339
+ def build_system_details
340
+ @build_system_details ||= toml_content["build-system"]
341
+ end
342
+
339
343
  def toml_content
340
344
  @toml_content ||= TomlRB.parse(pyproject.content)
341
345
  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.285.0
4
+ version: 0.286.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-07 00:00:00.000000000 Z
11
+ date: 2024-11-14 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.285.0
19
+ version: 0.286.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.285.0
26
+ version: 0.286.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -288,7 +288,7 @@ licenses:
288
288
  - MIT
289
289
  metadata:
290
290
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
291
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.285.0
291
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.286.0
292
292
  post_install_message:
293
293
  rdoc_options: []
294
294
  require_paths: