generated from tweag/project
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test_real_projects: Clean up how we create and populate venvs
This fixes issue #406. Instead of generating lines of a shell script that need to be run with shell=True in subprocess.run(), generate a sequence of argv-style commands. These are safer (no shell involved) and more easily portable to Windows (for one, our quoting of command line args on Windows was dubious, at best...). Also move the first and last commands in the previous shell script (i.e. the preliminary removal of venv_dir, and the creation of the venv_dir/.installed marker file) out of venv_script_lines() and into the __call__() method. Since these are no longer part of the generated commands, they are also no longer part of the venv_hash(). If we make changes to these two steps (without making any other changes that are captured by venv_hash(), we will end up reusing a cache entry. If this is problematic, then some other modification to change the venv_hash() must be added at the same time.
- Loading branch information
Showing
1 changed file
with
40 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters