Skip to content
This repository has been archived by the owner on Jul 23, 2020. It is now read-only.

[BUG] 3.8.0 breaks tox-venv / pip's CI (AttributeError: 'VirtualEnv' object has no attribute 'session') #29

Closed
cjerdonek opened this issue Mar 28, 2019 · 12 comments
Assignees

Comments

@cjerdonek
Copy link

PR #1145 (released as part of 3.8.0) seems to be breaking tox-venv because the PR removed the session attribute of VirtualEnv, which tox-venv uses.

Here is the traceback from pip's CI:

  File "/home/travis/virtualenv/python3.6.7/bin/tox", line 11, in <module>
    sys.exit(cmdline())
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/tox/session/__init__.py", line 42, in cmdline
    main(args)
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/tox/session/__init__.py", line 63, in main
    retcode = session.runcommand()
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/tox/session/__init__.py", line 187, in runcommand
    return self.subcommand_test()
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/tox/session/__init__.py", line 215, in subcommand_test
    run_sequential(self.config, self.venv_dict)
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/tox/session/commands/run/sequential.py", line 9, in run_sequential
    if venv.setupenv():
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/tox/venv.py", line 582, in setupenv
    status = self.update(action=action)
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/tox/venv.py", line 240, in update
    self.hook.tox_testenv_create(action=action, venv=self)
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/pluggy/hooks.py", line 284, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/pluggy/manager.py", line 67, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/pluggy/manager.py", line 61, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/pluggy/callers.py", line 208, in _multicall
    return outcome.get_result()
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/tox_venv/hooks.py", line 99, in tox_testenv_create
    venv.session.make_emptydir(venv.path)
AttributeError: 'VirtualEnv' object has no attribute 'session'

And here is the relevant tox-venv code:

venv.session.make_emptydir(venv.path)

@gaborbernat
Copy link
Member

there already is a fix for this on the tox-venv repo, the bug belongs there too 😐

@cjerdonek
Copy link
Author

Thanks. Can you provide a link? I don't seem to see it.

@gaborbernat
Copy link
Member

I'm working on it, will provide soon, expect a fix in a few hours.

@gaborbernat gaborbernat transferred this issue from tox-dev/tox Mar 28, 2019
@gaborbernat
Copy link
Member

This belongs here.

@gaborbernat gaborbernat self-assigned this Mar 28, 2019
@cjerdonek
Copy link
Author

Hmm, what is the bug in tox-venv if it was working fine before?

It doesn't look right to me to move this issue out of the tox repo because now this particular effect of the release won't be visible to tox users and maintainers -- even for discussion purposes. It would have been better IMO to create a copy.

@gaborbernat
Copy link
Member

This package was using an internal detail of tox part of its implementation. As the internal detail implementation changed now we need to update the code.

@gaborbernat
Copy link
Member

The fix has landed on master, @obestwalter or @rpkilby can you cut a new release? Or give me rights to do so, thanks!

@cjerdonek
Copy link
Author

cjerdonek commented Mar 28, 2019

I don’t see a fix on master, FYI. It also doesn’t look like there is a PR.

@gaborbernat
Copy link
Member

was reverted by @rpkilby

@rpkilby
Copy link
Member

rpkilby commented Mar 28, 2019

Sorry for the delay @cjerdonek. I reverted #30 for a couple of reasons. More info is in the PR.

Currently, I'm debugging a CI issue related to changes in tox 3.2.0, and I think I'm pretty close to having that done. Once that's ready, it shouldn't take too much longer to pull in the fix for this issue.

@cjerdonek
Copy link
Author

Okay, thanks. Even after reading it it’s confusing because even that PR doesn’t say it fixes this issue (no PR referenced this issue).

@rpkilby
Copy link
Member

rpkilby commented Mar 29, 2019

I think he meant to reference this issue, but incorrectly referenced his own PR (it wouldn't make sense for #30 to fix #30). I've definitely made this same mistake in the past.

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

No branches or pull requests

4 participants