diff --git a/.github/unused/publish_to_pypi.yml b/.github/unused/publish_to_pypi.yml old mode 100644 new mode 100755 diff --git a/.github/unused/test-unit.yml b/.github/unused/test-unit.yml old mode 100644 new mode 100755 diff --git a/.github/unused/test_pkg.yml b/.github/unused/test_pkg.yml old mode 100644 new mode 100755 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml old mode 100644 new mode 100755 index e324eda..1f155da --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,8 +23,8 @@ jobs: # Windows is not really supported: many tests are skipped on Windows. # But we still run the tests, gradually increasing the number # of windows-compatible tests - os: [ windows-latest, ubuntu-latest, macos-latest ] # , - python-version: [ 3.7, 3.9] # + os: [ ubuntu-latest, macos-latest ] # , windows-latest, + python-version: [ 3.7, '3.10' ] # steps: - uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/CHANGELOG.md b/CHANGELOG.md old mode 100644 new mode 100755 index 2ac2c37..999d1e3 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,24 @@ +# 8.1.2 + +- fixed `PATH` issue on Linux + +# 8.1.1 + +- fixed shell prompt color bug on Linux + # 8.1 -- The `create` and `recreate` commands show more detailed information about the created - virtual environment +- The `create` and `recreate` commands show more detailed information about the + created virtual environment # 8.0 -- The `call` command now supports the `-m` option, that runs the file as a module. +- The `call` command now supports the `-m` option, that runs the file as a + module. # 7.1 -- Fixed: `call` command sometimes received incorrect `$PYTHONPATH` values on systems +- Fixed: `call` command sometimes received incorrect `$PYTHONPATH` values on systems with multiple versions of Python # 7.0 @@ -22,9 +31,9 @@ environment with the same interpreter that started `vien`, instead of the interpreter available as `python3` - Fixed: virtual environments were not cleared (`venv --clear`) before deletion -- Attempting to run the program on Windows will display a message stating that +- Attempting to run the program on Windows will display a message stating that the system is not fully supported - + # 5.0 - Option `--project-dir` aka `-p` is now supported by all commands @@ -32,7 +41,7 @@ # 4.4 -- `call` is now faster as it launches Python directly without spawning an extra +- `call` is now faster as it launches Python directly without spawning an extra shell process # 4.3 @@ -42,8 +51,7 @@ # 4.2 -- Trying to `call` a non-existent file now prints a short error message - instead of an exception +- Trying to `call` a non-existent file now prints a short error message instead of an exception - A message about a nonexistent environment displays a hint on how to create it # 4.1 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 880ecc0..e71a60e --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ [![PyPI version shields.io](https://img.shields.io/pypi/v/vien.svg)](https://pypi.python.org/pypi/vien/) [![Generic badge](https://img.shields.io/badge/Python-3.7+-blue.svg)](#) [![Generic badge](https://img.shields.io/badge/OS-Linux%20|%20macOS-blue.svg)](#) +[![Downloads](https://pepy.tech/badge/vien/month)](https://pepy.tech/project/vien) # [vien](https://github.com/rtmigo/vien_py#readme) @@ -240,6 +241,11 @@ $ /path/to/the/venv/bin/deactivate +call | run +--------------------------------|----------------------------------------------- +Runs only `python file.py` or `python -m module` | Can run any shell command: `pip3`, `cd`, etc. +Starts one python process | Starts two processes: parent shell and child python + # "call" command `vien call PYFILE` executes a `.py` script in the virtual environment. diff --git a/mypy.ini b/mypy.ini old mode 100644 new mode 100755 diff --git a/requirements.txt b/requirements.txt old mode 100644 new mode 100755 diff --git a/setup.py b/setup.py old mode 100644 new mode 100755 index e1fd5cf..65ceba6 --- a/setup.py +++ b/setup.py @@ -52,12 +52,14 @@ def load_module_dict(filename: str) -> dict: "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Environment :: Console", "Typing :: Typed", "Topic :: Software Development :: Build Tools", "Operating System :: POSIX", - #"Operating System :: Microsoft :: Windows" + # "Operating System :: Microsoft :: Windows" ], test_suite="test_unit.suite" ) + diff --git a/tests/__init__.py b/tests/__init__.py old mode 100644 new mode 100755 diff --git a/tests/common.py b/tests/common.py old mode 100644 new mode 100755 diff --git a/tests/test_arg_parser.py b/tests/test_arg_parser.py old mode 100644 new mode 100755 index 13bfd7c..0560dff --- a/tests/test_arg_parser.py +++ b/tests/test_arg_parser.py @@ -5,9 +5,8 @@ from pathlib import Path from typing import List -from vien._common import is_windows - from tests.common import is_posix +from vien._common import is_windows from vien._main import get_project_dir from vien._parsed_args import ParsedArgs, Commands, _iter_after diff --git a/tests/test_bash_runner.py b/tests/test_bash_runner.py old mode 100644 new mode 100755 index 3cf130c..943575e --- a/tests/test_bash_runner.py +++ b/tests/test_bash_runner.py @@ -8,8 +8,8 @@ from timeit import default_timer as timer from tests.common import is_posix -from vien._bash_runner import * from tests.time_limited import TimeLimited +from vien._bash_runner import * @unittest.skipUnless(is_posix, "not POSIX") diff --git a/tests/test_call_funcs.py b/tests/test_call_funcs.py old mode 100644 new mode 100755 diff --git a/tests/test_call_parser.py b/tests/test_call_parser.py old mode 100644 new mode 100755 index 36f3a6f..94d22a4 --- a/tests/test_call_parser.py +++ b/tests/test_call_parser.py @@ -3,9 +3,8 @@ import unittest -from vien._parsed_call import ParsedCall - from vien._exceptions import PyFileArgNotFoundExit +from vien._parsed_call import ParsedCall class TestNew(unittest.TestCase): diff --git a/tests/test_get_project_dir.py b/tests/test_get_project_dir.py old mode 100644 new mode 100755 index 678e1de..4bf1aab --- a/tests/test_get_project_dir.py +++ b/tests/test_get_project_dir.py @@ -7,8 +7,8 @@ from tests.common import is_posix from tests.test_arg_parser import windows_too -from vien._main import get_project_dir from vien._exceptions import PyFileArgNotFoundExit +from vien._main import get_project_dir from vien._parsed_args import ParsedArgs diff --git a/tests/test_main.py b/tests/test_main.py old mode 100644 new mode 100755 index a090a19..6b63918 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -15,16 +15,13 @@ from timeit import default_timer as timer from typing import List, Optional -from tests.test_arg_parser import windows_too -from vien._parsed_args import ParsedArgs - -from vien._common import is_windows - from tests.common import is_posix +from tests.test_arg_parser import windows_too from tests.time_limited import TimeLimited from vien import main_entry_point +from vien._common import is_windows from vien._exceptions import ChildExit, VenvExistsExit, VenvDoesNotExistExit, \ - PyFileNotFoundExit, FailedToCreateVenvExit, CannotFindExecutableExit + PyFileNotFoundExit, CannotFindExecutableExit class CapturedOutput: @@ -84,18 +81,21 @@ def __enter__(self): self.prev_cwd = os.getcwd() self.temp_dir = tempfile.mkdtemp() os.chdir(self.temp_dir) + return self.temp_dir def __exit__(self, exc_type, exc_val, exc_tb): os.chdir(self.prev_cwd) shutil.rmtree(self.temp_dir) +EXPECTED_CREATE_LINES_COUNT = 10 + + class TestsInsideTempProjectDir(unittest.TestCase): def setUp(self): self._old_cwd = Path.cwd() - # №self._td = TemporaryDirectory() self._temp_dir = tempfile.mkdtemp() @@ -148,9 +148,8 @@ def assertInVenv(self, inner: Path): if (os.path.commonpath([outer_str]) != os.path.commonpath( [outer_str, inner_str])): - # if not (len(inner_str) > len(outer_str) - # and inner_str.startswith(outer_str)): - self.fail(f"{inner_str} is not in {outer_str}") + self.fail(f"Path '{inner_str}' is not inside the " + f"venv dir '{outer_str}'") def assertVenvBinExists(self): self.assertTrue( @@ -234,7 +233,8 @@ def test_create_with_argument(self): # actually this is not a good test: we are not testing whether # argument is really used and not ignored self.assertVenvNotExists() - main_entry_point(["create", sys.executable]) + self._run_and_check(["create", sys.executable], expected_exit_code=None, + expected_stdout_lines=EXPECTED_CREATE_LINES_COUNT) self.assertVenvExists() def test_create_fails_with_unresolvable_argument(self): @@ -372,10 +372,43 @@ def test_run_python_version(self): # (was failing with nargs='*', ok with nargs=argparse.REMAINDER) main_entry_point(windows_too(["run", "python3", "--version"])) - def _run_and_check(self, args: List[str], expected_exit_code=0): - with self.assertRaises(ChildExit) as ce: - main_entry_point(args) - self.assertEqual(ce.exception.code, expected_exit_code) + def assertLinesCount(self, txt: str, count: int, string_name=''): + real_count = len(txt.splitlines()) + if real_count != count: + if string_name: + string_name += ' ' + self.fail(f"The {string_name}string contains {real_count} lines " + f"(not {count}):\n" + "=====\n" + f"{txt}" + "\n=====" + ) + + def _run_and_get_stdout(self, args: List[str]) -> str: + with TimeLimited(10): # if the child does not stop, fail own process + with CapturedOutput() as out: + main_entry_point(args) + return out.std + + def _run_and_check(self, + args: List[str], + expected_exit_code: Optional[int] = 0, + expected_stdout_lines: Optional[int] = 0, + expected_stderr_lines: Optional[int] = 0): + with TimeLimited(10): # if the child does not stop, fail own process + with CapturedOutput() as out: + if expected_exit_code is not None: + with self.assertRaises(ChildExit) as ce: + main_entry_point(args) + self.assertEqual(ce.exception.code, expected_exit_code) + else: + main_entry_point(args) # no exceptions expected + + if expected_stdout_lines is not None: + self.assertLinesCount(out.std, expected_stdout_lines, "stdout") + + if expected_stderr_lines is not None: + self.assertLinesCount(out.err, expected_stderr_lines, "stderr") @unittest.skipUnless(is_posix, "not POSIX") def test_run_p(self): @@ -514,7 +547,7 @@ def test_call_parameters(self): main_entry_point(["create"]) - self.write_reporting_program(self.projectDir/"file.py") + self.write_reporting_program(self.projectDir / "file.py") self.assertFalse(self.report_exists) self._run_and_check(["call", "file.py", "hello", "program"]) @@ -523,20 +556,6 @@ def test_call_parameters(self): self.assertEqual(self.reported_argv[-2], "hello") self.assertEqual(self.reported_argv[-1], "program") - - - # main_entry_point(["create"]) - # (self.projectDir / "main.py").write_text( - # f"import sys; exit(len(sys.argv))") - # - # with self.assertRaises(ChildExit) as ce: - # main_entry_point(["call", "main.py"]) - # self.assertEqual(ce.exception.code, 1) # received len(argv) - # - # with self.assertRaises(ChildExit) as ce: - # main_entry_point(["call", "main.py", "aaa", "bbb", "ccc"]) - # self.assertEqual(ce.exception.code, 4) # received len(argv) - def test_call_project_dir_venv(self): """Tests that the -p parameter actually changes the project directory, so the correct virtual environment is found.""" @@ -549,53 +568,50 @@ def test_call_project_dir_venv(self): run_py.write_text("exit(5)") run_py_str = str(run_py.absolute()) - with TemporaryDirectory() as td: - try: - os.chdir(td) - - # NORMAL format - - # this call specifies project dir relative to run.py. - # It runs the file successfully - with self.assertRaises(ChildExit) as ce: - main_entry_point(["-p", "..", "call", run_py_str]) - self.assertEqual(ce.exception.code, 5) - - # this call specifies project dir relative to run.py. - # It runs the file successfully - with self.assertRaises(ChildExit) as ce: - main_entry_point( - ["--project-dir", "..", "call", run_py_str]) - self.assertEqual(ce.exception.code, 5) - - # OUTDATED format - - # this call specifies project dir relative to run.py. - # It runs the file successfully - with self.assertRaises(ChildExit) as ce: - main_entry_point(["call", "-p", "..", run_py_str]) - self.assertEqual(ce.exception.code, 5) - - # this call specifies project dir relative to run.py. - # It runs the file successfully - with self.assertRaises(ChildExit) as ce: - main_entry_point( - ["call", "--project-dir", "..", run_py_str]) - self.assertEqual(ce.exception.code, 5) - - # ERRORS - - # without -p we assume that the current dir is the project dir, - # but the current is temp. So we must get an exception - with self.assertRaises(VenvDoesNotExistExit): - main_entry_point(["call", run_py_str]) - - # this call specifies INCORRECT project dir relative to run.py - with self.assertRaises(VenvDoesNotExistExit): - main_entry_point( - ["call", "--project-dir", "../..", run_py_str]) - finally: - os.chdir(self._old_cwd) # to safely delete the temp dir + with TempCwd(): + # NORMAL format + + # this call specifies project dir relative to run.py. + # It runs the file successfully + with self.assertRaises(ChildExit) as ce: + main_entry_point(["-p", "..", "call", run_py_str]) + self.assertEqual(ce.exception.code, 5) + + # this call specifies project dir relative to run.py. + # It runs the file successfully + with self.assertRaises(ChildExit) as ce: + main_entry_point( + ["--project-dir", "..", "call", run_py_str]) + self.assertEqual(ce.exception.code, 5) + + # OUTDATED format + + # this call specifies project dir relative to run.py. + # It runs the file successfully + with self.assertRaises(ChildExit) as ce: + main_entry_point(["call", "-p", "..", run_py_str]) + self.assertEqual(ce.exception.code, 5) + + # this call specifies project dir relative to run.py. + # It runs the file successfully + with self.assertRaises(ChildExit) as ce: + main_entry_point( + ["call", "--project-dir", "..", run_py_str]) + self.assertEqual(ce.exception.code, 5) + + # ERRORS + + # without -p we assume that the current dir is the project dir, + # but the current is temp. So we must get an exception + with self.assertRaises(VenvDoesNotExistExit): + main_entry_point(["call", run_py_str]) + + # this call specifies INCORRECT project dir relative to run.py + with self.assertRaises(VenvDoesNotExistExit): + main_entry_point( + ["call", "--project-dir", "../..", run_py_str]) + # finally: + # os.chdir(self._old_cwd) # to safely delete the temp dir def test_call_project_dir_relative_imports(self): """ Tests that modules are importable from the project dir @@ -612,14 +628,11 @@ def test_call_project_dir_relative_imports(self): "exit(subpkg.constant.FIFTY_FIVE)") run_py_str = str(run_py.absolute()) - with TemporaryDirectory() as td: - try: - os.chdir(td) - with self.assertRaises(ChildExit) as ce: - main_entry_point(["-p", "..", "call", run_py_str]) - self.assertEqual(ce.exception.code, 55) - finally: - os.chdir(self._old_cwd) # to safely delete the temp dir + with TempCwd(): + self.assertProjectDirIsNotCwd() + with self.assertRaises(ChildExit) as ce: + main_entry_point(["-p", "..", "call", run_py_str]) + self.assertEqual(ce.exception.code, 55) ############################################################################ @@ -634,10 +647,7 @@ def test_shell_p(self): """Checking the -p changes both venv directory and the first item in PYTHONPATH""" main_entry_point(["create"]) - with TemporaryDirectory() as temp_cwd: - # we will run it NOT from the project dir as CWD - os.chdir(temp_cwd) - + with TempCwd() as temp_cwd: # creating .py file to run code_py = Path(temp_cwd) / "code.py" output_file = self.write_reporting_program(code_py) @@ -685,41 +695,54 @@ def test_shell_ok(self): # be run without parameters. start = timer() - with TimeLimited(10): # safety net - with self.assertRaises(ChildExit) as ce: - main_entry_point( - ["shell", "--input", bash_input, "--delay", "1"]) - self.assertFalse(ce.exception.code, 0) + self._run_and_check( + ["shell", "--input", bash_input, "--delay", "1"]) end = timer() self.assertGreater(end - start, 0.5) - self.assertLess(end - start, 3) + self.assertLess(end - start, 5) self.assertTrue(dir_to_create.exists()) - @unittest.skipUnless(is_posix, "not POSIX") + @unittest.skipUnless(is_posix, "features implemented only for POSIX yet") def test_shell_exit_code_non_zero(self): main_entry_point(["create"]) - with TimeLimited(10): # safety net - with self.assertRaises(ChildExit) as ce: - main_entry_point(["shell", "--input", "exit 42"]) - self.assertEqual(ce.exception.code, 42) + self._run_and_check(["shell", "--input", "exit 42"], + expected_exit_code=42) @unittest.skipUnless(is_posix, "not POSIX") def test_shell_exit_code_zero(self): main_entry_point(["create"]) with TimeLimited(10): # safety net - with self.assertRaises(ChildExit) as ce: - main_entry_point(["shell", "--input", "exit"]) - self.assertFalse(ce.exception.code, 0) + self._run_and_check(["shell", "--input", "exit"], + expected_exit_code=0) @unittest.skipUnless(is_posix, "not POSIX") def test_shell_but_no_venv(self): - with TimeLimited(10): # safety net - with self.assertRaises(VenvDoesNotExistExit) as cm: - main_entry_point(["shell"]) + with self.assertRaises(VenvDoesNotExistExit) as cm: + main_entry_point(["shell"]) + self.assertIsErrorExit(cm.exception) + + @unittest.skipUnless(is_posix, "not POSIX") + def test_shell_uses_modified_path(self): + with TemporaryDirectory() as tds: + file_with_path = Path(tds) / "path.txt" + + main_entry_point(["create"]) + try: + main_entry_point( + ["-p", str(self.projectDir.absolute()), + "shell", + "--delay", "3", + "--input", f'echo $PATH > {file_with_path}']) + except ChildExit: + pass + + path = file_with_path.read_text() + self.assertTrue(path.startswith(str(self.expectedVenvDir)), + path) if __name__ == "__main__": suite = unittest.TestSuite() - suite.addTest(TestsInsideTempProjectDir("test_shell_p")) + suite.addTest(TestsInsideTempProjectDir("test_create_with_argument")) unittest.TextTestRunner().run(suite) diff --git a/tests/test_pythonpath.py b/tests/test_pythonpath.py old mode 100644 new mode 100755 diff --git a/tests/test_systems.py b/tests/test_systems.py old mode 100644 new mode 100755 diff --git a/tests/test_vien_dir.py b/tests/test_vien_dir.py old mode 100644 new mode 100755 index ea986a7..51623dd --- a/tests/test_vien_dir.py +++ b/tests/test_vien_dir.py @@ -8,6 +8,7 @@ from tests.common import is_posix from vien._main import get_vien_dir + @unittest.skipUnless(is_posix, "not POSIX") class TestVenvsDir(unittest.TestCase): diff --git a/tests/time_limited.py b/tests/time_limited.py old mode 100644 new mode 100755 diff --git a/todo.txt b/todo.txt old mode 100644 new mode 100755 diff --git a/vien/__init__.py b/vien/__init__.py old mode 100644 new mode 100755 index 05116b8..c268fef --- a/vien/__init__.py +++ b/vien/__init__.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: (c) 2021 Artëm IG # SPDX-License-Identifier: BSD-3-Clause -from ._constants import __version__, __license__, __copyright__ from ._common import is_posix +from ._constants import __version__, __license__, __copyright__ from ._main import main_entry_point - diff --git a/vien/__main__.py b/vien/__main__.py old mode 100644 new mode 100755 diff --git a/vien/_bash_runner.py b/vien/_bash_runner.py old mode 100644 new mode 100755 diff --git a/vien/_call_funcs.py b/vien/_call_funcs.py old mode 100644 new mode 100755 index 80e53c7..ee1bebe --- a/vien/_call_funcs.py +++ b/vien/_call_funcs.py @@ -10,6 +10,7 @@ def relative_fn_to_module_name(filename: str) -> str: if not filename.lower().endswith('.py'): raise ValueError("The filename does not end with '.py'.") filename = filename[:-3] + #print(filename) if '.' in filename: raise ValueError("The filename contains dots.") if os.name == "nt": diff --git a/vien/_cmdexe_escape_args.py b/vien/_cmdexe_escape_args.py old mode 100644 new mode 100755 diff --git a/vien/_colors.py b/vien/_colors.py old mode 100644 new mode 100755 diff --git a/vien/_common.py b/vien/_common.py old mode 100644 new mode 100755 diff --git a/vien/_constants.py b/vien/_constants.py old mode 100644 new mode 100755 index 20e700b..009ef4f --- a/vien/_constants.py +++ b/vien/_constants.py @@ -1,4 +1,3 @@ -__version__ = "8.1.0" -__copyright__ = "(c) 2020-2021 Artëm IG " +__version__ = "8.1.2" +__copyright__ = "(c) 2020-2022 Artëm IG " __license__ = "BSD-3-Clause" - diff --git a/vien/_exceptions.py b/vien/_exceptions.py old mode 100644 new mode 100755 diff --git a/vien/_main.py b/vien/_main.py index 36a2d5d..c7a2b80 100755 --- a/vien/_main.py +++ b/vien/_main.py @@ -3,26 +3,25 @@ from __future__ import annotations -import json import os +import shlex import shutil import subprocess import sys -import shlex from pathlib import Path from typing import * from vien import is_posix -from vien._common import need_posix, is_windows, need_windows -from vien._parsed_args import Commands, ParsedArgs from vien._bash_runner import run_as_bash_script from vien._call_funcs import relative_fn_to_module_name, relative_inner_path -from vien._parsed_call import ParsedCall, list_left_partition -from vien._colors import Colors from vien._cmdexe_escape_args import cmd_escape_arg +from vien._colors import Colors +from vien._common import need_posix, is_windows, need_windows from vien._exceptions import ChildExit, VenvExistsExit, VenvDoesNotExistExit, \ PyFileNotFoundExit, PyFileArgNotFoundExit, FailedToCreateVenvExit, \ FailedToClearVenvExit, CannotFindExecutableExit +from vien._parsed_args import Commands, ParsedArgs +from vien._parsed_call import list_left_partition verbose = False @@ -241,11 +240,15 @@ def guess_bash_ps1(): ['/bin/bash', '-i', '-c', 'echo $PS1']).decode().rstrip() +def _quoted(txt: str) -> str: + # return json.dumps(txt) + return shlex.quote(txt) + + def main_shell(dirs: Dirs, input: Optional[str], input_delay: Optional[float]): dirs.venv_must_exist() - activate_path_quoted = shlex.quote( - str(dirs.venv_dir / "bin" / "activate")) + activate_path_quoted = shlex.quote(str(dirs.venv_dir / "bin" / "activate")) old_ps1 = os.environ.get("PS1") or guess_bash_ps1() @@ -258,18 +261,30 @@ def main_shell(dirs: Dirs, input: Optional[str], input_delay: Optional[float]): venv_name = dirs.project_dir.name new_ps1 = f"{color_start}({venv_name}){color_end}:{old_ps1} " - commands = [f'source {activate_path_quoted}'] + # commands = [f'source {activate_path_quoted}'] bashrc_file = Path(os.path.expanduser("~/.bashrc")) + commands = [] + if bashrc_file.exists(): # Ubuntu + + # There are probably more elegant ways to do this. But here we are + # actually running the same activate script twice: before 'exec bash' + # adn inside the 'exec bash' + + commands.append(f'source {activate_path_quoted}') commands.append( - f"exec bash --rcfile <(cat {json.dumps(str(bashrc_file))} " - f"&& echo 'PS1={json.dumps(new_ps1)}')") + f"exec bash --rcfile <(cat {_quoted(str(bashrc_file))} " + f"&& echo {_quoted(f'PS1={_quoted(new_ps1)}')} " + f"&& source {activate_path_quoted}" + f")") + else: # MacOS - commands.append(f"PS1={json.dumps(new_ps1)} exec bash") + commands.append(f'source {activate_path_quoted}') + commands.append(f"PS1={_quoted(new_ps1)} exec bash") # we will use [input] for testing: we will send a command to the stdin of # the interactive sub-shell and later check whether the command was @@ -398,8 +413,8 @@ def replace_arg(args: List[str], old: str, new: List[str]) -> List[str]: def main_call(parsed: ParsedArgs, dirs: Dirs): dirs.venv_must_exist() - #parsed_call = ParsedCall(parsed.args) - #assert parsed_call.file is not None + # parsed_call = ParsedCall(parsed.args) + # assert parsed_call.file is not None assert parsed.call is not None diff --git a/vien/_parsed_args.py b/vien/_parsed_args.py old mode 100644 new mode 100755 index 31456e9..e8a1f41 --- a/vien/_parsed_args.py +++ b/vien/_parsed_args.py @@ -7,11 +7,9 @@ from enum import Enum from typing import List, Optional, Iterable -from vien._common import is_windows - -from vien import is_posix - import vien +from vien import is_posix +from vien._common import is_windows # from vien.call_parser import items_after from vien._parsed_call import ParsedCall diff --git a/vien/_parsed_call.py b/vien/_parsed_call.py old mode 100644 new mode 100755