tox icon indicating copy to clipboard operation
tox copied to clipboard

Folder support for -c

Open dvarrazzo opened this issue 3 years ago • 3 comments

Hello,

I am giving a spin to tox 4.0.0b1 on the psycopg 3 project.

Using tox 3, you can run tests using tox -c psycopg -s.

On tox4, the first error encountered is that the argument of -c cannot be a directory. That's fair: I can see that the help of tox 3 also says that it must be a config file, although it works specifying with a dir (akin to make -C, git -C, tar -C...). However the error is reported as a traceback:

(.venv) piro@baloo:~/dev/psycopg3$ tox4 -c psycopg -s
Traceback (most recent call last):
  File "/home/piro/dev/psycopg3/.venv/bin/tox4", line 8, in <module>
    sys.exit(run())
  File "/home/piro/dev/psycopg3/.venv/lib/python3.8/site-packages/tox/run.py", line 18, in run
...
  File "/usr/lib/python3.8/pathlib.py", line 1222, in open
    return io.open(self, mode, buffering, encoding, errors, newline,
IsADirectoryError: [Errno 21] Is a directory: 'psycopg'

If this is an user error, probably a clean error message rather than a traceback would be more appropriate (and correctly placing the blame on the user :).

However, once the command line is fixed, a traceback occurs:

(.venv) piro@baloo:~/dev/psycopg3$ tox4 -c psycopg/tox.ini -e 3.8
3.8: internal error
Traceback (most recent call last):
  File "/home/piro/dev/psycopg3/.venv/lib/python3.8/site-packages/packaging/requirements.py", line 102, in __init__
    req = REQUIREMENT.parseString(requirement_string)
  File "/home/piro/dev/psycopg3/.venv/lib/python3.8/site-packages/pyparsing/core.py", line 1127, in parse_string
    raise exc.with_traceback(None)
pyparsing.exceptions.ParseException: Expected string_end, found '/'  (at char 7), (line:1, col:8)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/piro/dev/psycopg3/.venv/lib/python3.8/site-packages/tox/tox_env/python/pip/req/file.py", line 37, in __init__
    self._requirement: Requirement | Path | str = Requirement(req)
  File "/home/piro/dev/psycopg3/.venv/lib/python3.8/site-packages/packaging/requirements.py", line 104, in __init__
    raise InvalidRequirement(
packaging.requirements.InvalidRequirement: Parse error at "'/../psyc'": Expected string_end

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/piro/dev/psycopg3/.venv/lib/python3.8/site-packages/tox/tox_env/python/pip/pip_install.py", line 93, in _install_requirement_file
    new_options, new_reqs = arguments.unroll()
  File "/home/piro/dev/psycopg3/.venv/lib/python3.8/site-packages/tox/tox_env/python/pip/req_file.py", line 73, in unroll
    opts_dict = vars(self.options)
  File "/home/piro/dev/psycopg3/.venv/lib/python3.8/site-packages/tox/tox_env/python/pip/req/file.py", line 148, in options
    self._ensure_requirements_parsed()
  File "/home/piro/dev/psycopg3/.venv/lib/python3.8/site-packages/tox/tox_env/python/pip/req/file.py", line 164, in _ensure_requirements_parsed
    self._requirements = self._parse_requirements(opt=self._opt, recurse=True)
  File "/home/piro/dev/psycopg3/.venv/lib/python3.8/site-packages/tox/tox_env/python/pip/req/file.py", line 170, in _parse_requirements
    parsed_req = self._handle_requirement_line(parsed_line)
  File "/home/piro/dev/psycopg3/.venv/lib/python3.8/site-packages/tox/tox_env/python/pip/req/file.py", line 274, in _handle_requirement_line
    return ParsedRequirement(line.requirement, req_options, line.filename, line.lineno)
  File "/home/piro/dev/psycopg3/.venv/lib/python3.8/site-packages/tox/tox_env/python/pip/req/file.py", line 60, in __init__
    rel_path = str(path.resolve().relative_to(root))
  File "/usr/lib/python3.8/pathlib.py", line 908, in relative_to
    raise ValueError("{!r} does not start with {!r}"
ValueError: '/home/piro/dev/psycopg3/psycopg/psycopg_pool' does not start with 'psycopg'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/piro/dev/psycopg3/.venv/lib/python3.8/site-packages/tox/session/cmd/run/single.py", line 45, in _evaluate
    tox_env.setup()
  File "/home/piro/dev/psycopg3/.venv/lib/python3.8/site-packages/tox/tox_env/api.py", line 226, in setup
    self._setup_env()
  File "/home/piro/dev/psycopg3/.venv/lib/python3.8/site-packages/tox/tox_env/python/runner.py", line 91, in _setup_env
    self._install_deps()
  File "/home/piro/dev/psycopg3/.venv/lib/python3.8/site-packages/tox/tox_env/python/runner.py", line 95, in _install_deps
    self.installer.install(requirements_file, PythonRun.__name__, "deps")
  File "/home/piro/dev/psycopg3/.venv/lib/python3.8/site-packages/tox/tox_env/python/pip/pip_install.py", line 84, in install
    self._install_requirement_file(arguments, section, of_type)
  File "/home/piro/dev/psycopg3/.venv/lib/python3.8/site-packages/tox/tox_env/python/pip/pip_install.py", line 95, in _install_requirement_file
    raise HandledError(f"{exception} for tox env py within deps")
tox.report.HandledError: '/home/piro/dev/psycopg3/psycopg/psycopg_pool' does not start with 'psycopg' for tox env py within deps
  3.8: FAIL code 2 (0.06 seconds)
  evaluation failed :( (0.13 seconds)

a similar error happens just running tox in the psycopg directory of the project.

I assume you have enough material to reproduce the issue. If you need more info let me know. Thank you very much!

dvarrazzo avatar Feb 06 '22 23:02 dvarrazzo

That's fair: I can see that the help of tox 3 also says that it must be a config file

Sorry, no, I was wrong on that:

(.venv) piro@baloo:~/dev/psycopg3/psycopg$ pip install -U 'tox<4'
...
Successfully installed tox-3.24.5

(.venv) piro@baloo:~/dev/psycopg3/psycopg$ tox --help | grep -- ' -c'
  -c CONFIGFILE                    config file name or directory with 'tox.ini' file. (default: None)

-c could be a directory, previously. No more in tox 4

(.venv) piro@baloo:~/dev/psycopg3/psycopg$ pip install tox==4.0.0b1
...
Successfully installed tox-4.0.0b1
(.venv) piro@baloo:~/dev/psycopg3/psycopg$ tox4 --help | grep -- ' -c'
  -c file, --conf file        configuration file for tox (if not specified will discover one) (default: None)

It seems the loss of a familiar feature and seems strange that it cannot indicate "autodiscover from there". I assume you have your reasons.

dvarrazzo avatar Feb 06 '22 23:02 dvarrazzo

Full traceback...

$ tox4 -rvv -e py38 -c psycopg/tox.ini 
py38: 353 W remove tox env folder psycopg/.tox/4/py38 [tox/tox_env/api.py:292]
py38: 371 I find interpreter for spec PythonSpec(implementation=CPython, major=3, minor=8) [virtualenv/discovery/builtin.py:62]
py38: 371 D discover exe for PythonInfo(spec=CPython3.8.10.final.0-64, exe=/home/jugmac00/opt/tox4/bin/python, platform=linux, version='3.8.10 (default, Nov 26 2021, 20:14:08) \n[GCC 9.3.0]', encoding_fs_io=utf-8-utf-8) in /usr [virtualenv/discovery/py_info.py:403]
py38: 372 D filesystem is case-sensitive [virtualenv/info.py:29]
py38: 373 D Attempting to acquire lock 140570390002752 on /home/jugmac00/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.lock [filelock/_api.py:168]
py38: 373 D Lock 140570390002752 acquired on /home/jugmac00/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.lock [filelock/_api.py:172]
py38: 373 D got python info of /usr/bin/python3.8 from /home/jugmac00/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.json [virtualenv/app_data/via_disk_folder.py:135]
py38: 374 D Attempting to release lock 140570390002752 on /home/jugmac00/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.lock [filelock/_api.py:202]
py38: 375 D Lock 140570390002752 released on /home/jugmac00/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.lock [filelock/_api.py:205]
py38: 375 I proposed PythonInfo(spec=CPython3.8.10.final.0-64, system=/usr/bin/python3.8, exe=/home/jugmac00/opt/tox4/bin/python, platform=linux, version='3.8.10 (default, Nov 26 2021, 20:14:08) \n[GCC 9.3.0]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:69]
py38: 375 D accepted PythonInfo(spec=CPython3.8.10.final.0-64, system=/usr/bin/python3.8, exe=/home/jugmac00/opt/tox4/bin/python, platform=linux, version='3.8.10 (default, Nov 26 2021, 20:14:08) \n[GCC 9.3.0]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:71]
py38: 412 I create virtual environment via CPython3Posix(dest=/home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38, clear=False, no_vcs_ignore=False, global=False) [virtualenv/run/session.py:52]
py38: 412 D create folder /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/bin [virtualenv/util/path/_sync.py:24]
py38: 412 D create folder /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/lib/python3.8/site-packages [virtualenv/util/path/_sync.py:24]
py38: 412 D write /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:34]
py38: 412 D 	home = /usr [virtualenv/create/pyenv_cfg.py:38]
py38: 412 D 	implementation = CPython [virtualenv/create/pyenv_cfg.py:38]
py38: 412 D 	version_info = 3.8.10.final.0 [virtualenv/create/pyenv_cfg.py:38]
py38: 412 D 	virtualenv = 20.13.0 [virtualenv/create/pyenv_cfg.py:38]
py38: 413 D 	include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:38]
py38: 413 D 	base-prefix = /usr [virtualenv/create/pyenv_cfg.py:38]
py38: 413 D 	base-exec-prefix = /usr [virtualenv/create/pyenv_cfg.py:38]
py38: 413 D 	base-executable = /usr/bin/python3.8 [virtualenv/create/pyenv_cfg.py:38]
py38: 413 D symlink /usr/bin/python3.8 to /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/bin/python [virtualenv/util/path/_sync.py:43]
py38: 413 D create virtualenv import hook file /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/lib/python3.8/site-packages/_virtualenv.pth [virtualenv/create/via_global_ref/api.py:95]
py38: 413 D create /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/lib/python3.8/site-packages/_virtualenv.py [virtualenv/create/via_global_ref/api.py:98]
py38: 414 D ============================== target debug ============================== [virtualenv/run/session.py:54]
py38: 414 D debug via /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/bin/python /home/jugmac00/opt/tox4/lib/python3.8/site-packages/virtualenv/create/debug.py [virtualenv/create/creator.py:224]
py38: 414 D {
  "sys": {
    "executable": "/home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/bin/python",
    "_base_executable": "/home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/bin/python",
    "prefix": "/home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38",
    "base_prefix": "/usr",
    "real_prefix": null,
    "exec_prefix": "/home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38",
    "base_exec_prefix": "/usr",
    "path": [
      "/usr/lib/python38.zip",
      "/usr/lib/python3.8",
      "/usr/lib/python3.8/lib-dynload",
      "/home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/lib/python3.8/site-packages"
    ],
    "meta_path": [
      "<class '_virtualenv._Finder'>",
      "<class '_frozen_importlib.BuiltinImporter'>",
      "<class '_frozen_importlib.FrozenImporter'>",
      "<class '_frozen_importlib_external.PathFinder'>"
    ],
    "fs_encoding": "utf-8",
    "io_encoding": "utf-8"
  },
  "version": "3.8.10 (default, Nov 26 2021, 20:14:08) \n[GCC 9.3.0]",
  "makefile_filename": "/usr/lib/python3.8/config-3.8-x86_64-linux-gnu/Makefile",
  "os": "<module 'os' from '/usr/lib/python3.8/os.py'>",
  "site": "<module 'site' from '/usr/lib/python3.8/site.py'>",
  "datetime": "<module 'datetime' from '/usr/lib/python3.8/datetime.py'>",
  "math": "<module 'math' (built-in)>",
  "json": "<module 'json' from '/usr/lib/python3.8/json/__init__.py'>"
} [virtualenv/run/session.py:55]
py38: 462 I add seed packages via FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/jugmac00/.local/share/virtualenv) [virtualenv/run/session.py:59]
py38: 466 D got embed update of distribution wheel from /home/jugmac00/.local/share/virtualenv/wheel/3.8/embed/3/wheel.json [virtualenv/app_data/via_disk_folder.py:135]
py38: 467 D got embed update of distribution setuptools from /home/jugmac00/.local/share/virtualenv/wheel/3.8/embed/3/setuptools.json [virtualenv/app_data/via_disk_folder.py:135]
py38: 467 D got embed update of distribution pip from /home/jugmac00/.local/share/virtualenv/wheel/3.8/embed/3/pip.json [virtualenv/app_data/via_disk_folder.py:135]
py38: 470 D using periodically updated wheel /home/jugmac00/.local/share/virtualenv/wheel/house/setuptools-60.5.0-py3-none-any.whl [virtualenv/seed/wheels/periodic_update.py:53]
py38: 471 D install wheel from wheel /home/jugmac00/opt/tox4/lib/python3.8/site-packages/virtualenv/seed/wheels/embed/wheel-0.37.1-py2.py3-none-any.whl via CopyPipInstall [virtualenv/seed/embed/via_app_data/via_app_data.py:49]
py38: 471 D install pip from wheel /home/jugmac00/opt/tox4/lib/python3.8/site-packages/virtualenv/seed/wheels/embed/pip-21.3.1-py3-none-any.whl via CopyPipInstall [virtualenv/seed/embed/via_app_data/via_app_data.py:49]
py38: 471 D Attempting to acquire lock 140570388573344 on /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.37.1-py2.py3-none-any.lock [filelock/_api.py:168]
py38: 471 D install setuptools from wheel /home/jugmac00/.local/share/virtualenv/wheel/house/setuptools-60.5.0-py3-none-any.whl via CopyPipInstall [virtualenv/seed/embed/via_app_data/via_app_data.py:49]
py38: 472 D Attempting to acquire lock 140570388573296 on /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-21.3.1-py3-none-any.lock [filelock/_api.py:168]
py38: 472 D Lock 140570388573344 acquired on /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.37.1-py2.py3-none-any.lock [filelock/_api.py:172]
py38: 472 D Attempting to acquire lock 140570388572528 on /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-60.5.0-py3-none-any.lock [filelock/_api.py:168]
py38: 472 D Lock 140570388573296 acquired on /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-21.3.1-py3-none-any.lock [filelock/_api.py:172]
py38: 472 D Lock 140570388572528 acquired on /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-60.5.0-py3-none-any.lock [filelock/_api.py:172]
py38: 472 D Attempting to release lock 140570388573344 on /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.37.1-py2.py3-none-any.lock [filelock/_api.py:202]
py38: 472 D Lock 140570388573344 released on /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.37.1-py2.py3-none-any.lock [filelock/_api.py:205]
py38: 472 D Attempting to release lock 140570388573296 on /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-21.3.1-py3-none-any.lock [filelock/_api.py:202]
py38: 472 D Lock 140570388573296 released on /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-21.3.1-py3-none-any.lock [filelock/_api.py:205]
py38: 473 D Attempting to release lock 140570388572528 on /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-60.5.0-py3-none-any.lock [filelock/_api.py:202]
py38: 473 D Lock 140570388572528 released on /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-60.5.0-py3-none-any.lock [filelock/_api.py:205]
py38: 473 D copy directory /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-21.3.1-py3-none-any/pip to /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/lib/python3.8/site-packages/pip [virtualenv/util/path/_sync.py:51]
py38: 473 D copy /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.37.1-py2.py3-none-any/wheel-0.37.1.virtualenv to /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/lib/python3.8/site-packages/wheel-0.37.1.virtualenv [virtualenv/util/path/_sync.py:51]
py38: 473 D copy /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-60.5.0-py3-none-any/setuptools-60.5.0.virtualenv to /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/lib/python3.8/site-packages/setuptools-60.5.0.virtualenv [virtualenv/util/path/_sync.py:51]
py38: 474 D copy directory /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.37.1-py2.py3-none-any/wheel to /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/lib/python3.8/site-packages/wheel [virtualenv/util/path/_sync.py:51]
py38: 474 D copy /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-60.5.0-py3-none-any/distutils-precedence.pth to /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/lib/python3.8/site-packages/distutils-precedence.pth [virtualenv/util/path/_sync.py:51]
py38: 474 D copy directory /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-60.5.0-py3-none-any/setuptools-60.5.0.dist-info to /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/lib/python3.8/site-packages/setuptools-60.5.0.dist-info [virtualenv/util/path/_sync.py:51]
py38: 477 D copy directory /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-60.5.0-py3-none-any/pkg_resources to /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/lib/python3.8/site-packages/pkg_resources [virtualenv/util/path/_sync.py:51]
py38: 481 D copy directory /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.37.1-py2.py3-none-any/wheel-0.37.1.dist-info to /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/lib/python3.8/site-packages/wheel-0.37.1.dist-info [virtualenv/util/path/_sync.py:51]
py38: 484 D changing mode of /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/bin/wheel to 775 [distlib/util.py:572]
py38: 484 D changing mode of /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/bin/wheel3 to 775 [distlib/util.py:572]
py38: 485 D changing mode of /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/bin/wheel-3.8 to 775 [distlib/util.py:572]
py38: 485 D copy directory /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-60.5.0-py3-none-any/_distutils_hack to /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/lib/python3.8/site-packages/_distutils_hack [virtualenv/util/path/_sync.py:51]
py38: 485 D changing mode of /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/bin/wheel3.8 to 775 [distlib/util.py:572]
py38: 485 D generated console scripts wheel wheel-3.8 wheel3.8 wheel3 [virtualenv/seed/embed/via_app_data/pip_install/base.py:45]
py38: 486 D copy directory /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-60.5.0-py3-none-any/setuptools to /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/lib/python3.8/site-packages/setuptools [virtualenv/util/path/_sync.py:51]
py38: 507 D generated console scripts  [virtualenv/seed/embed/via_app_data/pip_install/base.py:45]
py38: 530 D copy directory /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-21.3.1-py3-none-any/pip-21.3.1.dist-info to /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/lib/python3.8/site-packages/pip-21.3.1.dist-info [virtualenv/util/path/_sync.py:51]
py38: 531 D copy /home/jugmac00/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-21.3.1-py3-none-any/pip-21.3.1.virtualenv to /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/lib/python3.8/site-packages/pip-21.3.1.virtualenv [virtualenv/util/path/_sync.py:51]
py38: 532 D changing mode of /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/bin/pip-3.8 to 775 [distlib/util.py:572]
py38: 532 D changing mode of /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/bin/pip3.8 to 775 [distlib/util.py:572]
py38: 532 D changing mode of /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/bin/pip3 to 775 [distlib/util.py:572]
py38: 532 D changing mode of /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/bin/pip to 775 [distlib/util.py:572]
py38: 532 D generated console scripts pip3.8 pip3 pip pip-3.8 [virtualenv/seed/embed/via_app_data/pip_install/base.py:45]
py38: 532 I add activators for Bash, CShell, Fish, Nushell, PowerShell, Python [virtualenv/run/session.py:64]
py38: 533 D write /home/jugmac00/Projects/psycopg/psycopg/.tox/4/py38/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:34]
py38: 533 D 	home = /usr [virtualenv/create/pyenv_cfg.py:38]
py38: 533 D 	implementation = CPython [virtualenv/create/pyenv_cfg.py:38]
py38: 533 D 	version_info = 3.8.10.final.0 [virtualenv/create/pyenv_cfg.py:38]
py38: 533 D 	virtualenv = 20.13.0 [virtualenv/create/pyenv_cfg.py:38]
py38: 534 D 	include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:38]
py38: 534 D 	base-prefix = /usr [virtualenv/create/pyenv_cfg.py:38]
py38: 534 D 	base-exec-prefix = /usr [virtualenv/create/pyenv_cfg.py:38]
py38: 534 D 	base-executable = /usr/bin/python3.8 [virtualenv/create/pyenv_cfg.py:38]
py38: 536 E internal error [tox/session/cmd/run/single.py:57]
Traceback (most recent call last):
  File "/home/jugmac00/opt/tox4/lib/python3.8/site-packages/packaging/requirements.py", line 102, in __init__
    req = REQUIREMENT.parseString(requirement_string)
  File "/home/jugmac00/opt/tox4/lib/python3.8/site-packages/pyparsing/core.py", line 1127, in parse_string
    raise exc.with_traceback(None)
pyparsing.exceptions.ParseException: Expected string_end, found '/'  (at char 7), (line:1, col:8)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jugmac00/opt/tox4/lib/python3.8/site-packages/tox/tox_env/python/pip/req/file.py", line 37, in __init__
    self._requirement: Requirement | Path | str = Requirement(req)
  File "/home/jugmac00/opt/tox4/lib/python3.8/site-packages/packaging/requirements.py", line 104, in __init__
    raise InvalidRequirement(
packaging.requirements.InvalidRequirement: Parse error at "'/../psyc'": Expected string_end

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jugmac00/opt/tox4/lib/python3.8/site-packages/tox/tox_env/python/pip/pip_install.py", line 93, in _install_requirement_file
    new_options, new_reqs = arguments.unroll()
  File "/home/jugmac00/opt/tox4/lib/python3.8/site-packages/tox/tox_env/python/pip/req_file.py", line 73, in unroll
    opts_dict = vars(self.options)
  File "/home/jugmac00/opt/tox4/lib/python3.8/site-packages/tox/tox_env/python/pip/req/file.py", line 148, in options
    self._ensure_requirements_parsed()
  File "/home/jugmac00/opt/tox4/lib/python3.8/site-packages/tox/tox_env/python/pip/req/file.py", line 164, in _ensure_requirements_parsed
    self._requirements = self._parse_requirements(opt=self._opt, recurse=True)
  File "/home/jugmac00/opt/tox4/lib/python3.8/site-packages/tox/tox_env/python/pip/req/file.py", line 170, in _parse_requirements
    parsed_req = self._handle_requirement_line(parsed_line)
  File "/home/jugmac00/opt/tox4/lib/python3.8/site-packages/tox/tox_env/python/pip/req/file.py", line 274, in _handle_requirement_line
    return ParsedRequirement(line.requirement, req_options, line.filename, line.lineno)
  File "/home/jugmac00/opt/tox4/lib/python3.8/site-packages/tox/tox_env/python/pip/req/file.py", line 60, in __init__
    rel_path = str(path.resolve().relative_to(root))
  File "/usr/lib/python3.8/pathlib.py", line 908, in relative_to
    raise ValueError("{!r} does not start with {!r}"
ValueError: '/home/jugmac00/Projects/psycopg/psycopg/psycopg_pool' does not start with 'psycopg'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jugmac00/opt/tox4/lib/python3.8/site-packages/tox/session/cmd/run/single.py", line 45, in _evaluate
    tox_env.setup()
  File "/home/jugmac00/opt/tox4/lib/python3.8/site-packages/tox/tox_env/api.py", line 226, in setup
    self._setup_env()
  File "/home/jugmac00/opt/tox4/lib/python3.8/site-packages/tox/tox_env/python/runner.py", line 91, in _setup_env
    self._install_deps()
  File "/home/jugmac00/opt/tox4/lib/python3.8/site-packages/tox/tox_env/python/runner.py", line 95, in _install_deps
    self.installer.install(requirements_file, PythonRun.__name__, "deps")
  File "/home/jugmac00/opt/tox4/lib/python3.8/site-packages/tox/tox_env/python/pip/pip_install.py", line 84, in install
    self._install_requirement_file(arguments, section, of_type)
  File "/home/jugmac00/opt/tox4/lib/python3.8/site-packages/tox/tox_env/python/pip/pip_install.py", line 95, in _install_requirement_file
    raise HandledError(f"{exception} for tox env py within deps")
tox.report.HandledError: '/home/jugmac00/Projects/psycopg/psycopg/psycopg_pool' does not start with 'psycopg' for tox env py within deps
  py38: FAIL code 2 (0.19 seconds)
  evaluation failed :( (0.31 seconds)

jugmac00 avatar Feb 07 '22 07:02 jugmac00

Kept this one for adding folder support for -c, and moved the requirements parse error to https://github.com/tox-dev/tox/issues/2353

gaborbernat avatar Feb 10 '22 19:02 gaborbernat