Closed sacsar closed 7 months ago
Note: While the tox
style check passes, flake8
finds errors when run via pre-commit
(including in vulture/core.py
, which I didn't touch). I believe this is flake8
and black
fighting, but I didn't go too far down the rabbit hole and ended up using --no-verify
.
Note: While the
tox
style check passes,flake8
finds errors when run viapre-commit
(including invulture/core.py
, which I didn't touch). I believe this isflake8
andblack
fighting, but I didn't go too far down the rabbit hole and ended up using--no-verify
.
It turns out this isn't a conflict with black
, it's a change in flake8
between Python versions. When I run tox
from a 3.12 virtualenv, the style check fails with:
tests/test_utils.py:146:32: E272 multiple spaces before keyword
vulture/config.py:119:69: E231 missing whitespace after ','
vulture/config.py:120:25: E231 missing whitespace after ','
vulture/config.py:120:30: E231 missing whitespace after ','
vulture/config.py:120:42: E231 missing whitespace after ','
vulture/config.py:130:59: E231 missing whitespace after ','
vulture/config.py:138:71: E231 missing whitespace after ','
vulture/core.py:158:41: E231 missing whitespace after ':'
vulture/core.py:172:50: E231 missing whitespace after ':'
When run from a 3.8 virtualenv, flake8 is happy. I was getting failures only from pre-commit because I had installed pre-commit
from the 3.12 virtualenv and then switched virtualenvs.
It turns out that if you use pyenv
and have pre-commit (or other utilities) installed with a Python it manages, it turns into a pain in the butt, so I ended up installing pre-commit
via pipx
with my system python (3.11.5). It turns out there is a bug in a recent version of flake8 that was fixed in 6.1.0.
tl;dr @jendrikseipp I think the fix is just to bump flake8 in tox.ini
. Do you want a separate PR in the name of a clean changelog or should I just throw it in here?
Thanks for the changes and for looking into the flake8 issue! I'll merge this as is to have a clean history. Would be great if you could send another PR for the flake8 issue.
Description
Fixes #339 -- the toml package does not support heterogenous arrays, which are now allowed in the toml spec. This commit swaps in tomllib from the standard library for Python >= 3.11 and its backport tomli for older versions.
Checklist:
tox -e fix-style
to format my code and checked the result withtox -e style
.