-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
tox + Poetry Issues #1163
Comments
Hello, tox will use by default the same python version tox is installed under to build the package. So your options is either to install tox under python 3.6/3.7 or: If you need a different python you should specify inside the packaging env accordingly, for example: require 3.6 via [tox:.package]
basepython=python3.6 Sorry for this causing issues to you we should probably document under https://tox.readthedocs.io/en/latest/example/package.html how to use poetry (that is not python 2 compatible compared to all other build systems). |
Thank you for the quick response! Hmm, I'm not sure I understand. If I pass the build_isolated parameter, will tox not build the project using multiple python versions as specified? tox is currently installed under python 3.6.5. (I also tried your suggestion just to double check and no dice) It's super quick to reproduce this bug so you can see it for yourself. $ curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
$ poetry init test
$ # copy and paste the provided toml file
$ poetry lock
$ poetry install -vvv # this works
$ poetry run tox # this does not |
Can you post the output of the |
According to poetry documentation the above python (in the curl install) should be your system python to keep poetry isolated from the rest of the various python versions on your system. A bash_profile (or rc) amendment is made to add the installed poetry to your path exposing the command everywhere. Poetry then uses the various pythons installed on your system (I'm using pyenv) to build virtualenvs in Library/Cache on a mac (not sure on linux) which houses each project's virtual environment. The local python version for the test dir is set to python 3.6.5 (if that is not already you're global python version). I am following that suggested setup to the tee. $ curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
$ poetry init test
$ # copy and paste the provided toml file
$ pyenv local 3.6.5
$ poetry lock
$ poetry install -vvv # this works
$ poetry run tox -rvvv # this does not Here are the command outputs that you had requested: |
What pulls in
That was introduced in python 3.6 https://docs.python.org/3/library/enum.html#intflag. Your error is not caused by tox, enum34 should never be installed in Traceback (most recent call last):
File "/Users/adithyabalaji/.pyenv/versions/3.6.5/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/Users/adithyabalaji/.pyenv/versions/3.6.5/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/adithyabalaji/Coding/GeorgianPartners/test/.tox/py36/lib/python3.6/site-packages/pip/__main__.py", line 16, in <module>
from pip._internal import main as _main # isort:skip # noqa
File "/Users/adithyabalaji/Coding/GeorgianPartners/test/.tox/py36/lib/python3.6/site-packages/pip/_internal/__init__.py", line 4, in <module>
import locale
File "/Users/adithyabalaji/Coding/GeorgianPartners/test/.tox/py36/lib/python3.6/locale.py", line 16, in <module>
import re
File "/Users/adithyabalaji/Coding/GeorgianPartners/test/.tox/py36/lib/python3.6/re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag' You probably want to raise a bug to grpcio. |
That makes sense but I'm curious as to why |
The install works, however would you try to use any module that uses the enum intflag class that would fail at runtime. in the case above pip calls the regex module that blows up because of this. It's a faulty successful install that causes subsequent runtime errors. tox also succeeds creating the virtual environment, but then trying to invoke pip to get information from the environment fails. |
Hmm that makes complete sense, let me see what I can do to prevent it from poetry's end from installing! @gaborbernat, thank you for being so helpful! |
Simple base project created using:
$ poetry new test
Error:
Issue
After many hours of trials and tribulations, I am unable to coerce tox to work with poetry. As suggested in the latest poetry and tox documentation, I am using the isolated_build parameter in the tox ini and have found that for some odd reason, tox seems to be using the wrong python version (ie enum34 becomes active) when executing. I have found the same issue when building the project from scratch using poetry using custom virtualenv (pyenv) causes the enum34 error whereas a venv using standard python does not which makes me think the bug is on poetry's end as opposed to tox. I have cross posted the bug report to both projects to hopefully get some help to track this one down.
The text was updated successfully, but these errors were encountered: