fix(parser): Fix --discover parsed incorrectly from env#3274
fix(parser): Fix --discover parsed incorrectly from env#3274gaborbernat merged 4 commits intotox-dev:mainfrom
Conversation
|
@gaborbernat @jugmac00 Right now the changes fix the parsing of the It's important to follow the format described in set-cli-flags-via-environment-variables and separate the list with However, one thing that I countered is either a confusingly worded documentation or another bug with discover:
emphasis by me For me this reads as if To illustrate this (using the same project as in the issue): ✗ tox -q -e py310 --discover /home/martin/micromamba/envs/py310/bin/
py310: SKIP (0.01 seconds)
evaluation failed :( (0.08 seconds) [0,28s]
✗ tox -q -e py310 --discover /home/martin/micromamba/envs/py310/bin/python
========================================================= test session starts ==========================================================
platform linux -- Python 3.10.12, pytest-8.1.1, pluggy-1.5.0
cachedir: .tox/py310/.pytest_cache
rootdir: /home/martin/workspace/ansible-lint-empty-lines-between-tasks
configfile: pyproject.toml
testpaths: test
collected 4 items
test/test_rule.py .... [100%]
========================================================== 4 passed in 1.55s ===========================================================
py310: OK (24.92 seconds)
congratulations :) (24.99 seconds) I propose to rewrite the docs here to be more specific that
What are your thoughts? Should I update the docs? |
|
Yes please. |
6577e99 to
b3b1a07
Compare
The flag was missing the type specification (`of_type`) and thus
parse.get_env_var did not execute the branch for list, but rather for
single variables.
The fallback in Converter led to a call to `list("abc")`, which
resulted int a list of characters (["a", "b", "c"]).
The flag expects a list of python executables, but not paths. Eg `--discover /foo/bar/python` is good, `--discover /foo/bar` or `--discover /foo/bar/` won't work.
b3b1a07 to
7d73641
Compare
|
@gaborbernat this is ready 🙂 |
py38 typehint fixes
This PR fixes the parsing of the
--discoverflag and improves the docs of it to avoid confusion between paths and executables.The flag was missing the type specification (
of_type) and thus parse.get_env_var did not execute the branch for list, but rather for single variables.The fallback in Converter led to a call to
list("abc"), which resulted int a list of characters (["a", "b", "c"]).tox -e fix)docs/changelogfolderCloses #3272