@comaniac I’d propose that we don’t include the dev constraints in setup.py (including in any future RFC/PR). This should let you pip install -r python/requirements/dev.txt
without constraining any versions (note the PR does not look like this right now).
I have noticed with Python projects is that pylint/astroid in particular are extremely sensitive to the version and even the cpython version being used. I agree a range of dependencies can sometimes make sense, but for exactly reproducing the CI output locally, I think exact pinning is needed.
Then again, there is another debate to be had as to “what is the process for exactly reproducing the CI?” Arguably, docker/bash.sh tlcpack/ci-lint:ver
is the way to reproduce the CI, and one shouldn’t have high expectations for other procedures. However, you do currently have to download several docker containers (and you actually must have a GPU and nvidia-docker
present locally) even to just try installing dev dependencies with exact versions into a Python venv, and that seems unnecessarily burdensome.
This should be discussed more in a follow-on RFC, but as a preview, my thinking is that when a Docker container version is bumped in Jenkinsfile
, a separate e.g. ci-lint-freeze.txt
should be updated somewhere which records the output of pip freeze
from the container. Then, tools can post-process that to convert the precise pins from pip freeze
into looser constraints according to a package’s versioning policy (e.g. for semver packages, convert ==x.y.z
into ^x.y.z
or ~x.y.z
). These tools can drive Dev Constraints, CI-tested Constraints, or Release Constraints.
Meanwhile, I agree with you that the Tested constraints used in CI should be an exact version. IIUC, currently those constraints are specified in the docker files and the installation scripts, but not as strict as you proposed, of course. Maybe we can just simply make them comprehensive there?
Some discussion is also needed as to how CI containers actually pip install
packages and whether some type of poetry-style locking should be used. And, some discussion is needed around intentionally CI-testing a range of packages to improve our test coverage. Presumably, some separate process is needed to generate a container-wide constraints.txt
, but I believe there’s already some contention as to how much complexity we should incorporate into our container build process. So, let’s discuss this all in the follow-on RFC.