Open carl-baillargeon opened 1 year ago
Couldn't replicate. Please post a full replication (ideally a repo one can clone). Also when we say tox -rvv
we mean all output not just the last 2 lines.
Why is this closed?
tox -c pyproject.toml
ROOT: HandledError| could not recognize config file pyproject.toml
is bad enough there should be a hint what the problem is ... and there seems to be no other issue related to that error message
tox -vv -c pyproject.toml
ROOT: 129 D setup logging to DEBUG on pid 4835 [tox/report.py:221]
ROOT: 169 E HandledError| could not recognize config file pyproject.toml [tox/run.py:23]
@gaborbernat thank you for reopening. I have recently changed my test script to support a few modes of operation:
testing with green
green tests -s 1
testing with unittest
python3 -m unittest discover
testing with tox
tox -e py
i was under the assumption that tox would automatically find out how to test or that a simple addition in pyproject.toml would make this happen. Instead the result is: scripts/test -t ✅:tox ROOT: No tox.ini or setup.cfg or pyproject.toml found, assuming empty tox.ini at .. pyMetaModel
Which is strange since the pyproject.toml is right there ...
Unfortunately i did not find a way to get this working in decent time - after about an hour of search e.g with "tool.tox pyproject.toml" i gave up on how to get this done in a straightforward way. https://tox.wiki/en/3.24.5/config.html is overwhelmingly complex. I just want to get tox do do it's thing for testing - and if there is no default test mode may be hint how to use green or unittest.
I am using https://github.com/WolfgangFahl/pyOpenSourceProjects to standardize and check the setup of my opens source projects. Of the projects below only https://github.com/WolfgangFahl/pyCEURmake has a working tox setup and https://github.com/WolfgangFahl/pyCEURmake/blob/main/pyproject.toml is IMHO ridiculously complex.
checkos -o WolfgangFahl --local
1:✅ 43/43:WolfgangFahl/nicegui_widgets→https://github.com/WolfgangFahl/nicegui_widgets
2:✅ 43/43:WolfgangFahl/py-3rdparty-mediawiki→https://github.com/WolfgangFahl/py-3rdparty-mediawiki
3:✅ 43/43:WolfgangFahl/py-sidif→https://github.com/WolfgangFahl/py-sidif
4:✅ 43/43:WolfgangFahl/py-yprinciple-gen→https://github.com/WolfgangFahl/py-yprinciple-gen
5:✅ 42/42:WolfgangFahl/pyCEURmake→https://github.com/WolfgangFahl/pyCEURmake
6:✅ 43/43:WolfgangFahl/pyLoDStorage→https://github.com/WolfgangFahl/pyLoDStorage
7:✅ 43/43:WolfgangFahl/pymediawikidocker→https://github.com/WolfgangFahl/pymediawikidocker
8:✅ 43/43:WolfgangFahl/pyMetaModel→https://github.com/WolfgangFahl/pyMetaModel
9:✅ 43/43:WolfgangFahl/pyOpenSourceProjects→https://github.com/WolfgangFahl/pyOpenSourceProjects
10:✅ 43/43:WolfgangFahl/pySMWsync→https://github.com/WolfgangFahl/pySMWsync
11:✅ 43/43:WolfgangFahl/pyThunderbird→https://github.com/WolfgangFahl/pyThunderbird
12:✅ 43/43:WolfgangFahl/scan2wiki→https://github.com/WolfgangFahl/scan2wiki
13:✅ 43/43:WolfgangFahl/snapquery→https://github.com/WolfgangFahl/snapquery
Issue
Tox is failing to read config file pyproject.toml even though it is a valid TOML file.
Environment
Provide at least:
Output of
```console Package Version Editable project location ----------------------------------------- ------------ -------------------------------- aio-eapi 0.6.3 annotated-types 0.5.0 anta 0.7.2 /home/cbaillar/git_projects/anta anyio 4.0.0 astroid 2.15.6 asyncssh 2.13.2 Babel 2.12.1 black 23.7.0 bumpver 2023.1126 cachetools 5.3.1 certifi 2023.7.22 cffi 1.15.1 cfgv 3.4.0 chardet 5.2.0 charset-normalizer 3.2.0 click 8.1.7 click-help-colors 0.9.2 colorama 0.4.6 coverage 7.3.1 cryptography 41.0.3 cvprac 1.3.1 dill 0.3.7 distlib 0.3.7 exceptiongroup 1.1.3 filelock 3.12.3 flake8 6.1.0 fontawesome-markdown 0.2.6 ghp-import 2.1.0 gitdb 4.0.10 GitPython 3.1.34 griffe 0.36.1 h11 0.14.0 httpcore 0.16.3 httpx 0.23.3 identify 2.5.27 idna 3.4 iniconfig 2.0.0 isort 5.12.0 Jinja2 3.1.2 lazy-object-proxy 1.9.0 lexid 2021.1006 looseversion 1.3.0 Markdown 3.4.4 markdown-it-py 3.0.0 MarkupSafe 2.1.3 mccabe 0.7.0 mdurl 0.1.2 mergedeep 1.3.4 mike 1.1.2 mkdocs 1.5.2 mkdocs-autorefs 0.5.0 mkdocs-bootswatch 1.1 mkdocs-git-revision-date-localized-plugin 1.2.0 mkdocs-git-revision-date-plugin 0.3.2 mkdocs-material 9.2.8 mkdocs-material-extensions 1.1.1 mkdocstrings 0.23.0 mkdocstrings-python 1.6.2 mypy 1.5.1 mypy-extensions 1.0.0 nodeenv 1.8.0 packaging 23.1 paginate 0.5.6 pathspec 0.11.2 pip 23.2.1 platformdirs 3.10.0 pluggy 1.3.0 pre-commit 3.4.0 pycodestyle 2.11.0 pycparser 2.21 pydantic 2.3.0 pydantic_core 2.6.3 pyflakes 3.1.0 Pygments 2.16.1 pylint 2.17.5 pylint-plugin-utils 0.8.2 pylint-pydantic 0.2.4 pymdown-extensions 10.3 pyproject-api 1.6.1 PySocks 1.7.1 pytest 7.4.1 pytest-asyncio 0.21.1 pytest-cov 4.1.0 pytest-dependency 0.5.1 pytest-html 4.0.0 pytest-metadata 3.0.0 python-dateutil 2.8.2 pytz 2023.3.post1 PyYAML 6.0.1 pyyaml_env_tag 0.1 regex 2023.8.8 requests 2.31.0 rfc3986 1.5.0 rich 13.5.2 ruff 0.0.287 setuptools 68.0.0 six 1.16.0 smmap 5.0.0 sniffio 1.3.0 toml 0.10.2 tomli 2.0.1 tomlkit 0.12.1 tox 4.11.1 types-paramiko 3.3.0.0 types-PyYAML 6.0.12.11 types-requests 2.31.0.2 types-urllib3 1.26.25.14 typing_extensions 4.7.1 urllib3 2.0.4 verspec 0.1.0 virtualenv 20.24.4 watchdog 3.0.0 wheel 0.41.1 wrapt 1.15.0 yamllint 1.32.0 ```pip list
of the host Python, wheretox
is installedOutput of running tox
Output of
```console (.anta) ➜ anta git:(feat/new-tests) ✗ tox -rvv ERROR:root:failed to read config file /home/cbaillar/git_projects/anta/pyproject.toml because Source contains parsing errors: '/home/cbaillar/git_projects/anta/pyproject.toml' [line 16]: ']\n' [line 30]: ']\n' [line 48]: ']\n' [line 75]: ']\n' [line 87]: ']\n' [line 132]: '(\n' [line 133]: '.*data.py|\n' [line 134]: ')\n' [line 135]: '"""\n' [line 180]: ']\n' [line 211]: ']\n' [line 279]: '"""\n' [line 316]: ']\n' ROOT: failed to read config file /home/cbaillar/git_projects/anta/pyproject.toml because Source contains parsing errors: '/home/cbaillar/git_projects/anta/pyproject.toml' [line 16]: ']\n' [line 30]: ']\n' [line 48]: ']\n' [line 75]: ']\n' [line 87]: ']\n' [line 132]: '(\n' [line 133]: '.*data.py|\n' [line 134]: ')\n' [line 135]: '"""\n' [line 180]: ']\n' [line 211]: ']\n' [line 279]: '"""\n' [line 316]: ']\n' ```tox -rvv
Minimal example
We can reproduce the error by having a pyproject.toml file with a special character and carriage return on a line. See the example below.