-
-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(parser): Fix --discover parsed incorrectly from env #3274
fix(parser): Fix --discover parsed incorrectly from env #3274
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
--discover
flag 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/changelog
folderCloses #3272