bpo-29514: Check magic number for bugfix release#54
Conversation
Add a dict importlib.util.EXPECTED_MAGIC_NUMBERS which details the initial and expected pyc magic number for each minor release. This gives a mechanism for users to check if the magic number has changed within a release and for a test to ensure procedure is followed if a change is necessary. Add a test to check the current MAGIC_NUMBER against the expected number for the release if the current release is at candidate or final level. On test failure, describe to the developer the procedure for changing the magic number.
ncoghlan
left a comment
There was a problem hiding this comment.
The general approach in the test case looks like it will give affected maintainers useful guidance, but the impact can be reduced by moving the EXPECTED_MAGIC_NUMBERS table into the test case itself (the test case will complain when it needs updating, so it's OK to have it separated from the list of actual magic numbers in the importlib code)
Sorry, something went wrong.
Simplify the magic number release test by removing EXPECTED_MAGIC_NUMBERS table and making the expected magic number self-contained within the test. BPO: 29514
ncoghlan
left a comment
There was a problem hiding this comment.
This is looking pretty close now, just a couple of suggestions around details of the test execution.
Sorry, something went wrong.
Improve the execution of the magic number test by using skipUnless for alpha and beta releases, and directly inheriting from unittest.TestCase rather than using the machinery for the other tests. Also improve the error message to explain the reason for caution in changing the magic number. BPO: 29514
Codecov Report
@@ Coverage Diff @@
## master #54 +/- ##
==========================================
- Coverage 82.37% 82.37% -0.01%
==========================================
Files 1427 1428 +1
Lines 350948 350968 +20
==========================================
+ Hits 289093 289102 +9
- Misses 61855 61866 +11Continue to review full report at Codecov.
|
Sorry, something went wrong.
|
Sorry @appeltel and @ambv, I had trouble checking out the |
Sorry, something went wrong.
|
Sorry, @appeltel and @ambv, I could not cleanly backport this to |
Sorry, something went wrong.
Sorry, something went wrong.
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
The versions checked here are 20 years old. Also dllwrap has started to emit a deprecation warning in the latest release spamming the build logs. Fixes python#54
Add a test to check the current MAGIC_NUMBER against the
expected number for the release if the current release is
at candidate or final level. On test failure, describe to
the developer the procedure for changing the magic number.
https://bugs.python.org/issue29514