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

Tox envbindir mismatch using the tox-pipenv plugin #57

Open
ivar-lazzaro opened this issue Nov 18, 2018 · 1 comment
Open

Tox envbindir mismatch using the tox-pipenv plugin #57

ivar-lazzaro opened this issue Nov 18, 2018 · 1 comment

Comments

@ivar-lazzaro
Copy link

tox version = 3.5.3
tox-pipenv version = 1.8.0

Running tox using tox-pipenv produces the following output:

WARNING: test command found but not installed in testenv
cmd: /Users/myself/workspace/project/venv/bin/python
env: /Users/myself/workspace/project/.tox/py36
Maybe you forgot to specify a dependency? See also the whitelist_externals envconfig setting.

Tests pass correctly, but the above warning indicates that my venv's python binary was used instead of that installed in the tox envbindir.
Digging a bit into tox code, I found the following in config.py:

def get_envbindir(self):
    """Path to directory where scripts/binaries reside."""
    if tox.INFO.IS_WIN and "jython" not in self.basepython and "pypy" not in self.basepython:
        return self.envdir.join("Scripts")
    else:
        return self.envdir.join("bin")

where envdir points to "/Users/myself/workspace/project/.tox/py36", whereas tox-pipenv creates the virtual environment in /Users/myself/workspace/project/.tox/py36/.venv

If I try to override envdir in my tox.ini to point to .tox/py36/.venv, then tox creates .tox/py36/.venv/.venv :)

Adding "python" to whitelist_externals suppresses the warning, but I wonder if envdir shouldn't point to the actual environment directory instead.

@tonybaloney
Copy link
Collaborator

hi @ivar-lazzaro this is a known (yet undocumented) issue.

I haven't found a reliable way around this, without potentially adding a compromising whitelist to the default settings.

My understanding is that pipenv doesn't copy the python binary in the same way that venv would, so the binary it's calling is elsewhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants