Poetry yields the following error on request to upgrade mypy:
<your-project> depends on both mypy (^0.812) and mypy (^0.761), version solving failed
mypy v0.761 considers type specification with bracket arguments (e.g., Callable[[],Any]
) to be a syntax error.
This is problematic.
How does one force poetry to use the latest version of a package, or remove poetry's belief that the old version of a package is necessary? (by comparison, pip installs the latest version)
I also ran into this strange issue in a Poetry project.
What ended up resolving it for me:
poetry.lock
fileblack
and mypy
from my pyproject.toml
poetry update
poetry add mypy
poetry add black
Now it's successfully running the latest versions of mypy and black that were "incompatible" before.