From 7f951071dcc1780c386ea793fadf2e58a62600b6 Mon Sep 17 00:00:00 2001 From: Erica Portnoy Date: Mon, 18 Nov 2019 18:51:12 -0800 Subject: [PATCH] Remove final --pyargs call, and now-unnecessary call to modules instead of local files, since that's fixed by certbot's code being one layer deeper --- tools/install_and_test.py | 15 ++++----------- tools/pip_install.py | 4 ++-- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/tools/install_and_test.py b/tools/install_and_test.py index b5258859a..f8d7a2e3d 100755 --- a/tools/install_and_test.py +++ b/tools/install_and_test.py @@ -9,17 +9,15 @@ from __future__ import print_function import os import sys -import tempfile -import shutil import subprocess import re SKIP_PROJECTS_ON_WINDOWS = ['certbot-apache', 'letshelp-certbot'] -def call_with_print(command, cwd=None): +def call_with_print(command): print(command) - subprocess.check_call(command, shell=True, cwd=cwd or os.getcwd()) + subprocess.check_call(command, shell=True) def main(args): @@ -41,13 +39,8 @@ def main(args): call_with_print(' '.join(current_command)) pkg = re.sub(r'\[\w+\]', '', requirement) - temp_cwd = tempfile.mkdtemp() - shutil.copy2("pytest.ini", temp_cwd) - try: - call_with_print(' '.join([ - sys.executable, '-m', 'pytest', '--pyargs', pkg.replace('-', '_')]), cwd=temp_cwd) - finally: - shutil.rmtree(temp_cwd) + call_with_print(' '.join([ + sys.executable, '-m', 'pytest', pkg])) if __name__ == '__main__': main(sys.argv[1:]) diff --git a/tools/pip_install.py b/tools/pip_install.py index cf0a7aee5..76355a1e6 100755 --- a/tools/pip_install.py +++ b/tools/pip_install.py @@ -69,9 +69,9 @@ def merge_requirements(tools_path, requirements, test_constraints, all_constrain fd.write(merged_requirements) -def call_with_print(command, cwd=None): +def call_with_print(command): print(command) - subprocess.check_call(command, shell=True, cwd=cwd or os.getcwd()) + subprocess.check_call(command, shell=True) def pip_install_with_print(args_str):