Closed surovic closed 10 months ago
The linting multiple python versions was a legacy thing that I kept because we were already implicitly doing it! I don't think it added any value. Thanks! ✅
We should probably still run tests with a couple Python versions though just in case.
We should probably still run tests with a couple Python versions though just in case.
Hmm, should we really? We essentially dictate the python version in the docker image build.
We should probably still run tests with a couple Python versions though just in case.
Hmm, should we really? We essentially dictate the python version in the docker image build.
My reasoning here is that we have in the past allowed the use of different Python versions with Polytracker. If someone out there is using it with a prior Python version, it would be good to not arbitrarily take that support away from them. However, we only support Polytracker usage in the container, to the best of my knowledge, and as long as we're clear there's one true way to run Polytracker in the README, I don't see any reason to continue running builds or tests under any Pythons other than the Python version we prefer to build and run with.
Trunk is a superlinter that supports both local and CI linting and source formatting tasks. AFAIK it supports all the languages and markups that we use. The PR migrates all of our linter configuration to be compatible with trunk and also replaces
flake8
withruff
as it subsumes it and is more performant.The one caveat is that we now effectively only lint
python v3.8
.mypy
is set to that version andruff
will only lint issues and suggest fixes that are compatible withpython 3.8.
and up.The linters also only check changed code for issues. This means developers should not be harassed about issues they didn't cause.
The last side-effect of this PR is that the top level
Makefile
has been rewritten and now supports:make lint
- locally runstrunk check
, which is equivalent to the CI linting workflow.make format
- locally runstrunk fmt
, which formats changes made in the repo.make docker
- build thetrailofbits/polytracker
docker image.make test
- runs thepytest /polytracker/tests
command intrailofbits/polytracker
docker image container.make clean
- deletes alltrailofbits/polytracker*
docker images.