talkiq / circleci-orbs

Various CircleCI orbs shared across TalkIQ projects
2 stars 4 forks source link

fix(linter): support PEP668 #132

Closed TheKevJames closed 7 months ago

TheKevJames commented 8 months ago

Summary

BREAKING CHANGE!

With PEP668, global package installations are no longer possible, even in something like docker where an additional layer of virtualenvs is entirely meaningless. As such, we need to overhaul this orb to install pre-commit in a venv, which in turn means alpine-based executors need shell/env overrides and a single command for "install and run pre-commit" is not really doable anymore: there are too many different possible base images to account for them all.

Definitely open to any suggestions, especially on:

Standard Checklist

shaundialpad commented 7 months ago

Just tossing this out there - what if we installed pre-commit for each project as an optional dependency? Similar to what we do for docs. So we would then poetry run pre-commit run --all-files etc. Haven't really thought out the consequences of that yet but...

TheKevJames commented 7 months ago

@shaundialpad interesting idea, though it might come with some unfortunate downsides since all gorups need to be resolved together -- eg. if pre-commit relies on any dependencies we also use, it might resolve to different (older) versions.

Definitely something to consider, though! It might be that could also help with eg. the mypy additional_dependencies stuff that we need to keep in sync semi-manually. If there's a decent way to inherit the venv, it could be life gets a bit simpler there...