-vvv option).make build-1.0.10 should show the errorI noticed today when poetry was used in a centos image to install dependencies, it failed (output will be below). It looks like an exception is thrown when creating the virtual environment, which fails, but then poetry tries to install dependencies:
Step 16/16 : RUN poetry install -vvv
---> Running in 7316ee3aa652
/root/.poetry/lib/poetry/_vendor/py2.7/subprocess32.py:149: RuntimeWarning: The _posixsubprocess module is not being used. Child process reliability may suffer if your program uses threads.
"program uses threads.", RuntimeWarning)
The currently activated Python version 2.7.5 is not supported by the project (^3.7).
Trying to find and use a compatible version.
Trying python3
Trying python3.8
Trying python3.7
Using python3.7 (3.7.5)
Creating virtualenv poetry-1.0.10-centos-postposix-WP7muOYE-py3.7 in /root/.cache/pypoetry/virtualenvs
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'PosixPath' is not defined
Using virtualenv: /root/.cache/pypoetry/virtualenvs/poetry-1.0.10-centos-postposix-WP7muOYE-py3.7
Updating dependencies
Resolving dependencies...
1: fact: poetry-1.0.10-centos-postposix is 0.1.0
1: derived: poetry-1.0.10-centos-postposix
1: fact: poetry-1.0.10-centos-postposix depends on jsonschema (^3.2.0)
1: selecting poetry-1.0.10-centos-postposix (0.1.0)
1: derived: jsonschema (^3.2.0)
1: fact: jsonschema (3.2.0) depends on attrs (>=17.4.0)
1: fact: jsonschema (3.2.0) depends on pyrsistent (>=0.14.0)
1: fact: jsonschema (3.2.0) depends on six (>=1.11.0)
1: fact: jsonschema (3.2.0) depends on importlib-metadata (*)
1: selecting jsonschema (3.2.0)
1: derived: importlib-metadata (*)
1: derived: six (>=1.11.0)
1: derived: pyrsistent (>=0.14.0)
1: derived: attrs (>=17.4.0)
1: selecting six (1.15.0)
1: selecting attrs (19.3.0)
1: fact: pyrsistent (0.16.0) depends on six (*)
1: selecting pyrsistent (0.16.0)
1: fact: importlib-metadata (1.7.0) depends on zipp (>=0.5)
1: selecting importlib-metadata (1.7.0)
1: derived: zipp (>=0.5)
1: selecting zipp (3.1.0)
1: Version solving took 0.639 seconds.
1: Tried 1 solutions.
Writing lock file
[SolverProblemError]
The current project's Python requirement (2.7.5) is not compatible with some of the required packages Python requirement:
- zipp requires Python >=3.6
Because no versions of jsonschema match >3.2.0,<4.0.0
and jsonschema (3.2.0) depends on importlib-metadata (*), jsonschema (>=3.2.0,<4.0.0) requires importlib-metadata (*).
And because no versions of importlib-metadata match !=1.7.0
and importlib-metadata (1.7.0) depends on zipp (>=0.5), jsonschema (>=3.2.0,<4.0.0) requires zipp (>=0.5).
Because zipp (3.1.0) requires Python >=3.6
and no versions of zipp match >=0.5,<3.1.0 || >3.1.0, zipp is forbidden.
Thus, jsonschema is forbidden.
So, because poetry-1.0.10-centos-postposix depends on jsonschema (^3.2.0), version solving failed.
Traceback (most recent call last):
File "/root/.poetry/lib/poetry/_vendor/py2.7/clikit/console_application.py", line 131, in run
status_code = command.handle(parsed_args, io)
File "/root/.poetry/lib/poetry/_vendor/py2.7/clikit/api/command/command.py", line 120, in handle
status_code = self._do_handle(args, io)
File "/root/.poetry/lib/poetry/_vendor/py2.7/clikit/api/command/command.py", line 171, in _do_handle
return getattr(handler, handler_method)(args, io, self)
File "/root/.poetry/lib/poetry/_vendor/py2.7/cleo/commands/command.py", line 92, in wrap_handle
return self.handle()
File "/root/.poetry/lib/poetry/console/commands/install.py", line 69, in handle
return_code = installer.run()
File "/root/.poetry/lib/poetry/installation/installer.py", line 74, in run
self._do_install(local_repo)
File "/root/.poetry/lib/poetry/installation/installer.py", line 225, in _do_install
ops = solver.solve(use_latest=whitelist)
File "/root/.poetry/lib/poetry/puzzle/solver.py", line 36, in solve
packages, depths = self._solve(use_latest=use_latest)
File "/root/.poetry/lib/poetry/puzzle/solver.py", line 190, in _solve
raise SolverProblemError(e)
The command '/bin/sh -c poetry install -vvv' returned a non-zero code: 1
make: *** [build-1.0.10] Error 1
Curious if anyone else is running into this. I typically use poetry on my mac, but I have some projects where I'll use it to install dependencies on centos based images like in the example project linked above.
Hope this is helpful, thank you for your consideration!
Duplicate of #2711
@pladdy can you try with the latest pre-release please? As mentioned in #2711 that should fix the environment creation issue.
We should probably fail better when the venv creation fails like this. The installation should not have continued.
I should have searched closed issues, thanks for referencing https://github.com/python-poetry/poetry/issues/2711
I installed the preview version with poetry self update --preview and it worked. Thanks!
Can this be backported? Or can a release be made?
The lockfile does not seem to be backwards compatible.
Most helpful comment
I should have searched closed issues, thanks for referencing https://github.com/python-poetry/poetry/issues/2711
I installed the preview version with
poetry self update --previewand it worked. Thanks!