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
Drop compatibility with Python 3.5 #9101
Open
gilles-peskine-arm
wants to merge
16
commits into
Mbed-TLS:development
Choose a base branch
from
gilles-peskine-arm:python-checks-last-3.6-development
base: development
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Drop compatibility with Python 3.5 #9101
gilles-peskine-arm
wants to merge
16
commits into
Mbed-TLS:development
from
gilles-peskine-arm:python-checks-last-3.6-development
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use less ancient versions to benefit from bug fixes and improvements. Use the last versions that support Python 3.5. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Fix mypy tests/scripts/audit-validity-dates.py Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Pacify Pylint 2.6. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Not a big deal in those particular cases, but follow Pylint 2.6's suggestion. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Annotate some false positives that appeared when moving from Pylint 2.4.4 to Pylint 2.6.2. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Use less ancient versions to benefit from bug fixes and improvements. Use the last versions that support Python 3.6. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This now needs to be conveyed through no-docstring-rgx. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Always specify UTF-8 when dealing with text files, or occasionally ASCII when writing out pure ASCII. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Using context managers ensures that resources are cleaned up on an exception. When writing files, they ensure that all data is flushed out (I think CPython takes care of it anyway, but not Pypy). When reading files, this only prevents leaking the file descriptor (under Python implementations that don't close files automatically, such as Pypy), which doesn't really matter to us since our scripts are short-lived and exit immediately on error, but it's good practice anyway. Leave one process call alone in test_psa_compliance because it would take more refactoring than it's worth. It's in main() so not worth much. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Since we're dropping Python 3.5 compatibility, we can start using f-strings. But that's only a minor stylistic improvement, not worth spending time now to upgrade our existing code. So don't nag about it for the time being. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Sometimes Pylint is too eager to "consider using". Pass Pylint 2.6.2 with Python 3.6. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Since we happily assume UTF-8 encoding for all our source files, there's no point in being extra-robust by occasionally opening them in binary mode. So we can simplify read_file_lines. This fixes complaints from mypy, which wasn't smart enough for the `open() if ... else open()` version. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Starting with this commit, `pip install -r scripts/ci.requirements.txt` no longer works under Python 3.5. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
gilles-peskine-arm
added
component-platform
Portability layer and build scripts
needs-ci
Needs to pass CI tests
needs-preceding-pr
Requires another PR to be merged first
size-s
Estimated task size: small (~2d)
component-test
Test framework and CI scripts
priority-medium
Medium priority - this can be reviewed as time permits
labels
May 6, 2024
This was referenced May 6, 2024
gilles-peskine-arm
added
needs-work
and removed
needs-preceding-pr
Requires another PR to be merged first
labels
May 12, 2024
Useful for debugging CI pipelines. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
gilles-peskine-arm
force-pushed
the
python-checks-last-3.6-development
branch
from
May 13, 2024 09:56
50f5898
to
545db1b
Compare
Avoid a Rust dependency, needed on platforms where no pre-built wheels are available. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
gilles-peskine-arm
added
needs-preceding-pr
Requires another PR to be merged first
and removed
needs-work
needs-ci
Needs to pass CI tests
labels
May 13, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
component-platform
Portability layer and build scripts
component-test
Test framework and CI scripts
needs-preceding-pr
Requires another PR to be merged first
priority-medium
Medium priority - this can be reviewed as time permits
size-s
Estimated task size: small (~2d)
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Move to Python 3.6 as the minimum Python version that actually works. This is the oldest Python version that we promise to support in Mbed TLS 2.28 LTS.
Take advantage of this to upgrade pylint (and also mypy and cryptography) to the last version that still supports Python 3.6.
Resolves #9092. Not sufficient for #9091, unfortunately: this version of Pylint still crashes on some files with Python ≥3.11.
Prerequisites:
PR checklist