Skip to content

Commit 0501a0b

Browse files
committed
pip: Add support for poetry managed pyproject
1 parent 5f56825 commit 0501a0b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pip/flatpak-pip-generator

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,12 @@ elif opts.pyproject_file:
199199
pyproject_file = os.path.expanduser(opts.pyproject_file)
200200
with open(pyproject_file, "rb") as f:
201201
pyproject_data = toml_load(f)
202-
dependencies = pyproject_data.get("project", {}).get("dependencies", [])
202+
is_poetry = pyproject_data.get('tool', {}).get('poetry') is not None
203+
if is_poetry:
204+
dependencies = pyproject_data.get('tool', {}).get('poetry', {}).get('dependencies', {})
205+
dependencies.pop('python', None)
206+
else:
207+
dependencies = pyproject_data.get("project", {}).get("dependencies", [])
203208
packages = list(requirements.parse('\n'.join(dependencies)))
204209
with tempfile.NamedTemporaryFile('w', delete=False, prefix='requirements.') as req_file:
205210
req_file.write('\n'.join(dependencies))

0 commit comments

Comments
 (0)