Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locking requirements for CI #653

Open
tillahoffmann opened this issue Feb 13, 2023 · 4 comments
Open

Locking requirements for CI #653

tillahoffmann opened this issue Feb 13, 2023 · 4 comments

Comments

@tillahoffmann
Copy link
Contributor

The CI pipeline currently installs requirements from requirements.txt, requirements-test.txt, and requirements-optional.txt. These files list semantic requirements, e.g., numpy, but don't "lock" the specific version, e.g., numpy==x.y.z. During testing, this can lead to unexpected failures caused by changes in underlying packages rather than changes related to the code in this repository.

For example, this run succeeded with pylint==2.15.10, but this run failed with pylint==2.16.2. This was due to the change pylint-dev/pylint#7690 released with pylint 2.16.0.

Keeping the requirements semantic for the actual package, but locking the requirements for CI for reproducible builds has worked well for me in the past. I'm happy to send a PR if this is of interest but wanted to check with you before making any changes.

@WardBrian
Copy link
Member

I think Pylint is the only requirement I would personally consider locking, because it's

  1. Mostly stylistic
  2. Very annoying when it changes

If something like mypy updates and detects new type errors, we probably actually do want to know about those (to my knowledge this has basically never happened in our repo). Similarly for things like numpy

@tillahoffmann
Copy link
Contributor Author

That seems fair.

I've been locking dependencies and then periodically updated the lock file. If the build for the commit that updates the lock file fails, I know that it is a dependency that is the underlying cause (rather than some other non-deterministic culprit). E.g., testcontainers/testcontainers-python#274. But that may be overkill, and locking pylint gets the job done.

@WardBrian
Copy link
Member

Do you know if we could have that periodic update be automated (e.g. by something like dependabot)?

If we could have something which runs on the first of the month and updates that lock file it would be feasible to lock all the test dependencies, I think.

@tillahoffmann
Copy link
Contributor Author

Yes, that should be possible with https://github.com/marketplace/actions/create-pull-request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants