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

Some markers are serialized into the lockfile incorrectly, resulting in crash #1728

Closed
3 tasks done
madig opened this issue Dec 13, 2019 · 3 comments
Closed
3 tasks done
Labels
kind/bug Something isn't working as expected

Comments

@madig
Copy link

madig commented Dec 13, 2019

  • 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).
  • OS version and name: Windows 10 x64 1909
  • Poetry version: 1.0.0
  • Link of a Gist with the contents of your pyproject.toml file: N/A

Issue

Package dependency markers that worked in 0.12.17 now crash 1.0.0. Reproducer:

  1. poetry new aaa
  2. cd aaa
  3. poetry add -vvv fonttools[unicode]

This culprit is the following lock entry:

[[package]]
category = "main"
description = "Unicodedata backport for python 2/3 updated to the latest unicode version."
marker = "python_version < \"3.8\" and platform_python_implementation != \"PyPy\" and ()"
name = "unicodedata2"
optional = false
python-versions = "*"
version = "12.1.0"

Note the and () in there. Original marker at https://github.com/fonttools/fonttools/blob/fd606ae813f1ed3f8ea42f487968fd036eb06d8a/setup.py#L51-L58.

Backtrace:

Using virtualenv: C:\...\AppData\Local\pypoetry\Cache\virtualenvs\aaa-zvnyiRwK-py3.7
PyPI: No release information found for fonttools-1.0, skipping
PyPI: No release information found for fonttools-2.0b1, skipping
PyPI: 89 packages found for fonttools *
Using version ^4.2.2 for fonttools

Updating dependencies
Resolving dependencies...
   1: fact: aaa is 0.1.0
   1: derived: aaa
   1: fact: aaa depends on fonttools (^4.2.2)
   1: fact: aaa depends on pytest (^5.2)
   1: fact: aaa depends on pytest (^5.2)
   1: selecting aaa (0.1.0)
   1: derived: pytest (^5.2)
   1: derived: fonttools (^4.2.2)
PyPI: 7 packages found for pytest >=5.2,<6.0
PyPI: No release information found for fonttools-1.0, skipping
PyPI: No release information found for fonttools-2.0b1, skipping
PyPI: 1 packages found for fonttools >=4.2.2,<5.0.0
   1: fact: fonttools (4.2.2) depends on unicodedata2 (>=12.1.0)
   1: selecting fonttools (4.2.2)
   1: derived: unicodedata2 (>=12.1.0)
PyPI: No release information found for unicodedata2-9.0.0.post3, skipping
PyPI: 1 packages found for unicodedata2 >=12.1.0
   1: selecting unicodedata2 (12.1.0)
   1: fact: pytest (5.3.1) depends on py (>=1.5.0)
   1: fact: pytest (5.3.1) depends on packaging (*)
   1: fact: pytest (5.3.1) depends on attrs (>=17.4.0)
   1: fact: pytest (5.3.1) depends on more-itertools (>=4.0.0)
   1: fact: pytest (5.3.1) depends on pluggy (>=0.12,<1.0)
   1: fact: pytest (5.3.1) depends on wcwidth (*)
   1: fact: pytest (5.3.1) depends on importlib-metadata (>=0.12)
   1: fact: pytest (5.3.1) depends on atomicwrites (>=1.0)
   1: fact: pytest (5.3.1) depends on colorama (*)
   1: selecting pytest (5.3.1)
   1: derived: colorama (*)
   1: derived: atomicwrites (>=1.0)
   1: derived: importlib-metadata (>=0.12)
   1: derived: wcwidth (*)
   1: derived: pluggy (>=0.12,<1.0)
   1: derived: more-itertools (>=4.0.0)
   1: derived: attrs (>=17.4.0)
   1: derived: packaging (*)
   1: derived: py (>=1.5.0)
PyPI: 41 packages found for colorama *
PyPI: 6 packages found for atomicwrites >=1.0
PyPI: 19 packages found for importlib-metadata >=0.12
PyPI: 9 packages found for wcwidth *
PyPI: 3 packages found for pluggy >=0.12,<1.0
PyPI: 13 packages found for more-itertools >=4.0.0
PyPI: 6 packages found for attrs >=17.4.0
PyPI: 25 packages found for packaging *
PyPI: No release information found for py-0.8.0-alpha2, skipping
PyPI: No release information found for py-0.9.0, skipping
PyPI: No release information found for py-1.4.32.dev1, skipping
PyPI: 7 packages found for py >=1.5.0
   1: fact: pluggy (0.13.1) depends on importlib-metadata (>=0.12)
   1: selecting pluggy (0.13.1)
   1: selecting atomicwrites (1.3.0)
   1: selecting attrs (19.3.0)
   1: selecting py (1.8.0)
   1: selecting wcwidth (0.1.7)
   1: selecting more-itertools (8.0.2)
   1: fact: importlib-metadata (1.3.0) depends on zipp (>=0.5)
   1: selecting importlib-metadata (1.3.0)
   1: derived: zipp (>=0.5)
