You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Poetry appears to write warnings to stdout when exporting the requirements, causing a parse error.
Update:It's likely not Poetry mixing stdout and stderr here. The Nox interface we're using to invoke Poetry does not return these streams separately. It is actually Poetry writing the warning to stdout. And we're already passing stderr=None to keep stderr separately.
See this run from #348 where the lock file was not up to date:
Run nox --force-color --python=3.9
nox --force-color --python=3.9
shell: /usr/bin/bash -e {0}
env:
NOXSESSION: pre-commit
pythonLocation: /opt/hostedtoolcache/Python/3.9.4/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.4/x64/lib
nox > Running session pre-commit
nox > Creating virtual environment (virtualenv) using python3.9 in .nox/pre-commit
nox > poetry export --format=requirements.txt --dev --without-hashes
nox > Session pre-commit raised exception RuntimeError('line 1: \'Warning: The lock file is not up to date with the latest changes in pyproject.toml. You may be getting outdated dependencies. Run update to update them.\': Parse error at "\': The lo\'": Expected stringEnd')
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.9.4/x64/lib/python3.9/site-packages/packaging/requirements.py", line 113, in __init__
req = REQUIREMENT.parseString(requirement_string)
File "/opt/hostedtoolcache/Python/3.9.4/x64/lib/python3.9/site-packages/pyparsing.py", line 1955, in parseString
raise exc
File "/opt/hostedtoolcache/Python/3.9.4/x64/lib/python3.9/site-packages/pyparsing.py", line 3814, in parseImpl
raise ParseException(instring, loc, self.errmsg, self)
pyparsing.ParseException: Expected stringEnd, found ':' (at char 7), (line:1, col:8)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.9.4/x64/lib/python3.9/site-packages/nox_poetry/sessions.py", line 67, in to_constraint
requirement = Requirement(requirement_string)
File "/opt/hostedtoolcache/Python/3.9.4/x64/lib/python3.9/site-packages/packaging/requirements.py", line 115, in __init__
raise InvalidRequirement(
packaging.requirements.InvalidRequirement: Parse error at "': The lo'": Expected stringEnd
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.9.4/x64/lib/python3.9/site-packages/nox/sessions.py", line 549, in execute
self.func(session)
File "/opt/hostedtoolcache/Python/3.9.4/x64/lib/python3.9/site-packages/nox/_decorators.py", line 53, in __call__
return self.func(*args, **kwargs)
File "/opt/hostedtoolcache/Python/3.9.4/x64/lib/python3.9/site-packages/nox_poetry/sessions.py", line 42, in wrapper
function(proxy, *_args, **_kwargs)
File "/home/runner/work/nox-poetry/nox-poetry/noxfile.py", line 81, in precommit
session.install(
File "/opt/hostedtoolcache/Python/3.9.4/x64/lib/python3.9/site-packages/nox_poetry/sessions.py", line 276, in install
return self.poetry.install(*args, **kwargs)
File "/opt/hostedtoolcache/Python/3.9.4/x64/lib/python3.9/site-packages/nox_poetry/sessions.py", line 144, in install
requirements = self.export_requirements()
File "/opt/hostedtoolcache/Python/3.9.4/x64/lib/python3.9/site-packages/nox_poetry/sessions.py", line 210, in export_requirements
constraints = to_constraints(self.poetry.export())
File "/opt/hostedtoolcache/Python/3.9.4/x64/lib/python3.9/site-packages/nox_poetry/sessions.py", line 89, in to_constraints
return "\n".join(_to_constraints())
File "/opt/hostedtoolcache/Python/3.9.4/x64/lib/python3.9/site-packages/nox_poetry/sessions.py", line 85, in _to_constraints
constraint = to_constraint(requirement, line)
File "/opt/hostedtoolcache/Python/3.9.4/x64/lib/python3.9/site-packages/nox_poetry/sessions.py", line 69, in to_constraint
raise RuntimeError(f"line {line}: {requirement_string!r}: {error}")
RuntimeError: line 1: 'Warning: The lock file is not up to date with the latest changes in pyproject.toml. You may be getting outdated dependencies. Run update to update them.': Parse error at "': The lo'": Expected stringEnd
nox > Session pre-commit failed.
Error: Process completed with exit code 1.
The text was updated successfully, but these errors were encountered:
Poetry appears to write warnings to stdout when exporting the requirements, causing a parse error.
Update:
It's likely not Poetry mixing stdout and stderr here. The Nox interface we're using to invoke Poetry does not return these streams separately.It is actually Poetry writing the warning to stdout. And we're already passingstderr=None
to keep stderr separately.See this run from #348 where the lock file was not up to date:
The text was updated successfully, but these errors were encountered: