-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Lock test dependencies #16283
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
Lock test dependencies #16283
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
test-requirements.txt
Outdated
# This file is autogenerated by pip-compile with Python 3.11 | ||
# by the following command: | ||
# | ||
# pip-compile --output-file=test-requirements.txt --unsafe-package=typed-ast test-requirements.in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need --unsafe-package=typed-ast
part?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mention this in PR description, it's completely arbitrary, passing this results in pip-compile locking setuptools which is desirable since setuptools has caused us CI failures in the past
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose to instead use: --no-strip-extras --generate-hashes --allow-unsafe
--no-strip-extras
silences this warning:
WARNING: --strip-extras is becoming the default in version 8.0.0. To silence this warning, either use --strip-extras to opt into the new default or use --no-strip-extras to retain the existing behavior.
--allow-unsafe
is enough to have these line in lock file:
# The following packages are considered to be unsafe in a requirements file:
setuptools==68.2.2 \
--hash=sha256:4ac1475276d2f1c48684874089fefcd83bd7162ddaafb81fac866ba0db282a87 \
--hash=sha256:b454a35605876da60632df1a60f736524eb73cc47bbc9f3f1ef1b644de74fd2a
# via
# -r r.txt
# nodeenv
- Hashes are just great: less chance of MiM attack, etc
Thanks, I added points one and two. I didn't add hashes, I don't understand what the threat model would be for mypy's dev dependencies and I'm certainly not vetting provenance |
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
This was discussed in the contributor meetup today. This is a simple solution that requires very few changes. If you want to upgrade the lock file, you can pass
--upgrade
or just delete it and regenerate.