-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-91246: Implement PEP 775: Make zlib required on platforms other than wasi #130297
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
Changes from all commits
6bd56d7
0f1090b
89d2d5f
57d3520
be513cb
e9db27c
97db96c
6b63689
c62bf24
4300d9e
4903491
a1b931f
1513e9f
d735769
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,27 @@ | ||
import unittest | ||
from test import support | ||
from test.support import import_helper | ||
import binascii | ||
import copy | ||
import pickle | ||
import random | ||
import sys | ||
import importlib | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep imports sorted There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are all technically "Standard library imports"... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The comment was about alphabetically sorted, your reply about grouped by type 🙂 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm sorry but where in PEP 8 is that specified, I cannot seem to find any mention of it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It’s a very common practice. But another one is to always import os and sys at the top. |
||
from test.support import bigmemtest, _1G, _4G, is_s390x | ||
|
||
|
||
zlib = import_helper.import_module('zlib') | ||
# Building CPython without zlib is not supported except WASI. | ||
# | ||
# Anyone who wants build CPython this way should be prepared to patch it, | ||
# but the core team may help getting those patches to the main branch | ||
# (as that’s the place where multiple third parties can cooperate). | ||
# | ||
# For tests to pass without zlib, this file needs to be removed. | ||
|
||
try: | ||
zlib = importlib.import_module('zlib') | ||
except ImportError as msg: | ||
if sys.platform.startswith('wasi'): | ||
raise unittest.SkipTest(str(msg)) | ||
raise ImportError("Building CPython without zlib is not supported") | ||
|
||
requires_Compress_copy = unittest.skipUnless( | ||
hasattr(zlib.compressobj(), "copy"), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Make zlib required to build CPython with the exception of WASI implementing :pep:`775`. | ||
(Contributed by Stan Ulbrych and Gregory P. Smith in :gh:`130297`.) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.