-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add check for pre-release requirements versions #25
Comments
Right now there is an option |
I think my use case is a little different. I was thinking more like adding a new warning code This would allow me to validate that the requirements.txt file only contains non-prerelease version numbers for pinned versions.
Is this sort of detection even possible for a flake8 checker? |
Ooo, I see now. I think that it might be possible, but the warning will be next to the import line (in the *py file), not in the requirements.txt. Will that be OK for you? Attaching warning to other files than *py is rather problematic. My idea for I901 was to print these warning at the end of the flake8 run (not attached to any file). However, I901 is not implemented yet... to be honest I'm not sure how to do it without BIG performance issue. Anyway, I902 will be easier to implement. |
Yes that sounds good to me. It would also detect prerelease requirements from setup.py and poetry too? |
Yes, it should work for requirements from these locations as well. But firstly I have to properly implement requirements.txt parser, because right now only name is read. It might take some time, because I have to share my spare time between many online and offline activities :D But stay tuned, I'll try to implement it sooner or later. |
It would be nice to have a linting check for pre-release requirements versions. This would be useful in a CI scenario to ensure that a pull request from a feature branch to develop/master branch does not contain any pre-release requirements in setup.py, requirements.txt, etc.
https://packaging.pypa.io/en/latest/version.html#packaging.version.Version.is_prerelease would be useful for this.
The text was updated successfully, but these errors were encountered: