aboutcode-org / aboutcode-org/python-inspector

Conflicts with python versions on patch level

Abierto
#103 4 comentarios 1 reacción 0 asignados Ver en GitHub
bug must have
Lenguaje dominante
Python
Estrellas
23
Forks
28
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

We have a `requirements.txt` file that cannot be analyzed by Python Inspector due to conflicting dependencies. It boils down to the following two dependencies:

```
anyio==3.6.1
dataclasses==0.8

```
When running the command `python-inspector -r requirements.txt --json-pdt - -o linux -p 36` it reports

```
raise ResolutionImpossible(e.criterion.information)
resolvelib.resolvers.ResolutionImpossible: [RequirementInformation(requirement=, parent=None)]
```

When choosing a different Python version, e.g. `37` the problem is caused by the `dataclasses` library (see full stack trace below).

From what I found out, there seem to be only specific Python versions for which this constellation can work: [dataclasses](https://pypi.org/project/dataclasses/) requires Python >=3.6, <3.7; [anyio](https://pypi.org/project/anyio/) requires Python >=3.6.2. It is, however, not possible to define the Python version for Python Inspector on that level of detail. I assume that the `36` option will select a 3.6.0 version? So, should the corresponding option be extended to support an exact version number? Or is there another way how to solve this issue?

Here is the full stack trace:
```
Traceback (most recent call last):
File "/home/heo1wa3/.local/lib/python3.8/site-packages/resolvelib/resolvers.py", line 372, in resolve
self._add_to_criteria(self.state.criteria, r, parent=None)
File "/home/heo1wa3/.local/lib/python3.8/site-packages/resolvelib/resolvers.py", line 173, in _add_to_criteria
raise RequirementsConflicted(criterion)
resolvelib.resolvers.RequirementsConflicted: Requirements conflict:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/heo1wa3/.local/lib/python3.8/site-packages/python_inspector/resolve_cli.py", line 246, in resolve_dependencies
resolution_result: Dict = resolver_api(
File "/home/heo1wa3/.local/lib/python3.8/site-packages/python_inspector/api.py", line 257, in resolve_dependencies
resolution, purls = resolve(
File "/home/heo1wa3/.local/lib/python3.8/site-packages/python_inspector/api.py", line 316, in resolve
resolved_dependencies, packages = get_resolved_dependencies(
File "/home/heo1wa3/.local/lib/python3.8/site-packages/python_inspector/api.py", line 354, in get_resolved_dependencies
resolver_results = resolver.resolve(requirements=requirements, max_rounds=max_rounds)
File "/home/heo1wa3/.local/lib/python3.8/site-packages/resolvelib/resolvers.py", line 521, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/home/heo1wa3/.local/lib/python3.8/site-packages/resolvelib/resolvers.py", line 374, in resolve
raise ResolutionImpossible(e.criterion.information)
resolvelib.resolvers.ResolutionImpossible: [RequirementInformation(requirement=, parent=None)]
```

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.