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

I'm not really sure of what I fixed #1700

Closed
wants to merge 1 commit into from
Closed

I'm not really sure of what I fixed #1700

wants to merge 1 commit into from

Conversation

Steffo99
Copy link

Hi!

So... While running poetry update on this pyproject.toml file, I got an error:

[...]
Writing lock file

[InvalidRequirement]
Invalid requirement, parse error at "';  or'"

Traceback (most recent call last):
  File "/home/steffo/.poetry/lib/poetry/_vendor/py3.8/clikit/console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "/home/steffo/.poetry/lib/poetry/_vendor/py3.8/clikit/api/command/command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "/home/steffo/.poetry/lib/poetry/_vendor/py3.8/clikit/api/command/command.py", line 171, in _do_handle
    return getattr(handler, handler_method)(args, io, self)
  File "/home/steffo/.poetry/lib/poetry/_vendor/py3.8/cleo/commands/command.py", line 92, in wrap_handle
    return self.handle()
  File "/home/steffo/.poetry/lib/poetry/console/commands/update.py", line 49, in handle
    return installer.run()
  File "/home/steffo/.poetry/lib/poetry/installation/installer.py", line 74, in run
    self._do_install(local_repo)
  File "/home/steffo/.poetry/lib/poetry/installation/installer.py", line 225, in _do_install
    ops = solver.solve(use_latest=whitelist)
  File "/home/steffo/.poetry/lib/poetry/puzzle/solver.py", line 36, in solve
    packages, depths = self._solve(use_latest=use_latest)
  File "/home/steffo/.poetry/lib/poetry/puzzle/solver.py", line 180, in _solve
    result = resolve_version(
  File "/home/steffo/.poetry/lib/poetry/mixology/__init__.py", line 7, in resolve_version
    return solver.solve()
  File "/home/steffo/.poetry/lib/poetry/mixology/version_solver.py", line 80, in solve
    next = self._choose_package_version()
  File "/home/steffo/.poetry/lib/poetry/mixology/version_solver.py", line 398, in _choose_package_version
    self._solution.decide(version)
  File "/home/steffo/.poetry/lib/poetry/mixology/partial_solution.py", line 87, in decide
    Assignment.decision(package, self.decision_level, len(self._assignments))
  File "/home/steffo/.poetry/lib/poetry/mixology/assignment.py", line 35, in decision
    return cls(package.to_dependency(), True, decision_level, index)
  File "/home/steffo/.poetry/lib/poetry/packages/package.py", line 394, in to_dependency
    return dependency_from_pep_508(name)
  File "/home/steffo/.poetry/lib/poetry/packages/__init__.py", line 38, in dependency_from_pep_508
    req = Requirement(name)
  File "/home/steffo/.poetry/lib/poetry/version/requirements.py", line 210, in __init__
    raise InvalidRequirement(

After trying multiple things, like updating to the latest preview version and using Poetry directly from the git repository, I decided to try to debug Poetry itself to see what was causing the error.

After snooping a bit around, I found that there was a MarkerUnion object that was returning False on the .is_any() method call, even if both the Markers inside the Union returned True on the .is_any() calls; I changed it to return True if all the Markers contained in the MarkerUnion are any.

This seems to have solved by problem, but I still have no idea of what the problem actually was or of what a Marker is.

If this is actually the correct fix, there may be more Markers in the poetry/version/markers.py file that need to be fixed, as I only had time to solve this specific bug.

@jrabbit
Copy link

jrabbit commented Dec 10, 2019

Is there longer debug output? Seems like the issue would be the package markers on your dependencies, not your specific pyproject.toml file.

@Steffo99
Copy link
Author

This is the full logging output of the unpatched version (on a different machine).

(royalpack-pI-Z6fIl-py3.8) D:\Codice\royalpack>poetry update -vvv
Using virtualenv: C:\Users\stepi\AppData\Local\pypoetry\Cache\virtualenvs\royalpack-pI-Z6fIl-py3.8
Updating dependencies
Resolving dependencies...
   1: fact: royalpack is 5.1.6
   1: derived: royalpack
   1: fact: royalpack depends on riotwatcher (^2.7.1)
   1: fact: royalpack depends on royalspells (^3.2)
   1: fact: royalpack depends on royalnet (^5.1.6)
   1: selecting royalpack (5.1.6)
   1: derived: royalnet (^5.1.6)
   1: derived: royalspells (^3.2)
   1: derived: riotwatcher (^2.7.1)
PyPI: 1 packages found for royalnet >=5.1.6,<6.0.0
   1: fact: royalnet (5.1.6) depends on dateparser (>=0.7.2,<0.8.0)
   1: fact: royalnet (5.1.6) depends on toml (>=0.10.0,<0.11.0)
   1: fact: royalnet (5.1.6) depends on python_telegram_bot (>=12.2.0,<13.0.0)
   1: fact: royalnet (5.1.6) depends on temp_discordpy_without_websockets_requirement (0.1)
   1: fact: royalnet (5.1.6) depends on pynacl (>=1.3.0,<2.0.0)
   1: fact: royalnet (5.1.6) depends on sqlalchemy (>=1.3.10,<2.0.0)
   1: fact: royalnet (5.1.6) depends on psycopg2_binary (>=2.8.4,<3.0.0)
   1: fact: royalnet (5.1.6) depends on ffmpeg_python (>=0.2.0,<0.3.0)
   1: fact: royalnet (5.1.6) depends on youtube_dl (*)
   1: fact: royalnet (5.1.6) depends on starlette (>=0.12.13,<0.13.0)
   1: fact: royalnet (5.1.6) depends on uvicorn (>=0.10.7,<0.11.0)
   1: fact: royalnet (5.1.6) depends on python-multipart (>=0.0.5,<0.0.6)
   1: fact: royalnet (5.1.6) depends on sentry_sdk (>=0.13.2,<0.14.0)
   1: fact: royalnet (5.1.6) depends on websockets (>=8.1,<9.0)
   1: fact: royalnet (5.1.6) depends on coloredlogs (>=10.0,<11.0)
   1: selecting royalnet (5.1.6)
   1: derived: coloredlogs (>=10.0,<11.0)
   1: derived: websockets (>=8.1,<9.0)
   1: derived: sentry_sdk (>=0.13.2,<0.14.0)
   1: derived: python-multipart (>=0.0.5,<0.0.6)
   1: derived: uvicorn (>=0.10.7,<0.11.0)
   1: derived: starlette (>=0.12.13,<0.13.0)
   1: derived: youtube_dl (*)
   1: derived: ffmpeg_python (>=0.2.0,<0.3.0)
   1: derived: psycopg2_binary (>=2.8.4,<3.0.0)
   1: derived: sqlalchemy (>=1.3.10,<2.0.0)
   1: derived: pynacl (>=1.3.0,<2.0.0)
   1: derived: temp_discordpy_without_websockets_requirement (0.1)
   1: derived: python_telegram_bot (>=12.2.0,<13.0.0)
   1: derived: toml (>=0.10.0,<0.11.0)
   1: derived: dateparser (>=0.7.2,<0.8.0)
PyPI: 1 packages found for royalspells >=3.2,<4.0
   1: selecting royalspells (3.2)
PyPI: 1 packages found for riotwatcher >=2.7.1,<3.0.0
   1: fact: riotwatcher (2.7.1) depends on requests (*)
   1: selecting riotwatcher (2.7.1)
   1: derived: requests (*)
PyPI: 1 packages found for coloredlogs >=10.0,<11.0
   1: fact: coloredlogs (10.0) depends on humanfriendly (>=4.7)
   1: fact: coloredlogs (10.0) depends on colorama (*)
   1: selecting coloredlogs (10.0)
   1: derived: colorama (*)
   1: derived: humanfriendly (>=4.7)
PyPI: No release information found for websockets-0.1, skipping
PyPI: 1 packages found for websockets >=8.1,<9.0
   1: selecting websockets (8.1)
PyPI: 4 packages found for sentry-sdk >=0.13.2,<0.14.0
   1: fact: sentry-sdk (0.13.5) depends on urllib3 (>=1.10.0)
   1: fact: sentry-sdk (0.13.5) depends on certifi (*)
   1: selecting sentry-sdk (0.13.5)
   1: derived: certifi (*)
   1: derived: urllib3 (>=1.10.0)
PyPI: 1 packages found for python-multipart >=0.0.5,<0.0.6
   1: fact: python-multipart (0.0.5) depends on six (>=1.4.0)
   1: selecting python-multipart (0.0.5)
   1: derived: six (>=1.4.0)
PyPI: 2 packages found for uvicorn >=0.10.7,<0.11.0
   1: fact: uvicorn (0.10.8) depends on click (>=7.0.0,<8.0.0)
   1: fact: uvicorn (0.10.8) depends on h11 (>=0.8.0,<0.9.0)
   1: fact: uvicorn (0.10.8) depends on websockets (>=8.0.0,<9.0.0)
   1: fact: uvicorn (0.10.8) depends on httptools (0.0.13)
   1: fact: uvicorn (0.10.8) depends on uvloop (>=0.14.0)
   1: selecting uvicorn (0.10.8)
   1: derived: uvloop (>=0.14.0)
   1: derived: httptools (0.0.13)
   1: derived: h11 (>=0.8.0,<0.9.0)
   1: derived: click (>=7.0.0,<8.0.0)
PyPI: 1 packages found for starlette >=0.12.13,<0.13.0
   1: selecting starlette (0.12.13)
PyPI: No release information found for youtube-dl-2013.07.23, skipping
PyPI: No release information found for youtube-dl-2013.07.23.1, skipping
PyPI: 891 packages found for youtube-dl *
   1: selecting youtube-dl (2019.11.28)
PyPI: 1 packages found for ffmpeg-python >=0.2.0,<0.3.0
   1: fact: ffmpeg-python (0.2.0) depends on future (*)
   1: selecting ffmpeg-python (0.2.0)
   1: derived: future (*)
PyPI: 1 packages found for psycopg2-binary >=2.8.4,<3.0.0
   1: selecting psycopg2-binary (2.8.4)
PyPI: 2 packages found for sqlalchemy >=1.3.10,<2.0.0
   1: selecting sqlalchemy (1.3.11)
PyPI: 1 packages found for pynacl >=1.3.0,<2.0.0
   1: fact: pynacl (1.3.0) depends on six (*)
   1: fact: pynacl (1.3.0) depends on cffi (>=1.4.1)
   1: selecting pynacl (1.3.0)
   1: derived: cffi (>=1.4.1)
PyPI: 1 packages found for temp-discordpy-without-websockets-requirement 0.1
   1: fact: temp-discordpy-without-websockets-requirement (0.1) depends on aiohttp (>=3.3.0,<3.6.0)
   1: fact: temp-discordpy-without-websockets-requirement (0.1) depends on websockets (>=8.0)
   1: selecting temp-discordpy-without-websockets-requirement (0.1)
   1: derived: aiohttp (>=3.3.0,<3.6.0)
PyPI: No release information found for python-telegram-bot-1.0, skipping
PyPI: 1 packages found for python-telegram-bot >=12.2.0,<13.0.0
   1: fact: python-telegram-bot (12.2.0) depends on future (>=0.16.0)
   1: fact: python-telegram-bot (12.2.0) depends on certifi (*)
   1: fact: python-telegram-bot (12.2.0) depends on tornado (>=5.1)
   1: fact: python-telegram-bot (12.2.0) depends on cryptography (*)
   1: selecting python-telegram-bot (12.2.0)
   1: derived: cryptography (*)
   1: derived: tornado (>=5.1)
   1: derived: future (>=0.16.0)
PyPI: 1 packages found for toml >=0.10.0,<0.11.0
   1: selecting toml (0.10.0)
PyPI: 1 packages found for dateparser >=0.7.2,<0.8.0
   1: fact: dateparser (0.7.2) depends on python-dateutil (*)
   1: fact: dateparser (0.7.2) depends on pytz (*)
   1: fact: dateparser (0.7.2) depends on regex (*)
   1: fact: dateparser (0.7.2) depends on tzlocal (*)
   1: selecting dateparser (0.7.2)
   1: derived: tzlocal (*)
   1: derived: regex (*)
   1: derived: pytz (*)
   1: derived: python-dateutil (*)
PyPI: No release information found for requests-0.0.1, skipping
PyPI: No release information found for requests-0.12.01, skipping
PyPI: No release information found for requests-2.15.0, skipping
PyPI: 135 packages found for requests *
   1: fact: requests (2.22.0) depends on chardet (>=3.0.2,<3.1.0)
   1: fact: requests (2.22.0) depends on idna (>=2.5,<2.9)
   1: fact: requests (2.22.0) depends on urllib3 (>=1.21.1,<1.25.0 || >1.25.0,<1.25.1 || >1.25.1,<1.26)
   1: fact: requests (2.22.0) depends on certifi (>=2017.4.17)
   1: selecting requests (2.22.0)
   1: derived: certifi (>=2017.4.17)
   1: derived: urllib3 (>=1.21.1,<1.25.0 || >1.25.0,<1.25.1 || >1.25.1,<1.26)
   1: derived: idna (>=2.5,<2.9)
   1: derived: chardet (>=3.0.2,<3.1.0)
PyPI: 41 packages found for colorama *
   1: selecting colorama (0.4.3)
PyPI: 15 packages found for humanfriendly >=4.7
   1: fact: humanfriendly (4.18) depends on pyreadline (*)
   1: selecting humanfriendly (4.18)
   1: derived: pyreadline (*)
PyPI: No release information found for certifi-0, skipping
PyPI: 14 packages found for certifi >=2017.4.17
   1: selecting certifi (2019.11.28)
PyPI: No release information found for urllib3-0.3, skipping
PyPI: No release information found for urllib3-0.3.1, skipping
PyPI: No release information found for urllib3-0.4.0, skipping
PyPI: No release information found for urllib3-0.4.1, skipping
PyPI: 13 packages found for urllib3 >=1.21.1,<1.25.0 || >1.25.0,<1.25.1 || >1.25.1,<1.26
   1: selecting urllib3 (1.25.7)
PyPI: 17 packages found for six >=1.4.0
   1: selecting six (1.13.0)
PyPI: No release information found for uvloop-0.4.0, skipping
PyPI: 1 packages found for uvloop >=0.14.0
   1: selecting uvloop (0.14.0)
PyPI: 1 packages found for httptools 0.0.13
   1: selecting httptools (0.0.13)
PyPI: No release information found for h11-0.0.1, skipping
PyPI: 2 packages found for h11 >=0.8.0,<0.9.0
   1: selecting h11 (0.8.1)
PyPI: 1 packages found for click >=7.0.0,<8.0.0
   1: selecting click (7.0)
PyPI: 6 packages found for future >=0.16.0
   1: selecting future (0.18.2)
PyPI: 25 packages found for cffi >=1.4.1
   1: fact: cffi (1.13.2) depends on pycparser (*)
   1: selecting cffi (1.13.2)
   1: derived: pycparser (*)
PyPI: 13 packages found for aiohttp >=3.3.0,<3.6.0
   1: fact: aiohttp (3.5.4) depends on attrs (>=17.3.0)
   1: fact: aiohttp (3.5.4) depends on chardet (>=2.0,<4.0)
   1: fact: aiohttp (3.5.4) depends on multidict (>=4.0,<5.0)
   1: fact: aiohttp (3.5.4) depends on async-timeout (>=3.0,<4.0)
   1: fact: aiohttp (3.5.4) depends on yarl (>=1.0,<2.0)
   1: selecting aiohttp (3.5.4)
   1: derived: yarl (>=1.0,<2.0)
   1: derived: async-timeout (>=3.0,<4.0)
   1: derived: multidict (>=4.0,<5.0)
   1: derived: attrs (>=17.3.0)
PyPI: 73 packages found for cryptography *
   1: fact: cryptography (2.8) depends on six (>=1.4.1)
   1: fact: cryptography (2.8) depends on cffi (>=1.8,<1.11.3 || >1.11.3)
   1: selecting cryptography (2.8)
PyPI: 6 packages found for tornado >=5.1
   1: selecting tornado (6.0.3)
PyPI: 16 packages found for tzlocal *
   1: fact: tzlocal (2.0.0) depends on pytz (*)
   1: selecting tzlocal (2.0.0)
PyPI: 269 packages found for regex *
   1: selecting regex (2019.12.9)
PyPI: 82 packages found for pytz *
   1: selecting pytz (2019.3)
PyPI: No release information found for python-dateutil-0.1, skipping
PyPI: No release information found for python-dateutil-0.3, skipping
PyPI: No release information found for python-dateutil-0.4, skipping
PyPI: No release information found for python-dateutil-0.5, skipping
PyPI: No release information found for python-dateutil-1.0, skipping
PyPI: No release information found for python-dateutil-1.1, skipping
PyPI: No release information found for python-dateutil-1.2, skipping
PyPI: No release information found for python-dateutil-2.0, skipping
PyPI: 23 packages found for python-dateutil *
   1: fact: python-dateutil (2.8.1) depends on six (>=1.5)
   1: selecting python-dateutil (2.8.1)
PyPI: No release information found for idna-0.1, skipping
PyPI: 4 packages found for idna >=2.5,<2.9
   1: selecting idna (2.8)
PyPI: 3 packages found for chardet >=3.0.2,<3.1.0
   1: selecting chardet (3.0.4)
PyPI: No release information found for pyreadline-1.3.svn, skipping
PyPI: 8 packages found for pyreadline *
   1: selecting pyreadline (2.1)
PyPI: 19 packages found for pycparser *
   1: selecting pycparser (2.19)
PyPI: No release information found for yarl-0.5.0b0, skipping
PyPI: No release information found for yarl-0.5.0b1, skipping
PyPI: 14 packages found for yarl >=1.0,<2.0
   1: fact: yarl (1.4.2) depends on multidict (>=4.0)
   1: fact: yarl (1.4.2) depends on idna (>=2.0)
   1: selecting yarl (1.4.2)
PyPI: 2 packages found for async-timeout >=3.0,<4.0
   1: selecting async-timeout (3.0.1)
PyPI: No release information found for multidict-0.0.1, skipping
PyPI: 13 packages found for multidict >=4.0,<5.0
   1: selecting multidict (4.6.1)
PyPI: 7 packages found for attrs >=17.3.0
   1: selecting attrs (19.3.0)
   1: Version solving took 2.655 seconds.
   1: Tried 1 solutions.

Writing lock file

[InvalidRequirement]
Invalid requirement, parse error at "';  or'"

Traceback (most recent call last):
  File "C:\Users\stepi\.poetry\lib\poetry\_vendor\py3.8\clikit\console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "C:\Users\stepi\.poetry\lib\poetry\_vendor\py3.8\clikit\api\command\command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "C:\Users\stepi\.poetry\lib\poetry\_vendor\py3.8\clikit\api\command\command.py", line 171, in _do_handle
    return getattr(handler, handler_method)(args, io, self)
  File "C:\Users\stepi\.poetry\lib\poetry\_vendor\py3.8\cleo\commands\command.py", line 92, in wrap_handle
    return self.handle()
  File "C:\Users\stepi\.poetry\lib\poetry\console\commands\update.py", line 49, in handle
    return installer.run()
  File "C:\Users\stepi\.poetry\lib\poetry\installation\installer.py", line 74, in run
    self._do_install(local_repo)
  File "C:\Users\stepi\.poetry\lib\poetry\installation\installer.py", line 225, in _do_install
    ops = solver.solve(use_latest=whitelist)
  File "C:\Users\stepi\.poetry\lib\poetry\puzzle\solver.py", line 36, in solve
    packages, depths = self._solve(use_latest=use_latest)
  File "C:\Users\stepi\.poetry\lib\poetry\puzzle\solver.py", line 180, in _solve
    result = resolve_version(
  File "C:\Users\stepi\.poetry\lib\poetry\mixology\__init__.py", line 7, in resolve_version
    return solver.solve()
  File "C:\Users\stepi\.poetry\lib\poetry\mixology\version_solver.py", line 80, in solve
    next = self._choose_package_version()
  File "C:\Users\stepi\.poetry\lib\poetry\mixology\version_solver.py", line 398, in _choose_package_version
    self._solution.decide(version)
  File "C:\Users\stepi\.poetry\lib\poetry\mixology\partial_solution.py", line 87, in decide
    Assignment.decision(package, self.decision_level, len(self._assignments))
  File "C:\Users\stepi\.poetry\lib\poetry\mixology\assignment.py", line 35, in decision
    return cls(package.to_dependency(), True, decision_level, index)
  File "C:\Users\stepi\.poetry\lib\poetry\packages\package.py", line 394, in to_dependency
    return dependency_from_pep_508(name)
  File "C:\Users\stepi\.poetry\lib\poetry\packages\__init__.py", line 38, in dependency_from_pep_508
    req = Requirement(name)
  File "C:\Users\stepi\.poetry\lib\poetry\version\requirements.py", line 210, in __init__
    raise InvalidRequirement(

@@ -614,6 +614,12 @@ def without_extras(self):

return MarkerUnion(*new_markers)

def is_any(self): # type: () -> bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I fixed/added this in 1.0.0b9 can you try again on the latest release?

PR: #1650

Copy link
Author

@Steffo99 Steffo99 Dec 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying immediately!

Copy link
Contributor

@JBKahn JBKahn Dec 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may need to re-lock as the previous versions created issues with the lockfile because of that (as opposed to calling update).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be working perfectly! Thanks! :D

@Steffo99
Copy link
Author

Closed as this is a duplicate of #1650.

@Steffo99 Steffo99 closed this Dec 10, 2019
Copy link

github-actions bot commented Mar 1, 2024

This pull request 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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants