tox-dev / tox-pipenv

A pipenv plugin for Tox
MIT License
124 stars 30 forks source link

tox 3.8.1 breaks us #61

Closed nichenke closed 3 years ago

nichenke commented 5 years ago

To reproduce:

docker run --rm -it -v $(pwd):$(pwd) -w $(pwd) python:3.7-slim /bin/bash
pip3 install -U tox tox-pipenv
tox

Workaround, fall back to tox 3.7.0:

pip3 install tox==3.7.0

Error:

Traceback (most recent call last):
  File "/usr/local/bin/tox", line 10, in <module>
    sys.exit(cmdline())
  File "/usr/local/lib/python3.7/site-packages/tox/session/__init__.py", line 42, in cmdline
    main(args)
  File "/usr/local/lib/python3.7/site-packages/tox/session/__init__.py", line 63, in main
    retcode = session.runcommand()
  File "/usr/local/lib/python3.7/site-packages/tox/session/__init__.py", line 187, in runcommand
    return self.subcommand_test()
  File "/usr/local/lib/python3.7/site-packages/tox/session/__init__.py", line 215, in subcommand_test
    run_sequential(self.config, self.venv_dict)
  File "/usr/local/lib/python3.7/site-packages/tox/session/commands/run/sequential.py", line 9, in run_sequential
    if venv.setupenv():
  File "/usr/local/lib/python3.7/site-packages/tox/venv.py", line 584, in setupenv
    status = self.update(action=action)
  File "/usr/local/lib/python3.7/site-packages/tox/venv.py", line 242, in update
    self.hook.tox_testenv_create(action=action, venv=self)
  File "/usr/local/lib/python3.7/site-packages/pluggy/hooks.py", line 289, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/usr/local/lib/python3.7/site-packages/pluggy/manager.py", line 68, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/usr/local/lib/python3.7/site-packages/pluggy/manager.py", line 62, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
    return outcome.get_result()
  File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/usr/local/lib/python3.7/site-packages/tox_pipenv/plugin.py", line 64, in tox_testenv_create
    venv.session.make_emptydir(venv.path)
AttributeError: 'VirtualEnv' object has no attribute 'session'
eak24 commented 5 years ago

I'm seeing the same behavior

suoaao commented 5 years ago

me to.

MaximeWeyl commented 5 years ago

Me too, version of tox : tox==3.9.0

kiorky commented 5 years ago

tox-venv has a i think the correct fix: https://github.com/tox-dev/tox-venv/commit/46f758c3e7c634f6be0733999324f99f7717ae7d

mlmarius commented 5 years ago

Any news on this? It's still broken. Installing tox==3.7.0 does not work for me. When I install 3.7.0 my actual package beeing tested is not seen anymore by the test environment.

mitchellsayer commented 5 years ago

Still getting this error. Any update?

fgs-dbudwin commented 5 years ago

Same issue in tox 3.13.2.

sunjiyun26 commented 5 years ago

same 3.13.2 tox --version 3.13.2 imported from /usr/lib/python2.7/site-packages/tox/init.pyc registered plugins: tox-pipenv-1.9.0 at /usr/lib/python2.7/site-packages/tox_pipenv/plugin.pyc

sunjiyun26 commented 5 years ago

ok,in this commit,tox-dev/tox@984ce02#diff-128f6497bdefbc956d8e8c8080964f78 session is refactor, the session is removed, and venv.session.make_emptydir(venv.path) has been replaced by ensure_empty_dir(venv.path) in tox.util.path ,then you replcae venv.session.make_emptydir(venv.path) with ensure_empty_dir(venv.path)

@nichenke @fgs-dbudwin

LKay commented 4 years ago

How much longer will it take to make a fix for that? There have been dozens of tox versions since the bug appeared and tox-pipenv still falls behind...

sworisbreathing commented 4 years ago

Looks like PR #62 fixes this issue but wasn't tagged against it.

kierun commented 4 years ago

Could a kind soul merge PR #62 and release a new version?

casoetan commented 4 years ago

Any updates on this?

nnevala commented 4 years ago

Would really, really love to see this fixed as well!

uhurusurfa commented 4 years ago

Another vote to get this fixed - seems like the project might be dead or dying. I am happy to join the project if there is a shortage of developers to keep the project moving.

tonybaloney commented 4 years ago

this issue is fixed in the latest release

bear commented 4 years ago

This is still happening - from pipenv graph:

tox-pipenv==1.10.0
  - pipenv [required: >=2018.05.18, installed: 2020.5.28]
    - certifi [required: Any, installed: 2020.4.5.1]
    - pip [required: >=18.0, installed: 20.1.1]
    - setuptools [required: >=36.2.1, installed: 47.1.1]
    - virtualenv [required: Any, installed: 20.0.21]
      - appdirs [required: >=1.4.3,<2, installed: 1.4.4]
      - distlib [required: >=0.3.0,<1, installed: 0.3.0]
      - filelock [required: >=3.0.0,<4, installed: 3.0.12]
      - importlib-metadata [required: >=0.12,<2, installed: 1.6.0]
        - zipp [required: >=0.5, installed: 3.1.0]
      - six [required: >=1.9.0,<2, installed: 1.15.0]
    - virtualenv-clone [required: >=0.2.5, installed: 0.5.4]
  - tox [required: >=3.0.0, installed: 3.15.1]
...
spott commented 4 years ago

I'm still getting this error as well.

It looks like it is located here: https://github.com/tox-dev/tox-pipenv/blob/4094fc7b8ff427ea80c1212608fba2a28e96df3d/tox_pipenv/plugin.py#L24

@uhurusurfa: maybe you know how to fix this?

chibacchie commented 3 years ago

Replacing venv.session.config.toxinidir with venv.envconfig.config.toxinidir may fix this issue?

chibacchie commented 3 years ago

I made a small patch for the fix I mentioned above. Could anyone review and accept PR #67?

tonybaloney commented 3 years ago

Released in 1.10.1

tonybaloney commented 3 years ago

thanks @chibacchie for the fix