-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-29708: allow to force hash-based pycs #5200
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
Conversation
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.
Just a request to expand the documentation and tweak the test to follow what is already there for hash-based .pyc files.
Doc/library/py_compile.rst
Outdated
@@ -71,6 +71,8 @@ byte-code cache files in the directory containing the source code. | |||
|
|||
.. versionchanged:: 3.7 | |||
The *invalidation_mode* parameter was added as specified in :pep:`552`. | |||
If the :envvar:`SOURCE_DATE_EPOCH` environment variable is set, this will | |||
be forced to CHECKED_HASH. |
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.
This should also be mentioned in the main documentation. In other words, if the "version changed" note went away the docs should still cover what they need to cover. So this should say something like "Detecting the :envvar:SOURCE_DATE_EPOCH
environment variable to force CHECKED_HASH
was added."
Lib/test/test_py_compile.py
Outdated
py_compile.compile(self.source_path, self.pyc_path) | ||
self.assertTrue(os.path.exists(self.pyc_path)) | ||
self.assertFalse(os.path.exists(self.cache_path)) | ||
with open(self.pyc_path, "rb") as f: |
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 would look at
cpython/Lib/test/test_py_compile.py
Line 125 in 9f1b7b9
def test_invalidation_mode(self): |
.pyc
files changing.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
I have made the requested changes; please review again. |
Thanks for making the requested changes! @brettcannon: please review the changes made to this pull request. |
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.
Just waiting until Friday to merge to give people enough time to comment on the proposed solution. Otherwise the PR LGTM!
using the well-established SOURCE_DATE_EPOCH environment variable to allow for reproducible builds of python packages. See https://reproducible-builds.org/ for why this is good.
Thanks for your patience with this issue, @bmwiedemann ! |
allow to force hash-based pycs
using the well-established
SOURCE_DATE_EPOCH
environment variableto allow for reproducible builds of python packages.
See https://reproducible-builds.org/ for why this is good.
This implements variant 1 from @brettcannon
note: not tested yet
https://bugs.python.org/issue29708