-
Notifications
You must be signed in to change notification settings - Fork 53
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
Update requirements.txt with some version specs #34
Comments
We'd like this library to follow the best practices which have been laid out by the HuggingFace transformers library. Looking at their setup.py, it looks like they only pin the versions on an as-needed basis. My opinion is that if HuggingFace doesn't do this, then it's probably not something we need to adopt for our much-smaller library. If there's a problem that's being caused by the lack of version pinning on our end though, I'm happy to revisit this. |
I had unpinned some versions in #25 . Probably good to unpin more. |
Best practices for python dependencies call for using ranges in your package requirements and pinning versions only in CI jobs. Using pinned versions in, for example, requirements.txt or constraints.txt, allows you to know and advertise exactly what versions have been tested in CI. That information is useful for users and repackagers to understand which versions of dependencies are compatible with more specificity than the ranges provide. Tools like dependabot will submit PRs to automatically update those pins to help you keep up with new releases of all of your dependencies. Pinning to specific versions in the package dependencies in Instead of pinning, use version ranges. This ensures that repackagers and installers have some flexibility in case a dependency of your package has a critical CVE and needs to be updated. Those ranges should include a minimum version, and in some cases a maximum version (a "cap"). Specifying the minimum value for the range ( Specifying a maximum value for the range ( The most effective way I have seen for setting maximum versions is to wait for something to break, then set a cap to exclude the version that causes the breakage until the dependency is fixed or your code is updated to work with the new version of the dependency. Bad releases of dependencies can be excluded using the requirements syntax |
Thank you very much for that in-depth explanation of version pinning best practices @dhellmann ! Then it sounds like what we need to do is:
|
I would add to that list a step separating the package dependencies and the CI dependencies. To do that, you can use pip's |
@RobotSail - is this done? |
@ktam3 I think we ended up not going in this direction due to @dhellmann's advice. But @russellb can specify otherwise here. |
kk, let's close then if that's the case. i'll wait for final confirm though |
@russellb Confirmed that we can close this. |
To assist in keeping dependencies more explicit and consistent across repositories, we should have version numbers specified for each dependency in requirements.txt.
Please see this one as an example: https://github.com/instructlab/instructlab/blob/main/requirements.txt
The text was updated successfully, but these errors were encountered: