Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VersionUnions do not work inside of multiple constraint dependencies #2340

Closed
3 tasks done
tarkatronic opened this issue Apr 23, 2020 · 3 comments
Closed
3 tasks done
Labels
kind/bug Something isn't working as expected

Comments

@tarkatronic
Copy link
Contributor

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

Issue

In creating a plugin for Django, I need to support a full compatibility matrix of Python versions and Django versions. This is due to the fact that Django maintains multiple release branches simultaneously. In addition to supporting this full matrix, I would also like to be able to pin versions on each individual release branch above certain versions in order to enforce the latest security fixes. This lead me to this wonderfully complex version matrix:

Django = [
    {version = "~1.8.19 || ~1.11.29", python = "~2.7"},
    {version = "~1.8.19 || ~1.11.29 || ~2.0.11 || ~2.1.15 || ~2.2.11", python = "~3.5"},
    {version = "~1.11.29 || ~2.0.11 || ~2.1.15 || ~2.2.11 || ~3.0.4", python = "~3.6"},
    {version = "~1.11.29 || ~2.0.11 || ~2.1.15 || ~2.2.11 || ~3.0.4", python = "~3.7"},
    {version = "~2.2.11 || ~3.0.4", python = "~3.8"}
]

Unfortunately, this is not currently support. When trying to install, I see the following:

[jwilhelm@localhost django-ssl-auth]$ poetry install -vvv
Creating virtualenv django-ssl-auth-qQKl64d5-py3.7 in /home/jwilhelm/.cache/pypoetry/virtualenvs
Using virtualenv: /home/jwilhelm/.cache/pypoetry/virtualenvs/django-ssl-auth-qQKl64d5-py3.7
Updating dependencies
Resolving dependencies...
   1: fact: django-ssl-auth is 2.2.0
   1: derived: django-ssl-auth
   0: Duplicate dependencies for django
   1: Version solving took 0.002 seconds.
   1: Tried 1 solutions.

[TypeError]
unhashable type: 'VersionUnion'

Traceback (most recent call last):
  File "/home/jwilhelm/.poetry/lib/poetry/_vendor/py3.7/clikit/console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "/home/jwilhelm/.poetry/lib/poetry/_vendor/py3.7/clikit/api/command/command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "/home/jwilhelm/.poetry/lib/poetry/_vendor/py3.7/clikit/api/command/command.py", line 171, in _do_handle
    return getattr(handler, handler_method)(args, io, self)
  File "/home/jwilhelm/.poetry/lib/poetry/_vendor/py3.7/cleo/commands/command.py", line 92, in wrap_handle
    return self.handle()
  File "/home/jwilhelm/.poetry/lib/poetry/console/commands/install.py", line 63, in handle
    return_code = installer.run()
  File "/home/jwilhelm/.poetry/lib/poetry/installation/installer.py", line 74, in run
    self._do_install(local_repo)
  File "/home/jwilhelm/.poetry/lib/poetry/installation/installer.py", line 161, in _do_install
    ops = solver.solve(use_latest=self._whitelist)
  File "/home/jwilhelm/.poetry/lib/poetry/puzzle/solver.py", line 36, in solve
    packages, depths = self._solve(use_latest=use_latest)
  File "/home/jwilhelm/.poetry/lib/poetry/puzzle/solver.py", line 181, in _solve
    self._package, self._provider, locked=locked, use_latest=use_latest
  File "/home/jwilhelm/.poetry/lib/poetry/mixology/__init__.py", line 7, in resolve_version
    return solver.solve()
  File "/home/jwilhelm/.poetry/lib/poetry/mixology/version_solver.py", line 80, in solve
    next = self._choose_package_version()
  File "/home/jwilhelm/.poetry/lib/poetry/mixology/version_solver.py", line 378, in _choose_package_version
    version = self._provider.complete_package(version)
  File "/home/jwilhelm/.poetry/lib/poetry/puzzle/provider.py", line 599, in complete_package
    if dep.constraint not in by_constraint:

This is also somewhat tangentially related to #1745, as I will need to use this same compatibility matrix functionality for testing purposes.

@tarkatronic tarkatronic added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Apr 23, 2020
@kasteph kasteph removed the status/triage This issue needs to be triaged label Apr 26, 2020
@technomunk
Copy link

Upgrading from poetry 1.0.10 to 1.1.8 solved similar issue for me.

@dimbleby
Copy link
Contributor

Long since fixed, should be closed

@Secrus Secrus closed this as completed Jul 31, 2022
Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

5 participants