You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug A clear and concise description of what the bug is.
When a multiple constraints dependency is specified in the pyproject.toml file, prospector fails with the following error:
File "C:\venv311\Lib\site-packages\requirements_detector\poetry_semver\__init__.py", line 23, in parse_constraint
or_constraints = re.split(r"\s*\|\|?\s*", constraints.strip())
^^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'strip'
To Reproduce Steps to reproduce the behavior:
pip install poetry and create a project
$ poetry new issue
Created package issue in issue
cd issue and update the myproject.toml to include an example package (in our case requests) with multiple constraints
Expected behavior A clear and concise description of what you expected to happen.
The prospector should finish without errors
Screenshots If applicable, add screenshots to help explain your problem.
> prospector -X .
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "c:\venv311\Scripts\prospector.exe\__main__.py", line 7, in <module>
File "c:\venv311\Lib\site-packages\prospector\run.py", line 188, in main
config = ProspectorConfig()
^^^^^^^^^^^^^^^^^^
File "c:\venv311\Lib\site-packages\prospector\config\__init__.py", line 36, in __init__
self.libraries = self._find_used_libraries(self.config, self.profile)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\venv311\Lib\site-packages\prospector\config\__init__.py", line 215, in _find_used_libraries
for found_dep in autodetect_libraries(self.workdir):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\venv311\Lib\site-packages\prospector\autodetect.py", line 89, in autodetect_libraries
libraries = find_from_requirements(path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\venv311\Lib\site-packages\prospector\autodetect.py", line 72, in find_from_requirements
reqs = find_requirements(path)
^^^^^^^^^^^^^^^^^^^^^^^
File "c:\venv311\Lib\site-packages\requirements_detector\detect.py", line 72, in find_requirements
requirements = from_pyproject_toml(poetry_toml)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\venv311\Lib\site-packages\requirements_detector\detect.py", line 127, in from_pyproject_toml
parsed_spec = str(parse_constraint(spec))
^^^^^^^^^^^^^^^^^^^^^^
File "c:\venv311\Lib\site-packages\requirements_detector\poetry_semver\__init__.py", line 23, in parse_constraint
or_constraints = re.split(r"\s*\|\|?\s*", constraints.strip())
^^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'strip'
Environment (please complete the following information):
OS: MS-windows
Tool: prospector
Prospector version 1.10.2
Python version 3.11.4
Additional context Add any other context about the problem here. Putting the list of
dependencies installed, e.g. the output of pip freeze also helps.
The problem is that requirements-detector dependency assumes that a poetry dependency constraint is either a string or a map, but not a list.
(I've just realised that this is really a requirements-detector issue, but thought to still raise it here for perspective, feel free to migrate it to that project).
Thanks
The text was updated successfully, but these errors were encountered:
Describe the bug A clear and concise description of what the bug is.
When a multiple constraints dependency is specified in the
pyproject.toml
file,prospector
fails with the following error:To Reproduce Steps to reproduce the behavior:
pip install poetry
and create a project$ poetry new issue Created package issue in issue
cd issue
and update themyproject.toml
to include an example package (in our caserequests
) with multiple constraintsprospector -X .
Expected behavior A clear and concise description of what you expected to happen.
The prospector should finish without errors
Screenshots If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
Additional context Add any other context about the problem here. Putting the list of
dependencies installed, e.g. the output of
pip freeze
also helps.The problem is that requirements-detector dependency assumes that a poetry dependency constraint is either a string or a map, but not a list.
(I've just realised that this is really a
requirements-detector
issue, but thought to still raise it here for perspective, feel free to migrate it to that project).Thanks
The text was updated successfully, but these errors were encountered: