Skip to content

Commit 2d2b2ae

Browse files
obestwalterasottile
authored andcommitted
Add explicit check for pypy venv (#1356)
* Add explicit check for pypy venv * Add changelog entry * Add regression test for --recreate
1 parent 30a3a4d commit 2d2b2ae

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

docs/changelog/1355.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
on venv cleanup: add explicit check for pypy venv to make it possible to recreate it - by :user:`obestwalter`

src/tox/venv.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,8 @@ def cleanup_for_venv(venv):
711711
or (INFO.IS_WIN and dir_items > {"Scripts", "Lib"})
712712
# non-windows, with lib and bin => OK
713713
or dir_items > {"bin", "lib"}
714+
# pypy has a different lib folder => OK
715+
or dir_items > {"bin", "lib_pypy"}
714716
):
715717
venv.status = "error"
716718
reporter.error(

tests/unit/test_z_cmdline.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ def test_envdir_would_delete_some_directory(cmd, initproj):
135135
assert "cowardly refusing to delete `envdir`" in result.out
136136

137137

138+
def test_recreate(cmd, initproj):
139+
initproj("example-123", filedefs={"tox.ini": ""})
140+
cmd("-e", "py", "--notest").assert_success()
141+
cmd("-r", "-e", "py", "--notest").assert_success()
142+
143+
138144
def test_run_custom_install_command_error(cmd, initproj):
139145
initproj(
140146
"interp123-0.5",

0 commit comments

Comments
 (0)