PyPI: 4 packages found for zipp >=0.5
   1: fact: zipp (0.6.0) depends on more-itertools (*)
   1: selecting zipp (0.6.0)
   1: fact: packaging (19.2) depends on pyparsing (>=2.0.2)
   1: fact: packaging (19.2) depends on six (*)
   1: selecting packaging (19.2)
   1: derived: six (*)
   1: derived: pyparsing (>=2.0.2)
PyPI: 24 packages found for six *
PyPI: No release information found for pyparsing-1.1.2, skipping
PyPI: No release information found for pyparsing-1.2, skipping
PyPI: No release information found for pyparsing-1.3.3, skipping
PyPI: 28 packages found for pyparsing >=2.0.2
   1: selecting six (1.13.0)
   1: selecting pyparsing (2.4.5)
   1: selecting colorama (0.4.3)
   1: Version solving took 0.185 seconds.
   1: Tried 1 solutions.

Writing lock file

[InvalidRequirement]
Invalid requirement, parse error at "'and ()'"

Traceback (most recent call last):
  File "c:\...\.local\pipx\venvs\poetry\lib\site-packages\clikit\console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "c:\...\.local\pipx\venvs\poetry\lib\site-packages\clikit\api\command\command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "c:\...\.local\pipx\venvs\poetry\lib\site-packages\clikit\api\command\command.py", line 171, in _do_handle
    return getattr(handler, handler_method)(args, io, self)
  File "c:\...\.local\pipx\venvs\poetry\lib\site-packages\cleo\commands\command.py", line 92, in wrap_handle
    return self.handle()
  File "c:\...\.local\pipx\venvs\poetry\lib\site-packages\poetry\console\commands\add.py", line 149, in handle
    status = installer.run()
  File "c:\...\.local\pipx\venvs\poetry\lib\site-packages\poetry\installation\installer.py", line 74, in run
    self._do_install(local_repo)
  File "c:\...\.local\pipx\venvs\poetry\lib\site-packages\poetry\installation\installer.py", line 225, in _do_install
    ops = solver.solve(use_latest=whitelist)
  File "c:\...\.local\pipx\venvs\poetry\lib\site-packages\poetry\puzzle\solver.py", line 36, in solve
    packages, depths = self._solve(use_latest=use_latest)
  File "c:\...\.local\pipx\venvs\poetry\lib\site-packages\poetry\puzzle\solver.py", line 181, in _solve
    self._package, self._provider, locked=locked, use_latest=use_latest
  File "c:\...\.local\pipx\venvs\poetry\lib\site-packages\poetry\mixology\__init__.py", line 7, in resolve_version
    return solver.solve()
  File "c:\...\.local\pipx\venvs\poetry\lib\site-packages\poetry\mixology\version_solver.py", line 80, in solve
    next = self._choose_package_version()
  File "c:\...\.local\pipx\venvs\poetry\lib\site-packages\poetry\mixology\version_solver.py", line 398, in _choose_package_version
    self._solution.decide(version)
  File "c:\...\.local\pipx\venvs\poetry\lib\site-packages\poetry\mixology\partial_solution.py", line 87, in decide
    Assignment.decision(package, self.decision_level, len(self._assignments))
  File "c:\...\.local\pipx\venvs\poetry\lib\site-packages\poetry\mixology\assignment.py", line 35, in decision
    return cls(package.to_dependency(), True, decision_level, index)
  File "c:\...\.local\pipx\venvs\poetry\lib\site-packages\poetry\packages\package.py", line 394, in to_dependency
    return dependency_from_pep_508(name)
  File "c:\...\.local\pipx\venvs\poetry\lib\site-packages\poetry\packages\__init__.py", line 38, in dependency_from_pep_508
    req = Requirement(name)
  File "c:\...\.local\pipx\venvs\poetry\lib\site-packages\poetry\version\requirements.py", line 212, in __init__
    requirement_string[e.loc : e.loc + 8]
@madig madig added the kind/bug Something isn't working as expected label Dec 13, 2019
@Jack2104
Copy link

ooooh that's tough

@finswimmer
Copy link
Member

Seems to closed via #2361.

Feel free to leave a comment if you disagree.

fin swimmer

Copy link

github-actions bot commented Mar 3, 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 3, 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

Successfully merging a pull request may close this issue.

3 participants