summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Guo <robert.guo@mongodb.com>2022-05-31 14:37:42 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-05-31 15:03:45 +0000
commit86cb7ea3649b2190958a1645de9d3df4a529fc90 (patch)
treed151ad13d193180966201ec4e619ec4e422313cc
parent2fe7afd99f8158306415470286622c3712bebce3 (diff)
downloadmongo-86cb7ea3649b2190958a1645de9d3df4a529fc90.tar.gz
SERVER-65672 upgrade python packages to support 3.10r6.0.0-rc8
-rw-r--r--.pydocstyle6
-rwxr-xr-xbuildscripts/collect_resource_info.py2
-rwxr-xr-xbuildscripts/errorcodes.py11
-rw-r--r--buildscripts/gdb/mongo_printers.py1
-rw-r--r--buildscripts/idl/idl/errors.py1
-rw-r--r--buildscripts/linter/git_base.py2
-rw-r--r--buildscripts/linter/parallel.py25
-rw-r--r--buildscripts/linter/pydocstyle.py2
-rw-r--r--buildscripts/resmokelib/logging/buildlogger.py5
-rw-r--r--buildscripts/resmokelib/selector.py1
-rw-r--r--buildscripts/resmokelib/testing/hooks/background_job.py6
-rw-r--r--buildscripts/resmokelib/testing/hooks/stepdown.py3
-rw-r--r--etc/pip/components/core.req1
-rw-r--r--etc/pip/components/jiraclient.req1
-rw-r--r--etc/pip/components/lint.req4
-rw-r--r--etc/pip/components/platform.req1
16 files changed, 42 insertions, 30 deletions
diff --git a/.pydocstyle b/.pydocstyle
index 229bd2904fe..2fed49e4f98 100644
--- a/.pydocstyle
+++ b/.pydocstyle
@@ -9,6 +9,10 @@ inherit = false
# D212 - Multi-line docstring summary should start at the first line
# D213 - Multi-line docstring summary should start at the second line
# D301 - Use r""" if any backslashes in a docstring
-ignore = D105,D202,D203,D212,D213,D301
+# D401 - First line should be in imperative mood
+# D407 - Missing dashed underline after section
+# D413 - Missing blank line after last section
+# D415 - First line should end with a period, question mark, or exclamation point
+ignore = D105,D202,D203,D212,D213,D301,D401,D407,D413,D415
# Do not run on buildscripts/tests/
match = ^((?!buildscripts[\\\/]tests[\\\/]).)*$
diff --git a/buildscripts/collect_resource_info.py b/buildscripts/collect_resource_info.py
index 9ef7556ea86..cf10a6e95e7 100755
--- a/buildscripts/collect_resource_info.py
+++ b/buildscripts/collect_resource_info.py
@@ -18,7 +18,7 @@ from buildscripts.resmokelib import utils # pylint: disable=wrong-import-positi
def main():
- """Main."""
+ """Collect system resources."""
usage = "usage: %prog [options]"
parser = optparse.OptionParser(description=__doc__, usage=usage)
parser.add_option(
diff --git a/buildscripts/errorcodes.py b/buildscripts/errorcodes.py
index 2f18298db9f..8d9330b4240 100755
--- a/buildscripts/errorcodes.py
+++ b/buildscripts/errorcodes.py
@@ -239,14 +239,15 @@ def read_error_codes(src_root='src/mongo'):
def replace_bad_codes(errors, next_code_generator): # pylint: disable=too-many-locals
- """Modify C++ source files to replace invalid assertion codes.
+ """
+ Modify C++ source files to replace invalid assertion codes.
For now, we only modify zero codes.
- Args:
- errors: list of AssertLocation
- next_code_generator: generator -> int, next non-conflicting assertion code
+ :param errors: list of AssertLocation
+ :param next_code_generator: generator -> int, next non-conflicting assertion code
"""
+
zero_errors = [e for e in errors if int(e.code) == 0]
skip_errors = [e for e in errors if int(e.code) != 0]
@@ -296,7 +297,7 @@ def coerce_to_number(ticket_value):
def main():
- """Main."""
+ """Validate error codes."""
parser = OptionParser(description=__doc__.strip())
parser.add_option("--fix", dest="replace", action="store_true", default=False,
help="Fix zero codes in source files [default: %default]")
diff --git a/buildscripts/gdb/mongo_printers.py b/buildscripts/gdb/mongo_printers.py
index b6b7f8099ee..fe9727447ea 100644
--- a/buildscripts/gdb/mongo_printers.py
+++ b/buildscripts/gdb/mongo_printers.py
@@ -579,6 +579,7 @@ def find_match_brackets(search, opening='<', closing='>'):
Example:
'Foo<T>::iterator<U>''
returns 5
+
"""
index = search.find(opening)
if index == -1:
diff --git a/buildscripts/idl/idl/errors.py b/buildscripts/idl/idl/errors.py
index 4efd18797f9..47cd8ecf3f4 100644
--- a/buildscripts/idl/idl/errors.py
+++ b/buildscripts/idl/idl/errors.py
@@ -37,7 +37,6 @@ import inspect
import os
import sys
from typing import List, Union
-from yaml import nodes
import yaml
from . import common
diff --git a/buildscripts/linter/git_base.py b/buildscripts/linter/git_base.py
index f7eaecae95c..f54bc8e87c5 100644
--- a/buildscripts/linter/git_base.py
+++ b/buildscripts/linter/git_base.py
@@ -236,6 +236,7 @@ class GitException(Exception):
process_args: a list containing the git command and arguments (includes 'git' as its first
element) that were run, if any.
stderr: the error output of the git command.
+
"""
def __init__( # pylint: disable=too-many-arguments
@@ -258,6 +259,7 @@ class GitCommandResult(object):
returncode: the return code.
stdout: the output of the command.
stderr: the error output of the command.
+
"""
def __init__( # pylint: disable=too-many-arguments
diff --git a/buildscripts/linter/parallel.py b/buildscripts/linter/parallel.py
index 8c38f6a3294..25a6f0d7e75 100644
--- a/buildscripts/linter/parallel.py
+++ b/buildscripts/linter/parallel.py
@@ -9,7 +9,11 @@ from typing import Any, Callable, List
def parallel_process(items, func):
# type: (List[Any], Callable[[Any], bool]) -> bool
- """Run a set of work items to completion and wait."""
+ """
+ Run a set of work items to completion and wait.
+
+ :returns whether all tasks were successful.
+ """
try:
cpus = cpu_count()
except NotImplementedError:
@@ -17,20 +21,16 @@ def parallel_process(items, func):
task_queue = queue.Queue() # type: queue.Queue
- # Use a list so that worker function will capture this variable
- pp_event = threading.Event()
- pp_result = [True]
- pp_lock = threading.Lock()
+ has_failure_event = threading.Event()
def worker():
# type: () -> None
"""Worker thread to process work items in parallel."""
- while not pp_event.is_set():
+ while True:
try:
item = task_queue.get_nowait()
except queue.Empty:
# if the queue is empty, exit the worker thread
- pp_event.set()
return
try:
@@ -39,13 +39,8 @@ def parallel_process(items, func):
# Tell the queue we finished with the item
task_queue.task_done()
- # Return early if we fail, and signal we are done
if not ret:
- with pp_lock:
- pp_result[0] = False
-
- pp_event.set()
- return
+ has_failure_event.set()
# Enqueue all the work we want to process
for item in items:
@@ -62,10 +57,10 @@ def parallel_process(items, func):
# Wait for the threads to finish
# Loop with a timeout so that we can process Ctrl-C interrupts
- while not pp_event.wait(1):
+ while not queue.Empty:
time.sleep(1)
for thread in threads:
thread.join()
- return pp_result[0]
+ return not has_failure_event.is_set()
diff --git a/buildscripts/linter/pydocstyle.py b/buildscripts/linter/pydocstyle.py
index 8d6b7dde0c7..9e8a74a3857 100644
--- a/buildscripts/linter/pydocstyle.py
+++ b/buildscripts/linter/pydocstyle.py
@@ -11,7 +11,7 @@ class PyDocstyleLinter(base.LinterBase):
def __init__(self):
# type: () -> None
"""Create a pydocstyle linter."""
- super(PyDocstyleLinter, self).__init__("pydocstyle", "2.1.1")
+ super(PyDocstyleLinter, self).__init__("pydocstyle", "6.1.1")
def get_lint_version_cmd_args(self):
# type: () -> List[str]
diff --git a/buildscripts/resmokelib/logging/buildlogger.py b/buildscripts/resmokelib/logging/buildlogger.py
index 81141f3fbe6..6325ecabb89 100644
--- a/buildscripts/resmokelib/logging/buildlogger.py
+++ b/buildscripts/resmokelib/logging/buildlogger.py
@@ -27,7 +27,10 @@ _INCOMPLETE_LOG_OUTPUT = threading.Event()
def is_log_output_incomplete(): # noqa: D205,D400
- """Return true if we failed to write all of the log output to the buildlogger server, and return
+ """
+ Indicate whether the log output is incomplete.
+
+ Return true if we failed to write all of the log output to the buildlogger server, and return
false otherwise.
"""
return _INCOMPLETE_LOG_OUTPUT.is_set()
diff --git a/buildscripts/resmokelib/selector.py b/buildscripts/resmokelib/selector.py
index 04e152e9804..b9a06e0d742 100644
--- a/buildscripts/resmokelib/selector.py
+++ b/buildscripts/resmokelib/selector.py
@@ -422,6 +422,7 @@ class _Selector(object):
Args:
test_file_explorer: a TestFileExplorer instance.
+ tests_are_files: whether tests are files.
"""
self._test_file_explorer = test_file_explorer
self._tests_are_files = tests_are_files
diff --git a/buildscripts/resmokelib/testing/hooks/background_job.py b/buildscripts/resmokelib/testing/hooks/background_job.py
index 39daeffb100..92dbb5437a4 100644
--- a/buildscripts/resmokelib/testing/hooks/background_job.py
+++ b/buildscripts/resmokelib/testing/hooks/background_job.py
@@ -60,8 +60,10 @@ class _BackgroundJob(threading.Thread): # pylint: disable=too-many-instance-att
self.join()
def pause(self): # noqa: D205,D400
- """Signal the background thread that it should stop executing 'self._hook_test_case', and
- wait until the current execution has finished.
+ """
+ Signal the background thread that it should stop executing 'self._hook_test_case'.
+
+ Wait until the current execution has finished.
"""
self._hook_test_case.signal_stop_test()
with self._lock:
diff --git a/buildscripts/resmokelib/testing/hooks/stepdown.py b/buildscripts/resmokelib/testing/hooks/stepdown.py
index abc0ec908ef..c09602baee8 100644
--- a/buildscripts/resmokelib/testing/hooks/stepdown.py
+++ b/buildscripts/resmokelib/testing/hooks/stepdown.py
@@ -46,6 +46,9 @@ class ContinuousStepdown(interface.Hook): # pylint: disable=too-many-instance-a
use_stepdown_permitted_file: use a file to control if stepdown thread should do a stepdown.
wait_for_mongos_retarget: whether to run validate on all mongoses for each collection
in each database, after pausing the stepdown thread.
+ auth_options: dictionary of auth options.
+ background_reconfig: whether to conduct reconfig in the background.
+ should_downgrade: whether dowgrades should be performed as part of the stepdown.
Note that the "terminate" and "kill" arguments are named after the "SIGTERM" and
"SIGKILL" signals that are used to stop the process. On Windows, there are no signals,
diff --git a/etc/pip/components/core.req b/etc/pip/components/core.req
index 2d6490469e4..d73d60dcd9b 100644
--- a/etc/pip/components/core.req
+++ b/etc/pip/components/core.req
@@ -2,4 +2,5 @@
psutil <= 5.8.0
pymongo >= 3.9, < 4.0
PyYAML >= 3.0.0, <= 6.0.0
+types-PyYAML ~= 6.0.5
requests >= 2.0.0, <= 2.26.0
diff --git a/etc/pip/components/jiraclient.req b/etc/pip/components/jiraclient.req
index 1e18fadee5c..760a5c46684 100644
--- a/etc/pip/components/jiraclient.req
+++ b/etc/pip/components/jiraclient.req
@@ -2,5 +2,4 @@
jira <= 3.1.1
requests-oauth <= 0.4.1
PyJWT <= 2.3.0 # https://github.com/pycontribs/jira/issues/247
-cryptography == 2.3 # Needed for oauthlib to use RSAAlgorithm # Version locked - see SERVER-36618
# We are omitting pycrypto based on https://github.com/pycontribs/jira/pull/629
diff --git a/etc/pip/components/lint.req b/etc/pip/components/lint.req
index a517075f717..9e04fbdea6c 100644
--- a/etc/pip/components/lint.req
+++ b/etc/pip/components/lint.req
@@ -1,8 +1,8 @@
# Linters
# Note: These versions are checked by python modules in buildscripts/linter/
GitPython ~= 3.1.7
-mypy < 0.900; python_version > "3.5"
-pydocstyle == 2.1.1
+mypy ~= 0.942
+pydocstyle == 6.1.1
pylint == 2.7.2
structlog ~= 19.2.0
typing <= 3.7.4.3
diff --git a/etc/pip/components/platform.req b/etc/pip/components/platform.req
index b351147e579..10bb44fb08f 100644
--- a/etc/pip/components/platform.req
+++ b/etc/pip/components/platform.req
@@ -2,3 +2,4 @@
pypiwin32>=223; sys_platform == "win32" and python_version > "3"
pywin32>=225; sys_platform == "win32" and python_version > "3"
+cryptography == 2.3; platform_machine == "s390x" or platform_machine == "ppc64le" # Needed for oauthlib to use RSAAlgorithm # Version locked - see SERVER-36618