-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
running inside tox uses unvendorized dependencies #848
Comments
I confirm this bug happens. |
This also happens to me. I have not found a workaround yet, it would be helpful if this was fixed so that I could use poetry as the build-system. |
You should use isolated builds as explained in the documentation: https://poetry.eustace.io/docs/faq/#is-tox-supported |
Tried as doc suggests:
|
I believe the issue here is that poetry doesn't have a way to specify build dependencies separate from runtime dependencies. Here's the problematic code: def get_requires_for_build_wheel(config_settings=None):
"""
Returns a list of requirements for building, as strings
"""
poetry = Poetry.create(".")
main, _ = SdistBuilder.convert_dependencies(poetry.package, poetry.package.requires)
return main Ideally, poetry would either have a separate section for build dependencies, ala |
I have a very similar issue.
With this log, it appears that pip uses poetry from a temporary folder /tmp/pip-build-env-3THB7E/overlay/lib/python2.7/site-packages/poetry and not the one installed with the preferred procedure. |
i tried upgrading i also specified this in the [build-system]
requires = ["poetry>=0.12.16", "jsonschema>=3.0"]
build-backend = "poetry.masonry.api" thus, i wouldn't be sure whether an 'outer' |
for what it's worth, switching to nox and using an 'outside' poetry installation is not an option. edited after i noticed that the wrong interpreter is used. |
I had a similar problem with a project based around docker-compose. Docker compose requires jsonschema < 3 in its current release, so I had to downgrade my in-envrionment poetry install to 0.11.5 (the last version released that did not have the higher jsonschema requirement. It makes me wonder if moving to the newest jsonschema for 0.12 was really a wise idea. |
@jimmyharris docker-compose, like poetry itself should be installed in a different python distribution than the one you are developing. That distribution might be the OS one, or a different virtualenv. I usually install docker-compose using pipx |
Generally this is true but I am actually building a project that extends docker compose programmatically and i can’t guarantee that my tools will be correctly installed my ci group. |
I just stumbled on this problem when trying to enable tox integration in my poetry managed project. In my case the issue comes from the dependency on The first failure is when, preparing the build venv, tox asks poetry which are the build dependencies of my project (in this case "cleo>=7.0,cleo<0.8", but poetry requires "cleo<0.7"), then tox upgrades the version of cleo in the same venv, and that makes the previously installed poetry unusable. I tried to follow up on @wfscheper suggestion, by making
So I deduce tox requires the build backend and the project to have compatible dependencies, even if we require I would suggest, at least, to clarify this point in the documentation. |
Actually I just realized it's not tox that imposes that build and runtime dependencies have to be compatible: it's pip itself. I just tried to call
This also makes my problem similar to #826 too. |
I believe that the suggested way of installing using poetry in tox does not install to an isolated environment: I'm not sure if this is what is causing this issue, but I think it exposes some issues about the way poetry works, that mean it cannot work with tox to ensure a fully isolated test run. Instead of installing packages to the tox environment that is currently active, it installs to the same environment that is used in development. Whilst this works, it does not feel like it is the correct approach - the point of tox is that it is an isolated test environment, and thus should be an isolated virtual environment too. It is possible to indicate to poetry that it should not create a virtual environment: but this does not appear to change if poetry will use a virtual environment - in my tox test runs it still installs to the same location (or, more specifically, indicates that it doesn't need to install). Likewise, there is a setting that indicates that it should use an "in-project" virtualenv. However, this appears to not work either: it still installs to my "development" virtualenv. But, setting config values from within a tox environment test run is not a satisfactory pathway when using poetry anyway: all Pipenv avoids this problem by automatically installing to the current virtualenv if it detects one: but I think an alternative solution could be to allow setting which virtualenv should be used to install to. |
Issues #1745 and #1941 might be related. From my point of view having |
The original issue should not exists anymore. That's why I'm closing this thread. |
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. |
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: Debian testing
Poetry version: 0.12.11
Issue
I'm trying to use poetry inside tox following instructions in #222.
I think that when installing the local package inside virtualenv created by tox a new poetry is used using dependencies from surrounding virtualenv.
If the project has dependency conflicting with poetry dependencies the installation fails.
My conflicting dependency is
jsonschema
, jsonschema ^2.6 used by project is not compatible with jsonschema 3 used by poetry.pyproject.toml
tox.ini
The text was updated successfully, but these errors were encountered: