canonical/kubeflow-ci

`tox>4` in our current setup breaks `codespell` for many (all?) charm linting

Closed this issue · 3 comments

After tox 4 was released, linting in some(all?) charms has started to fail. An example is here for kfp-api, which had logs:

Run tox -e kfp-api-lint
kfp-api-lint: commands[0]> tox -c charms/kfp-api -e lint --
lint: install_deps /home/runner/work/kfp-operators/kfp-operators/charms/kfp-api> python -I -m pip install black codespell flake8-builtins flake8-copyright flake8-docstrings flake8==[4](https://github.com/canonical/kfp-operators/actions/runs/3652790155/jobs/6171568089#step:4:5).0.1 isort pep8-naming pyproject-flake8
lint: commands[0] /home/runner/work/kfp-operators/kfp-operators/charms/kfp-api> codespell /home/runner/work/kfp-operators/kfp-operators/charms/kfp-api/. --skip /home/runner/work/kfp-operators/kfp-operators/charms/kfp-api/.git --skip /home/runner/work/kfp-operators/kfp-operators/charms/kfp-api/.tox --skip /home/runner/work/kfp-operators/kfp-operators/charms/kfp-api/build --skip /home/runner/work/kfp-operators/kfp-operators/charms/kfp-api/lib --skip /home/runner/work/kfp-operators/kfp-operators/charms/kfp-api/venv --skip /home/runner/work/kfp-operators/kfp-operators/charms/kfp-api/.mypy_cache
/home/runner/work/kfp-operators/kfp-operators/charms/kfp-api/./lib/charms/observability_libs/v0/juju_topology.py:131: harcoding ==> hardcoding
lint: exit 6[5](https://github.com/canonical/kfp-operators/actions/runs/3652790155/jobs/6171568089#step:4:6) (0.18 seconds) /home/runner/work/kfp-operators/kfp-operators/charms/kfp-api> codespell /home/runner/work/kfp-operators/kfp-operators/charms/kfp-api/. --skip /home/runner/work/kfp-operators/kfp-operators/charms/kfp-api/.git --skip /home/runner/work/kfp-operators/kfp-operators/charms/kfp-api/.tox --skip /home/runner/work/kfp-operators/kfp-operators/charms/kfp-api/build --skip /home/runner/work/kfp-operators/kfp-operators/charms/kfp-api/lib --skip /home/runner/work/kfp-operators/kfp-operators/charms/kfp-api/venv --skip /home/runner/work/kfp-operators/kfp-operators/charms/kfp-api/.mypy_cache pid=1[6](https://github.com/canonical/kfp-operators/actions/runs/3652790155/jobs/6171568089#step:4:7)11
  lint: FAIL code 65 (3.36=setup[3.19]+cmd[0.18] seconds)
  evaluation failed :( (3.43 seconds)
kfp-api-lint: exit 65 (3.5[7](https://github.com/canonical/kfp-operators/actions/runs/3652790155/jobs/6171568089#step:4:8) seconds) /home/runner/work/kfp-operators/kfp-operators> tox -c charms/kfp-api -e lint -- pid=1576
  kfp-api-lint: FAIL code 65 (3.[8](https://github.com/canonical/kfp-operators/actions/runs/3652790155/jobs/6171568089#step:4:9)4=setup[0.26]+cmd[3.57] seconds)
  evaluation failed :( (3.[9](https://github.com/canonical/kfp-operators/actions/runs/3652790155/jobs/6171568089#step:4:10)1 seconds)
Error: Process completed with exit code 65.

Testing quickly locally, it might be that somehow an ignorelist for codespell has changed, and we're now checking some out-of-scope items. Not sure how this would have happened.

Until we figure out a real fix, a quick patch would be to pin tox<4 for any linting CI we need to pass

Fix is in my branch #39

specifically, the fix is here, where the file specifications for codespell have changed a little

I consider this solved.