Fix a few more Python tests

This commit is contained in:
Justine Tunney 2021-08-16 23:45:41 -07:00
parent 59e1c245d1
commit bc464a8898
7 changed files with 1018 additions and 547 deletions

View file

@ -16,8 +16,21 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/calls/calls.h"
#include "libc/calls/struct/rlimit.h"
#include "libc/limits.h"
#include "libc/macros.internal.h"
#include "libc/runtime/clktck.h"
#include "libc/runtime/sysconf.h"
#include "libc/sysv/consts/rlim.h"
#include "libc/sysv/consts/rlimit.h"
static long GetResourceLimit(int resource) {
struct rlimit rl;
getrlimit(resource, &rl);
if (rl.rlim_cur == RLIM_INFINITY) return -1;
return MIN(rl.rlim_cur, LONG_MAX);
}
/**
* Returns configuration value about system.
@ -39,8 +52,12 @@ long sysconf(int name) {
switch (name) {
case _SC_ARG_MAX:
return ARG_MAX;
case _SC_CHILD_MAX:
return GetResourceLimit(RLIMIT_NPROC);
case _SC_CLK_TCK:
return CLK_TCK;
case _SC_OPEN_MAX:
return GetResourceLimit(RLIMIT_NOFILE);
case _SC_PAGESIZE:
return FRAMESIZE;
case _SC_NPROCESSORS_ONLN:

View file

@ -2,7 +2,9 @@
#define COSMOPOLITAN_LIBC_RUNTIME_SYSCONF_H_
#define _SC_ARG_MAX 0
#define _SC_CHILD_MAX 1
#define _SC_CLK_TCK 2
#define _SC_OPEN_MAX 4
#define _SC_PAGESIZE 30
#define _SC_PAGE_SIZE 30
#define _SC_NPROCESSORS_ONLN 1002

View file

@ -23,7 +23,7 @@ else:
def getpreferredencoding(do_setlocale=True):
assert not do_setlocale
result = _locale.nl_langinfo(_locale.CODESET)
if not result and sys.platform == 'darwin':
if not result and sys.platform in ('darwin', 'cosmo'):
# nl_langinfo can return an empty string
# when the setting has an invalid value.
# Default to UTF-8 in that case because

View file

@ -358,7 +358,7 @@ class TestEnUSCollation(BaseLocalizedTest, TestCollation):
enc = codecs.lookup(locale.getpreferredencoding(False) or 'ascii').name
if enc not in ('utf-8', 'iso8859-1', 'cp1252'):
raise unittest.SkipTest('encoding not suitable')
if enc != 'iso8859-1' and (sys.platform == 'darwin' or is_android or
if enc != 'iso8859-1' and (sys.platform in ('darwin','cosmo') or is_android or
sys.platform.startswith('freebsd')):
raise unittest.SkipTest('wcscoll/wcsxfrm have known bugs')
BaseLocalizedTest.setUp(self)

View file

@ -10681,7 +10681,6 @@ os_cpu_count_impl(PyObject *module)
{
int ncpu;
ncpu = GetCpuCount();
printf("cpu count %d\n", ncpu);
if (ncpu >= 1)
return PyLong_FromLong(ncpu);
else

View file

@ -0,0 +1,286 @@
#!/usr/bin/env python3
"""Check proposed changes for common issues."""
import re
import sys
import shutil
import os.path
import subprocess
import sysconfig
import reindent
import untabify
# Excluded directories which are copies of external libraries:
# don't check their coding style
EXCLUDE_DIRS = [os.path.join('Modules', '_ctypes', 'libffi'),
os.path.join('Modules', '_ctypes', 'libffi_osx'),
os.path.join('Modules', '_ctypes', 'libffi_msvc'),
os.path.join('Modules', '_decimal', 'libmpdec'),
os.path.join('Modules', 'expat'),
os.path.join('Modules', 'zlib')]
SRCDIR = sysconfig.get_config_var('srcdir')
def n_files_str(count):
"""Return 'N file(s)' with the proper plurality on 'file'."""
return "{} file{}".format(count, "s" if count != 1 else "")
def status(message, modal=False, info=None):
"""Decorator to output status info to stdout."""
def decorated_fxn(fxn):
def call_fxn(*args, **kwargs):
sys.stdout.write(message + ' ... ')
sys.stdout.flush()
result = fxn(*args, **kwargs)
if not modal and not info:
print("done")
elif info:
print(info(result))
else:
print("yes" if result else "NO")
return result
return call_fxn
return decorated_fxn
def get_git_branch():
"""Get the symbolic name for the current git branch"""
cmd = "git rev-parse --abbrev-ref HEAD".split()
try:
return subprocess.check_output(cmd,
stderr=subprocess.DEVNULL,
cwd=SRCDIR)
except subprocess.CalledProcessError:
return None
def get_git_upstream_remote():
"""Get the remote name to use for upstream branches
Uses "upstream" if it exists, "origin" otherwise
"""
cmd = "git remote get-url upstream".split()
try:
subprocess.check_output(cmd,
stderr=subprocess.DEVNULL,
cwd=SRCDIR)
except subprocess.CalledProcessError:
return "origin"
return "upstream"
@status("Getting base branch for PR",
info=lambda x: x if x is not None else "not a PR branch")
def get_base_branch():
if not os.path.exists(os.path.join(SRCDIR, '.git')):
# Not a git checkout, so there's no base branch
return None
version = sys.version_info
if version.releaselevel == 'alpha':
base_branch = "master"
else:
base_branch = "{0.major}.{0.minor}".format(version)
this_branch = get_git_branch()
if this_branch is None or this_branch == base_branch:
# Not on a git PR branch, so there's no base branch
return None
upstream_remote = get_git_upstream_remote()
return upstream_remote + "/" + base_branch
@status("Getting the list of files that have been added/changed",
info=lambda x: n_files_str(len(x)))
def changed_files(base_branch=None):
"""Get the list of changed or added files from git."""
if os.path.exists(os.path.join(SRCDIR, '.git')):
# We just use an existence check here as:
# directory = normal git checkout/clone
# file = git worktree directory
if base_branch:
cmd = 'git diff --name-status ' + base_branch
else:
cmd = 'git status --porcelain'
filenames = []
with subprocess.Popen(cmd.split(),
stdout=subprocess.PIPE,
cwd=SRCDIR) as st:
for line in st.stdout:
line = line.decode().rstrip()
status_text, filename = line.split(maxsplit=1)
status = set(status_text)
# modified, added or unmerged files
if not status.intersection('MAU'):
continue
if ' -> ' in filename:
# file is renamed
filename = filename.split(' -> ', 2)[1].strip()
filenames.append(filename)
else:
sys.exit('need a git checkout to get modified files')
filenames2 = []
for filename in filenames:
# Normalize the path to be able to match using .startswith()
filename = os.path.normpath(filename)
if any(filename.startswith(path) for path in EXCLUDE_DIRS):
# Exclude the file
continue
filenames2.append(filename)
return filenames2
def report_modified_files(file_paths):
count = len(file_paths)
if count == 0:
return n_files_str(count)
else:
lines = ["{}:".format(n_files_str(count))]
for path in file_paths:
lines.append(" {}".format(path))
return "\n".join(lines)
@status("Fixing Python file whitespace", info=report_modified_files)
def normalize_whitespace(file_paths):
"""Make sure that the whitespace for .py files have been normalized."""
reindent.makebackup = False # No need to create backups.
fixed = [path for path in file_paths if path.endswith('.py') and
reindent.check(os.path.join(SRCDIR, path))]
return fixed
@status("Fixing C file whitespace", info=report_modified_files)
def normalize_c_whitespace(file_paths):
"""Report if any C files """
fixed = []
for path in file_paths:
abspath = os.path.join(SRCDIR, path)
with open(abspath, 'r') as f:
if '\t' not in f.read():
continue
untabify.process(abspath, 8, verbose=False)
fixed.append(path)
return fixed
ws_re = re.compile(br'\s+(\r?\n)$')
@status("Fixing docs whitespace", info=report_modified_files)
def normalize_docs_whitespace(file_paths):
fixed = []
for path in file_paths:
abspath = os.path.join(SRCDIR, path)
try:
with open(abspath, 'rb') as f:
lines = f.readlines()
new_lines = [ws_re.sub(br'\1', line) for line in lines]
if new_lines != lines:
shutil.copyfile(abspath, abspath + '.bak')
with open(abspath, 'wb') as f:
f.writelines(new_lines)
fixed.append(path)
except Exception as err:
print('Cannot fix %s: %s' % (path, err))
return fixed
@status("Docs modified", modal=True)
def docs_modified(file_paths):
"""Report if any file in the Doc directory has been changed."""
return bool(file_paths)
@status("Misc/ACKS updated", modal=True)
def credit_given(file_paths):
"""Check if Misc/ACKS has been changed."""
return os.path.join('Misc', 'ACKS') in file_paths
@status("Misc/NEWS.d updated with `blurb`", modal=True)
def reported_news(file_paths):
"""Check if Misc/NEWS.d has been changed."""
return any(p.startswith(os.path.join('Misc', 'NEWS.d', 'next'))
for p in file_paths)
@status("configure regenerated", modal=True, info=str)
def regenerated_configure(file_paths):
"""Check if configure has been regenerated."""
if 'configure.ac' in file_paths:
return "yes" if 'configure' in file_paths else "no"
else:
return "not needed"
@status("pyconfig.h.in regenerated", modal=True, info=str)
def regenerated_pyconfig_h_in(file_paths):
"""Check if pyconfig.h.in has been regenerated."""
if 'configure.ac' in file_paths:
return "yes" if 'pyconfig.h.in' in file_paths else "no"
else:
return "not needed"
def travis(pull_request):
if pull_request == 'false':
print('Not a pull request; skipping')
return
base_branch = get_base_branch()
file_paths = changed_files(base_branch)
python_files = [fn for fn in file_paths if fn.endswith('.py')]
c_files = [fn for fn in file_paths if fn.endswith(('.c', '.h'))]
doc_files = [fn for fn in file_paths if fn.startswith('Doc') and
fn.endswith(('.rst', '.inc'))]
fixed = []
fixed.extend(normalize_whitespace(python_files))
fixed.extend(normalize_c_whitespace(c_files))
fixed.extend(normalize_docs_whitespace(doc_files))
if not fixed:
print('No whitespace issues found')
else:
print(f'Please fix the {len(fixed)} file(s) with whitespace issues')
print('(on UNIX you can run `make patchcheck` to make the fixes)')
sys.exit(1)
def main():
base_branch = get_base_branch()
file_paths = changed_files(base_branch)
python_files = [fn for fn in file_paths if fn.endswith('.py')]
c_files = [fn for fn in file_paths if fn.endswith(('.c', '.h'))]
doc_files = [fn for fn in file_paths if fn.startswith('Doc') and
fn.endswith(('.rst', '.inc'))]
misc_files = {p for p in file_paths if p.startswith('Misc')}
# PEP 8 whitespace rules enforcement.
normalize_whitespace(python_files)
# C rules enforcement.
normalize_c_whitespace(c_files)
# Doc whitespace enforcement.
normalize_docs_whitespace(doc_files)
# Docs updated.
docs_modified(doc_files)
# Misc/ACKS changed.
credit_given(misc_files)
# Misc/NEWS changed.
reported_news(misc_files)
# Regenerated configure, if necessary.
regenerated_configure(file_paths)
# Regenerated pyconfig.h.in, if necessary.
regenerated_pyconfig_h_in(file_paths)
# Test suite run and passed.
if python_files or c_files:
end = " and check for refleaks?" if c_files else "?"
print()
print("Did you run the test suite" + end)
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--travis',
help='Perform pass/fail checks')
args = parser.parse_args()
if args.travis:
travis(args.travis)
else:
main()

View file

@ -7,36 +7,6 @@
THIRD_PARTY_PYTHON_STDLIB_PY = \
third_party/python/Lib/ \
third_party/python/Lib/collections/ \
third_party/python/Lib/dbm/ \
third_party/python/Lib/email/ \
third_party/python/Lib/email/mime/ \
third_party/python/Lib/encodings/ \
third_party/python/Lib/html/ \
third_party/python/Lib/http/ \
third_party/python/Lib/importlib/ \
third_party/python/Lib/json/ \
third_party/python/Lib/lib2to3/ \
third_party/python/Lib/lib2to3/fixes/ \
third_party/python/Lib/lib2to3/pgen2/ \
third_party/python/Lib/logging/ \
third_party/python/Lib/msilib/ \
third_party/python/Lib/multiprocessing/ \
third_party/python/Lib/multiprocessing/dummy/ \
third_party/python/Lib/sqlite3/ \
third_party/python/Lib/unittest/ \
third_party/python/Lib/urllib/ \
third_party/python/Lib/venv/ \
third_party/python/Lib/venv/scripts/common/ \
third_party/python/Lib/venv/scripts/nt/ \
third_party/python/Lib/venv/scripts/posix/ \
third_party/python/Lib/wsgiref/ \
third_party/python/Lib/xml/ \
third_party/python/Lib/xml/dom/ \
third_party/python/Lib/xml/etree/ \
third_party/python/Lib/xml/parsers/ \
third_party/python/Lib/xml/sax/ \
third_party/python/Lib/xmlrpc/ \
third_party/python/Lib/__future__.py \
third_party/python/Lib/_bootlocale.py \
third_party/python/Lib/_collections_abc.py \
@ -56,6 +26,34 @@ THIRD_PARTY_PYTHON_STDLIB_PY = \
third_party/python/Lib/antigravity.py \
third_party/python/Lib/argparse.py \
third_party/python/Lib/ast.py \
third_party/python/Lib/asynchat.py \
third_party/python/Lib/asyncio/ \
third_party/python/Lib/asyncio/__init__.py \
third_party/python/Lib/asyncio/base_events.py \
third_party/python/Lib/asyncio/base_futures.py \
third_party/python/Lib/asyncio/base_subprocess.py \
third_party/python/Lib/asyncio/base_tasks.py \
third_party/python/Lib/asyncio/compat.py \
third_party/python/Lib/asyncio/constants.py \
third_party/python/Lib/asyncio/coroutines.py \
third_party/python/Lib/asyncio/events.py \
third_party/python/Lib/asyncio/futures.py \
third_party/python/Lib/asyncio/locks.py \
third_party/python/Lib/asyncio/log.py \
third_party/python/Lib/asyncio/proactor_events.py \
third_party/python/Lib/asyncio/protocols.py \
third_party/python/Lib/asyncio/queues.py \
third_party/python/Lib/asyncio/selector_events.py \
third_party/python/Lib/asyncio/sslproto.py \
third_party/python/Lib/asyncio/streams.py \
third_party/python/Lib/asyncio/subprocess.py \
third_party/python/Lib/asyncio/tasks.py \
third_party/python/Lib/asyncio/test_utils.py \
third_party/python/Lib/asyncio/transports.py \
third_party/python/Lib/asyncio/unix_events.py \
third_party/python/Lib/asyncio/windows_events.py \
third_party/python/Lib/asyncio/windows_utils.py \
third_party/python/Lib/asyncore.py \
third_party/python/Lib/base64.py \
third_party/python/Lib/bdb.py \
third_party/python/Lib/binhex.py \
@ -70,6 +68,7 @@ THIRD_PARTY_PYTHON_STDLIB_PY = \
third_party/python/Lib/code.py \
third_party/python/Lib/codecs.py \
third_party/python/Lib/codeop.py \
third_party/python/Lib/collections/ \
third_party/python/Lib/collections/__init__.py \
third_party/python/Lib/collections/abc.py \
third_party/python/Lib/colorsys.py \
@ -81,6 +80,7 @@ THIRD_PARTY_PYTHON_STDLIB_PY = \
third_party/python/Lib/crypt.py \
third_party/python/Lib/csv.py \
third_party/python/Lib/datetime.py \
third_party/python/Lib/dbm/ \
third_party/python/Lib/dbm/__init__.py \
third_party/python/Lib/dbm/dumb.py \
third_party/python/Lib/dbm/gnu.py \
@ -88,8 +88,109 @@ THIRD_PARTY_PYTHON_STDLIB_PY = \
third_party/python/Lib/decimal.py \
third_party/python/Lib/difflib.py \
third_party/python/Lib/dis.py \
third_party/python/Lib/distutils/ \
third_party/python/Lib/distutils/__init__.py \
third_party/python/Lib/distutils/_msvccompiler.py \
third_party/python/Lib/distutils/archive_util.py \
third_party/python/Lib/distutils/bcppcompiler.py \
third_party/python/Lib/distutils/ccompiler.py \
third_party/python/Lib/distutils/cmd.py \
third_party/python/Lib/distutils/command/ \
third_party/python/Lib/distutils/command/__init__.py \
third_party/python/Lib/distutils/command/bdist.py \
third_party/python/Lib/distutils/command/bdist_dumb.py \
third_party/python/Lib/distutils/command/bdist_msi.py \
third_party/python/Lib/distutils/command/bdist_rpm.py \
third_party/python/Lib/distutils/command/bdist_wininst.py \
third_party/python/Lib/distutils/command/build.py \
third_party/python/Lib/distutils/command/build_clib.py \
third_party/python/Lib/distutils/command/build_ext.py \
third_party/python/Lib/distutils/command/build_py.py \
third_party/python/Lib/distutils/command/build_scripts.py \
third_party/python/Lib/distutils/command/check.py \
third_party/python/Lib/distutils/command/clean.py \
third_party/python/Lib/distutils/command/command_template \
third_party/python/Lib/distutils/command/config.py \
third_party/python/Lib/distutils/command/install.py \
third_party/python/Lib/distutils/command/install_data.py \
third_party/python/Lib/distutils/command/install_egg_info.py \
third_party/python/Lib/distutils/command/install_headers.py \
third_party/python/Lib/distutils/command/install_lib.py \
third_party/python/Lib/distutils/command/install_scripts.py \
third_party/python/Lib/distutils/command/register.py \
third_party/python/Lib/distutils/command/sdist.py \
third_party/python/Lib/distutils/command/upload.py \
third_party/python/Lib/distutils/config.py \
third_party/python/Lib/distutils/core.py \
third_party/python/Lib/distutils/cygwinccompiler.py \
third_party/python/Lib/distutils/debug.py \
third_party/python/Lib/distutils/dep_util.py \
third_party/python/Lib/distutils/dir_util.py \
third_party/python/Lib/distutils/dist.py \
third_party/python/Lib/distutils/errors.py \
third_party/python/Lib/distutils/extension.py \
third_party/python/Lib/distutils/fancy_getopt.py \
third_party/python/Lib/distutils/file_util.py \
third_party/python/Lib/distutils/filelist.py \
third_party/python/Lib/distutils/log.py \
third_party/python/Lib/distutils/msvc9compiler.py \
third_party/python/Lib/distutils/msvccompiler.py \
third_party/python/Lib/distutils/spawn.py \
third_party/python/Lib/distutils/sysconfig.py \
third_party/python/Lib/distutils/tests/ \
third_party/python/Lib/distutils/tests/Setup.sample \
third_party/python/Lib/distutils/tests/__init__.py \
third_party/python/Lib/distutils/tests/support.py \
third_party/python/Lib/distutils/tests/test_archive_util.py \
third_party/python/Lib/distutils/tests/test_bdist.py \
third_party/python/Lib/distutils/tests/test_bdist_dumb.py \
third_party/python/Lib/distutils/tests/test_bdist_msi.py \
third_party/python/Lib/distutils/tests/test_bdist_rpm.py \
third_party/python/Lib/distutils/tests/test_bdist_wininst.py \
third_party/python/Lib/distutils/tests/test_build.py \
third_party/python/Lib/distutils/tests/test_build_clib.py \
third_party/python/Lib/distutils/tests/test_build_ext.py \
third_party/python/Lib/distutils/tests/test_build_py.py \
third_party/python/Lib/distutils/tests/test_build_scripts.py \
third_party/python/Lib/distutils/tests/test_check.py \
third_party/python/Lib/distutils/tests/test_clean.py \
third_party/python/Lib/distutils/tests/test_cmd.py \
third_party/python/Lib/distutils/tests/test_config.py \
third_party/python/Lib/distutils/tests/test_config_cmd.py \
third_party/python/Lib/distutils/tests/test_core.py \
third_party/python/Lib/distutils/tests/test_cygwinccompiler.py \
third_party/python/Lib/distutils/tests/test_dep_util.py \
third_party/python/Lib/distutils/tests/test_dir_util.py \
third_party/python/Lib/distutils/tests/test_dist.py \
third_party/python/Lib/distutils/tests/test_extension.py \
third_party/python/Lib/distutils/tests/test_file_util.py \
third_party/python/Lib/distutils/tests/test_filelist.py \
third_party/python/Lib/distutils/tests/test_install.py \
third_party/python/Lib/distutils/tests/test_install_data.py \
third_party/python/Lib/distutils/tests/test_install_headers.py \
third_party/python/Lib/distutils/tests/test_install_lib.py \
third_party/python/Lib/distutils/tests/test_install_scripts.py \
third_party/python/Lib/distutils/tests/test_log.py \
third_party/python/Lib/distutils/tests/test_msvc9compiler.py \
third_party/python/Lib/distutils/tests/test_msvccompiler.py \
third_party/python/Lib/distutils/tests/test_register.py \
third_party/python/Lib/distutils/tests/test_sdist.py \
third_party/python/Lib/distutils/tests/test_spawn.py \
third_party/python/Lib/distutils/tests/test_sysconfig.py \
third_party/python/Lib/distutils/tests/test_text_file.py \
third_party/python/Lib/distutils/tests/test_unixccompiler.py \
third_party/python/Lib/distutils/tests/test_upload.py \
third_party/python/Lib/distutils/tests/test_util.py \
third_party/python/Lib/distutils/tests/test_version.py \
third_party/python/Lib/distutils/tests/test_versionpredicate.py \
third_party/python/Lib/distutils/text_file.py \
third_party/python/Lib/distutils/unixccompiler.py \
third_party/python/Lib/distutils/util.py \
third_party/python/Lib/distutils/version.py \
third_party/python/Lib/distutils/versionpredicate.py \
third_party/python/Lib/doctest.py \
third_party/python/Lib/dummy_threading.py \
third_party/python/Lib/email/ \
third_party/python/Lib/email/__init__.py \
third_party/python/Lib/email/_encoded_words.py \
third_party/python/Lib/email/_header_value_parser.py \
@ -107,6 +208,7 @@ THIRD_PARTY_PYTHON_STDLIB_PY = \
third_party/python/Lib/email/headerregistry.py \
third_party/python/Lib/email/iterators.py \
third_party/python/Lib/email/message.py \
third_party/python/Lib/email/mime/ \
third_party/python/Lib/email/mime/__init__.py \
third_party/python/Lib/email/mime/application.py \
third_party/python/Lib/email/mime/audio.py \
@ -120,6 +222,7 @@ THIRD_PARTY_PYTHON_STDLIB_PY = \
third_party/python/Lib/email/policy.py \
third_party/python/Lib/email/quoprimime.py \
third_party/python/Lib/email/utils.py \
third_party/python/Lib/encodings/ \
third_party/python/Lib/encodings/__init__.py \
third_party/python/Lib/encodings/aliases.py \
third_party/python/Lib/encodings/ascii.py \
@ -245,6 +348,13 @@ THIRD_PARTY_PYTHON_STDLIB_PY = \
third_party/python/Lib/encodings/utf_8_sig.py \
third_party/python/Lib/encodings/uu_codec.py \
third_party/python/Lib/encodings/zlib_codec.py \
third_party/python/Lib/ensurepip/ \
third_party/python/Lib/ensurepip/__init__.py \
third_party/python/Lib/ensurepip/__main__.py \
third_party/python/Lib/ensurepip/_bundled \
third_party/python/Lib/ensurepip/_bundled/pip-18.1-py2.py3-none-any.whl \
third_party/python/Lib/ensurepip/_bundled/setuptools-40.6.2-py2.py3-none-any.whl \
third_party/python/Lib/ensurepip/_uninstall.py \
third_party/python/Lib/enum.py \
third_party/python/Lib/filecmp.py \
third_party/python/Lib/fileinput.py \
@ -262,9 +372,11 @@ THIRD_PARTY_PYTHON_STDLIB_PY = \
third_party/python/Lib/hashlib.py \
third_party/python/Lib/heapq.py \
third_party/python/Lib/hmac.py \
third_party/python/Lib/html/ \
third_party/python/Lib/html/__init__.py \
third_party/python/Lib/html/entities.py \
third_party/python/Lib/html/parser.py \
third_party/python/Lib/http/ \
third_party/python/Lib/http/__init__.py \
third_party/python/Lib/http/client.py \
third_party/python/Lib/http/cookiejar.py \
@ -273,6 +385,7 @@ THIRD_PARTY_PYTHON_STDLIB_PY = \
third_party/python/Lib/imaplib.py \
third_party/python/Lib/imghdr.py \
third_party/python/Lib/imp.py \
third_party/python/Lib/importlib/ \
third_party/python/Lib/importlib/__init__.py \
third_party/python/Lib/importlib/_bootstrap.py \
third_party/python/Lib/importlib/_bootstrap_external.py \
@ -282,12 +395,14 @@ THIRD_PARTY_PYTHON_STDLIB_PY = \
third_party/python/Lib/inspect.py \
third_party/python/Lib/io.py \
third_party/python/Lib/ipaddress.py \
third_party/python/Lib/json/ \
third_party/python/Lib/json/__init__.py \
third_party/python/Lib/json/decoder.py \
third_party/python/Lib/json/encoder.py \
third_party/python/Lib/json/scanner.py \
third_party/python/Lib/json/tool.py \
third_party/python/Lib/keyword.py \
third_party/python/Lib/lib2to3/ \
third_party/python/Lib/lib2to3/Grammar.txt \
third_party/python/Lib/lib2to3/PatternGrammar.txt \
third_party/python/Lib/lib2to3/__init__.py \
@ -296,6 +411,7 @@ THIRD_PARTY_PYTHON_STDLIB_PY = \
third_party/python/Lib/lib2to3/btm_utils.py \
third_party/python/Lib/lib2to3/fixer_base.py \
third_party/python/Lib/lib2to3/fixer_util.py \
third_party/python/Lib/lib2to3/fixes/ \
third_party/python/Lib/lib2to3/fixes/__init__.py \
third_party/python/Lib/lib2to3/fixes/fix_apply.py \
third_party/python/Lib/lib2to3/fixes/fix_asserts.py \
@ -351,6 +467,7 @@ THIRD_PARTY_PYTHON_STDLIB_PY = \
third_party/python/Lib/lib2to3/fixes/fix_zip.py \
third_party/python/Lib/lib2to3/main.py \
third_party/python/Lib/lib2to3/patcomp.py \
third_party/python/Lib/lib2to3/pgen2/ \
third_party/python/Lib/lib2to3/pgen2/__init__.py \
third_party/python/Lib/lib2to3/pgen2/conv.py \
third_party/python/Lib/lib2to3/pgen2/driver.py \
@ -363,8 +480,41 @@ THIRD_PARTY_PYTHON_STDLIB_PY = \
third_party/python/Lib/lib2to3/pygram.py \
third_party/python/Lib/lib2to3/pytree.py \
third_party/python/Lib/lib2to3/refactor.py \
third_party/python/Lib/lib2to3/tests \
third_party/python/Lib/lib2to3/tests/__init__.py \
third_party/python/Lib/lib2to3/tests/__main__.py \
third_party/python/Lib/lib2to3/tests/data \
third_party/python/Lib/lib2to3/tests/data/README \
third_party/python/Lib/lib2to3/tests/data/bom.py \
third_party/python/Lib/lib2to3/tests/data/crlf.py \
third_party/python/Lib/lib2to3/tests/data/different_encoding.py \
third_party/python/Lib/lib2to3/tests/data/false_encoding.py \
third_party/python/Lib/lib2to3/tests/data/fixers \
third_party/python/Lib/lib2to3/tests/data/fixers/bad_order.py \
third_party/python/Lib/lib2to3/tests/data/fixers/myfixes \
third_party/python/Lib/lib2to3/tests/data/fixers/myfixes/__init__.py \
third_party/python/Lib/lib2to3/tests/data/fixers/myfixes/fix_explicit.py \
third_party/python/Lib/lib2to3/tests/data/fixers/myfixes/fix_first.py \
third_party/python/Lib/lib2to3/tests/data/fixers/myfixes/fix_last.py \
third_party/python/Lib/lib2to3/tests/data/fixers/myfixes/fix_parrot.py \
third_party/python/Lib/lib2to3/tests/data/fixers/myfixes/fix_preorder.py \
third_party/python/Lib/lib2to3/tests/data/fixers/no_fixer_cls.py \
third_party/python/Lib/lib2to3/tests/data/fixers/parrot_example.py \
third_party/python/Lib/lib2to3/tests/data/infinite_recursion.py \
third_party/python/Lib/lib2to3/tests/data/py2_test_grammar.py \
third_party/python/Lib/lib2to3/tests/data/py3_test_grammar.py \
third_party/python/Lib/lib2to3/tests/pytree_idempotency.py \
third_party/python/Lib/lib2to3/tests/support.py \
third_party/python/Lib/lib2to3/tests/test_all_fixers.py \
third_party/python/Lib/lib2to3/tests/test_fixers.py \
third_party/python/Lib/lib2to3/tests/test_main.py \
third_party/python/Lib/lib2to3/tests/test_parser.py \
third_party/python/Lib/lib2to3/tests/test_pytree.py \
third_party/python/Lib/lib2to3/tests/test_refactor.py \
third_party/python/Lib/lib2to3/tests/test_util.py \
third_party/python/Lib/linecache.py \
third_party/python/Lib/locale.py \
third_party/python/Lib/logging/ \
third_party/python/Lib/logging/__init__.py \
third_party/python/Lib/logging/config.py \
third_party/python/Lib/logging/handlers.py \
@ -375,13 +525,16 @@ THIRD_PARTY_PYTHON_STDLIB_PY = \
third_party/python/Lib/mailcap.py \
third_party/python/Lib/mimetypes.py \
third_party/python/Lib/modulefinder.py \
third_party/python/Lib/msilib/ \
third_party/python/Lib/msilib/__init__.py \
third_party/python/Lib/msilib/schema.py \
third_party/python/Lib/msilib/sequence.py \
third_party/python/Lib/msilib/text.py \
third_party/python/Lib/multiprocessing/ \
third_party/python/Lib/multiprocessing/__init__.py \
third_party/python/Lib/multiprocessing/connection.py \
third_party/python/Lib/multiprocessing/context.py \
third_party/python/Lib/multiprocessing/dummy/ \
third_party/python/Lib/multiprocessing/dummy/__init__.py \
third_party/python/Lib/multiprocessing/dummy/connection.py \
third_party/python/Lib/multiprocessing/forkserver.py \
@ -447,6 +600,7 @@ THIRD_PARTY_PYTHON_STDLIB_PY = \
third_party/python/Lib/sndhdr.py \
third_party/python/Lib/socket.py \
third_party/python/Lib/socketserver.py \
third_party/python/Lib/sqlite3/ \
third_party/python/Lib/sqlite3/__init__.py \
third_party/python/Lib/sqlite3/dbapi2.py \
third_party/python/Lib/sqlite3/dump.py \
@ -480,6 +634,7 @@ THIRD_PARTY_PYTHON_STDLIB_PY = \
third_party/python/Lib/tty.py \
third_party/python/Lib/types.py \
third_party/python/Lib/typing.py \
third_party/python/Lib/unittest/ \
third_party/python/Lib/unittest/__init__.py \
third_party/python/Lib/unittest/__main__.py \
third_party/python/Lib/unittest/case.py \
@ -491,6 +646,7 @@ THIRD_PARTY_PYTHON_STDLIB_PY = \
third_party/python/Lib/unittest/signals.py \
third_party/python/Lib/unittest/suite.py \
third_party/python/Lib/unittest/util.py \
third_party/python/Lib/urllib/ \
third_party/python/Lib/urllib/__init__.py \
third_party/python/Lib/urllib/error.py \
third_party/python/Lib/urllib/parse.py \
@ -499,18 +655,23 @@ THIRD_PARTY_PYTHON_STDLIB_PY = \
third_party/python/Lib/urllib/robotparser.py \
third_party/python/Lib/uu.py \
third_party/python/Lib/uuid.py \
third_party/python/Lib/venv/ \
third_party/python/Lib/venv/__init__.py \
third_party/python/Lib/venv/__main__.py \
third_party/python/Lib/venv/scripts/common/ \
third_party/python/Lib/venv/scripts/common/activate \
third_party/python/Lib/venv/scripts/nt/ \
third_party/python/Lib/venv/scripts/nt/Activate.ps1 \
third_party/python/Lib/venv/scripts/nt/activate.bat \
third_party/python/Lib/venv/scripts/nt/deactivate.bat \
third_party/python/Lib/venv/scripts/posix/ \
third_party/python/Lib/venv/scripts/posix/activate.csh \
third_party/python/Lib/venv/scripts/posix/activate.fish \
third_party/python/Lib/warnings.py \
third_party/python/Lib/wave.py \
third_party/python/Lib/weakref.py \
third_party/python/Lib/webbrowser.py \
third_party/python/Lib/wsgiref/ \
third_party/python/Lib/wsgiref/__init__.py \
third_party/python/Lib/wsgiref/handlers.py \
third_party/python/Lib/wsgiref/headers.py \
@ -518,7 +679,9 @@ THIRD_PARTY_PYTHON_STDLIB_PY = \
third_party/python/Lib/wsgiref/util.py \
third_party/python/Lib/wsgiref/validate.py \
third_party/python/Lib/xdrlib.py \
third_party/python/Lib/xml/ \
third_party/python/Lib/xml/__init__.py \
third_party/python/Lib/xml/dom/ \
third_party/python/Lib/xml/dom/NodeFilter.py \
third_party/python/Lib/xml/dom/__init__.py \
third_party/python/Lib/xml/dom/domreg.py \
@ -527,19 +690,23 @@ THIRD_PARTY_PYTHON_STDLIB_PY = \
third_party/python/Lib/xml/dom/minidom.py \
third_party/python/Lib/xml/dom/pulldom.py \
third_party/python/Lib/xml/dom/xmlbuilder.py \
third_party/python/Lib/xml/etree/ \
third_party/python/Lib/xml/etree/ElementInclude.py \
third_party/python/Lib/xml/etree/ElementPath.py \
third_party/python/Lib/xml/etree/ElementTree.py \
third_party/python/Lib/xml/etree/__init__.py \
third_party/python/Lib/xml/etree/cElementTree.py \
third_party/python/Lib/xml/parsers/ \
third_party/python/Lib/xml/parsers/__init__.py \
third_party/python/Lib/xml/parsers/expat.py \
third_party/python/Lib/xml/sax/ \
third_party/python/Lib/xml/sax/__init__.py \
third_party/python/Lib/xml/sax/_exceptions.py \
third_party/python/Lib/xml/sax/expatreader.py \
third_party/python/Lib/xml/sax/handler.py \
third_party/python/Lib/xml/sax/saxutils.py \
third_party/python/Lib/xml/sax/xmlreader.py \
third_party/python/Lib/xmlrpc/ \
third_party/python/Lib/xmlrpc/__init__.py \
third_party/python/Lib/xmlrpc/client.py \
third_party/python/Lib/xmlrpc/server.py \
@ -552,7 +719,7 @@ THIRD_PARTY_PYTHON_STDLIB_PY_OBJS = \
$(THIRD_PARTY_PYTHON_STDLIB_PY_OBJS): \
third_party/python/python-stdlib.mk
#o/$(MODE)/third_party/python/Lib/%.py.zip.o: \
#$(THIRD_PARTY_PYTHON_STDLIB_PY_OBJS): \
ZIPOBJ_FLAGS += \
-P.python \
-C3