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

cowardly pypy bug #1355

Closed
obestwalter opened this issue Jun 26, 2019 · 4 comments · Fixed by #1356
Closed

cowardly pypy bug #1355

obestwalter opened this issue Jun 26, 2019 · 4 comments · Fixed by #1356

Comments

@obestwalter
Copy link
Member

@obestwalter obestwalter commented Jun 26, 2019

I haven't had time to look closer yet, but I am pretty sure that there is a problem with our "do not delete folders that don't look like venvs" protection.

When testing tox-direct it regularly occurs that this is shown:

tox -r -e pypy
GLOB sdist-make: /home/ob/oss/tox-dev/tox-direct/setup.py
pypy recreate: /home/ob/oss/tox-dev/tox-direct/.tox/pypy
ERROR: cowardly refusing to delete `envdir` (it does not look like a virtualenv): /home/ob/oss/tox-dev/tox-direct/.tox/pypy

the folder looks fine though:

tree -L 2 .tox/pypy
.tox/pypy
├── bin
│   ├── activate
│   ├── activate.csh
│   ├── activate.fish
│   ├── activate.ps1
│   ├── activate_this.py
│   ├── easy_install
│   ├── easy_install-2.7
│   ├── libpypy-c.so -> /opt/pypy/bin/libpypy-c.so
│   ├── pip
│   ├── pip2
│   ├── pip2.7
│   ├── py.test
│   ├── pypy
│   ├── pytest
│   ├── python -> pypy
│   ├── python-config
│   ├── python2 -> pypy
│   ├── python2.7 -> pypy
│   ├── tox
│   ├── tox-quickstart
│   ├── virtualenv
│   └── wheel
├── include -> /opt/pypy/include
├── lib-python
│   └── 2.7
├── lib_pypy
│   └── readline.py -> /opt/pypy/lib_pypy/readline.py
├── log
│   ├── pypy-0.log
│   ├── pypy-1.log
│   ├── pypy-2.log
│   ├── pypy-3.log
│   ├── pypy-4.log
│   ├── pypy-5.log
│   └── pypy-6.log
├── site-packages
│   ├── _pytest
│   ├── [...]
│   └── zipp.pyc
└── tmp
@obestwalter
Copy link
Member Author

@obestwalter obestwalter commented Jun 27, 2019

It fails because of dir_items > {"bin", "lib"} - pypy does have lib_python and lib-python but no lib. We could now start checking for that, but I wonder if we can get away with something simpler and more generic as the main thing that needs to exist is bin/python to "qualify" as a venv.

Alternatively we can check for include rather than lib as this seems to be in all installations. I'll dig out pyenv though and check.

@obestwalter
Copy link
Member Author

@obestwalter obestwalter commented Jun 27, 2019

jython does not have an include (I know, we don't really actively support it anymore), but we don't have to actively prevent support either. So I went with adding and explicit check for the pypy layout.

@gaborbernat
Copy link
Member

@gaborbernat gaborbernat commented Jun 27, 2019

The only guarantee is that under bin dir there will be a python, we should check against that.

@obestwalter
Copy link
Member Author

@obestwalter obestwalter commented Jun 27, 2019

I went with going along how @asottile started. It's a bit safer as it looks at more and now with the addition of the pypy special case should work for all supported interpreters.

@helpr helpr bot added pr-merged and removed pr-available labels Jun 28, 2019
@tox-dev tox-dev locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants