Open fofoni opened 1 year ago
Interesting, didn't know that it was possible to do that with setuptools
. This is possibly something we could implement.
Unfortunately, until this is implemented, there is no escape hatch to force deptry
to use requirements.txt
, even when using --requirements-txt requirements.txt
, since it will still use PEP 621 metadata from pyproject.toml
if a project
key is found (see here and here). It might also be something we want to improve in the future.
Same issue here: pyproject.toml
without project.dependencies
key and with a requirements.txt
leads to the stack trace posted above by @fofoni.
I'd say this still fits the use case stated as supported ("Projects that use a requirements.txt file according to the pip standards").
Hello, I am interested in working on this issue. Since I am new to project, I will appreciate if I can get a bit more guidance on what changes are supposed to be made and what is the expected behaviour?
Describe the bug
I usually have the following structure in my projects:
And then the projects requirements are listed in the
requirements.txt
file. This is useful because IDEs will usually syntax-highlight PEP 440 syntax in requirements files, but not in strings inside TOML tables.When I run
deptry .
with such a project, it crashes with the following traceback:To Reproduce
Using a pyproject.toml file as described above (with no
dependencies
key inside the top-levelproject
table, but mentioning"dependencies"
as adynamic
metadata), inside a Python 3.10 virtual environment, run:Expected behavior
Either:
tool.setuptools.dynamic.dependencies.file
idiom (see https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#dynamic-metadata); orSystem: