From 51685ebc1d3937e6cdd1123eb4df96c024f18474 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 20:31:42 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.12.1 → 24.1.1](https://github.com/psf/black/compare/23.12.1...24.1.1) - [github.com/PyCQA/flake8: 6.1.0 → 7.0.0](https://github.com/PyCQA/flake8/compare/6.1.0...7.0.0) - [github.com/pre-commit/mirrors-eslint: v9.0.0-alpha.0 → v9.0.0-alpha.2](https://github.com/pre-commit/mirrors-eslint/compare/v9.0.0-alpha.0...v9.0.0-alpha.2) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 15b0ac83..69a2ace9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: - id: isort exclude: setupbase.py - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.1.1 hooks: - id: black exclude: setupbase.py @@ -24,7 +24,7 @@ repos: hooks: - id: prettier - repo: https://github.com/PyCQA/flake8 - rev: "6.1.0" + rev: "7.0.0" hooks: - id: flake8 - repo: https://github.com/pre-commit/pre-commit-hooks @@ -35,7 +35,7 @@ repos: - id: check-executables-have-shebangs - id: requirements-txt-fixer - repo: https://github.com/pre-commit/mirrors-eslint - rev: v9.0.0-alpha.0 + rev: v9.0.0-alpha.2 hooks: - id: eslint files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx From 95dbcbb3301bf834fdc9c30dd3358d28e0c646dc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 20:32:25 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- benchmarks/cluster_start.py | 32 +++++++++++++-------- benchmarks/gcloud_setup.py | 14 +++++---- docs/source/examples/customresults.py | 1 + docs/source/examples/dagdeps.py | 1 + docs/source/examples/fetchparse.py | 1 + docs/source/examples/interengine/bintree.py | 1 + docs/source/examples/iopubwatcher.py | 1 + docs/source/examples/itermapresult.py | 1 + docs/source/examples/nwmerge.py | 1 + docs/source/examples/phistogram.py | 1 + docs/source/examples/pi/parallelpi.py | 1 + docs/source/examples/pi/pidigits.py | 1 + hatch_build.py | 1 + ipyparallel/__init__.py | 1 + ipyparallel/_async.py | 1 + ipyparallel/apps/baseapp.py | 1 + ipyparallel/apps/launcher.py | 1 + ipyparallel/apps/logwatcher.py | 1 + ipyparallel/client/_joblib.py | 1 + ipyparallel/client/asyncresult.py | 1 + ipyparallel/client/client.py | 1 + ipyparallel/client/futures.py | 1 + ipyparallel/client/magics.py | 1 + ipyparallel/client/map.py | 1 + ipyparallel/client/remotefunction.py | 1 + ipyparallel/client/view.py | 1 + ipyparallel/cluster/_winhpcjob.py | 1 + ipyparallel/cluster/cluster.py | 1 + ipyparallel/cluster/launcher.py | 1 + ipyparallel/controller/app.py | 12 ++++---- ipyparallel/controller/dependency.py | 1 + ipyparallel/controller/dictdb.py | 1 + ipyparallel/controller/hub.py | 1 + ipyparallel/controller/scheduler.py | 1 + ipyparallel/controller/sqlitedb.py | 1 + ipyparallel/engine/datapub.py | 1 + ipyparallel/engine/kernel.py | 1 + ipyparallel/engine/nanny.py | 1 + ipyparallel/error.py | 1 + ipyparallel/joblib.py | 1 + ipyparallel/nbextension/__init__.py | 1 + ipyparallel/nbextension/base.py | 1 + ipyparallel/nbextension/handlers.py | 1 + ipyparallel/nbextension/install.py | 1 + ipyparallel/serialize/canning.py | 1 + ipyparallel/serialize/codeutil.py | 1 + ipyparallel/serialize/serialize.py | 1 + ipyparallel/tests/__init__.py | 1 + ipyparallel/tests/clienttest.py | 1 + ipyparallel/tests/conftest.py | 1 + ipyparallel/tests/test_apps.py | 1 + ipyparallel/tests/test_async.py | 1 + ipyparallel/tests/test_asyncresult.py | 1 + ipyparallel/tests/test_client.py | 1 + ipyparallel/tests/test_db.py | 1 + ipyparallel/tests/test_dependency.py | 1 + ipyparallel/tests/test_executor.py | 1 + ipyparallel/tests/test_launcher.py | 1 + ipyparallel/tests/test_lbview.py | 1 + ipyparallel/tests/test_magics.py | 1 + ipyparallel/tests/test_mongodb.py | 1 + ipyparallel/tests/test_remotefunction.py | 1 + ipyparallel/tests/test_serialize.py | 1 + ipyparallel/tests/test_view.py | 1 + ipyparallel/tests/test_view_broadcast.py | 1 + ipyparallel/traitlets.py | 1 + ipyparallel/util.py | 7 +++-- 67 files changed, 102 insertions(+), 26 deletions(-) diff --git a/benchmarks/cluster_start.py b/benchmarks/cluster_start.py index 2ff71567..aafbb5c1 100644 --- a/benchmarks/cluster_start.py +++ b/benchmarks/cluster_start.py @@ -19,12 +19,16 @@ def start_cluster(depth, number_of_engines, path='', log_output_to_file=False): ps = [ Popen( ipcontroller_cmd.split(), - stdout=open('ipcontroller_output.log', 'a+') - if log_output_to_file - else sys.stdout, - stderr=open('ipcontroller_error_output.log', 'a+') - if log_output_to_file - else sys.stdout, + stdout=( + open('ipcontroller_output.log', 'a+') + if log_output_to_file + else sys.stdout + ), + stderr=( + open('ipcontroller_error_output.log', 'a+') + if log_output_to_file + else sys.stdout + ), stdin=sys.stdin, ) ] @@ -35,12 +39,16 @@ def start_cluster(depth, number_of_engines, path='', log_output_to_file=False): ps.append( Popen( ipengine_cmd.split(), - stdout=open('ipengine_output.log', 'a+') - if log_output_to_file - else sys.stdout, - stderr=open('ipengine_error_output.log', 'a+') - if log_output_to_file - else sys.stdout, + stdout=( + open('ipengine_output.log', 'a+') + if log_output_to_file + else sys.stdout + ), + stderr=( + open('ipengine_error_output.log', 'a+') + if log_output_to_file + else sys.stdout + ), stdin=sys.stdin, ) ) diff --git a/benchmarks/gcloud_setup.py b/benchmarks/gcloud_setup.py index 99eeff0c..f7327081 100755 --- a/benchmarks/gcloud_setup.py +++ b/benchmarks/gcloud_setup.py @@ -50,11 +50,15 @@ def delete_all_instances(): def gcloud_run(*args, block=True): cmd = ["gcloud", "compute"] + list(args) print(f'$ {" ".join(cmd)}') - check_call( - cmd - # stdout=open(get_gcloud_log_file_name(instance_name) + ".log", "a+"), - # stderr=open(f"{get_gcloud_log_file_name(instance_name)}_error.out", "a+"), - ) if block else Popen(cmd) + ( + check_call( + cmd + # stdout=open(get_gcloud_log_file_name(instance_name) + ".log", "a+"), + # stderr=open(f"{get_gcloud_log_file_name(instance_name)}_error.out", "a+"), + ) + if block + else Popen(cmd) + ) def copy_files_to_instance(instance_name, *file_names, directory="~"): diff --git a/docs/source/examples/customresults.py b/docs/source/examples/customresults.py index ce8a23d3..7dfed2aa 100644 --- a/docs/source/examples/customresults.py +++ b/docs/source/examples/customresults.py @@ -9,6 +9,7 @@ ------- * MinRK """ + import random import ipyparallel as ipp diff --git a/docs/source/examples/dagdeps.py b/docs/source/examples/dagdeps.py index 37245760..8e2426b0 100644 --- a/docs/source/examples/dagdeps.py +++ b/docs/source/examples/dagdeps.py @@ -6,6 +6,7 @@ ------- * MinRK """ + from random import randint import networkx as nx diff --git a/docs/source/examples/fetchparse.py b/docs/source/examples/fetchparse.py index 0a5c6a16..450ccb02 100644 --- a/docs/source/examples/fetchparse.py +++ b/docs/source/examples/fetchparse.py @@ -10,6 +10,7 @@ ipcluster start -n 4 """ + import sys import time diff --git a/docs/source/examples/interengine/bintree.py b/docs/source/examples/interengine/bintree.py index 8b791694..b5a0f5f9 100644 --- a/docs/source/examples/interengine/bintree.py +++ b/docs/source/examples/interengine/bintree.py @@ -6,6 +6,7 @@ Provides parallel [all]reduce functionality """ + import re import socket from functools import reduce diff --git a/docs/source/examples/iopubwatcher.py b/docs/source/examples/iopubwatcher.py index 2a0159e9..1b08507e 100644 --- a/docs/source/examples/iopubwatcher.py +++ b/docs/source/examples/iopubwatcher.py @@ -13,6 +13,7 @@ ------- * MinRK """ + import json import sys diff --git a/docs/source/examples/itermapresult.py b/docs/source/examples/itermapresult.py index 76f56bde..2e96a7e0 100644 --- a/docs/source/examples/itermapresult.py +++ b/docs/source/examples/itermapresult.py @@ -17,6 +17,7 @@ ------- * MinRK """ + import time import ipyparallel as ipp diff --git a/docs/source/examples/nwmerge.py b/docs/source/examples/nwmerge.py index e0bb6dca..34fd1abe 100644 --- a/docs/source/examples/nwmerge.py +++ b/docs/source/examples/nwmerge.py @@ -1,5 +1,6 @@ """Example showing how to merge multiple remote data streams. """ + # Slightly modified version of: # https://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/511509 import heapq diff --git a/docs/source/examples/phistogram.py b/docs/source/examples/phistogram.py index d39e2cdb..2bd21d86 100644 --- a/docs/source/examples/phistogram.py +++ b/docs/source/examples/phistogram.py @@ -1,4 +1,5 @@ """Parallel histogram function""" + from ipyparallel import Reference diff --git a/docs/source/examples/pi/parallelpi.py b/docs/source/examples/pi/parallelpi.py index c849c78a..e480109e 100644 --- a/docs/source/examples/pi/parallelpi.py +++ b/docs/source/examples/pi/parallelpi.py @@ -15,6 +15,7 @@ and the files used will be downloaded if they are not in the working directory of the IPython engines. """ + from timeit import default_timer as clock from matplotlib import pyplot as plt diff --git a/docs/source/examples/pi/pidigits.py b/docs/source/examples/pi/pidigits.py index 8f46ba79..d49199da 100644 --- a/docs/source/examples/pi/pidigits.py +++ b/docs/source/examples/pi/pidigits.py @@ -14,6 +14,7 @@ If the digits of pi are truly random, these frequencies should be equal. """ + import os from urllib.request import urlretrieve diff --git a/hatch_build.py b/hatch_build.py index d928b25b..eef7a31b 100644 --- a/hatch_build.py +++ b/hatch_build.py @@ -1,4 +1,5 @@ """Custom build script for hatch backend""" + import glob import os import subprocess diff --git a/ipyparallel/__init__.py b/ipyparallel/__init__.py index 0c158b23..57a15471 100644 --- a/ipyparallel/__init__.py +++ b/ipyparallel/__init__.py @@ -1,4 +1,5 @@ """The IPython ZMQ-based parallel computing interface.""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. # export return_when constants diff --git a/ipyparallel/_async.py b/ipyparallel/_async.py index fe128468..bbf05dce 100644 --- a/ipyparallel/_async.py +++ b/ipyparallel/_async.py @@ -1,4 +1,5 @@ """Async utilities""" + import asyncio import concurrent.futures import inspect diff --git a/ipyparallel/apps/baseapp.py b/ipyparallel/apps/baseapp.py index b0ddbe70..e6ebaac6 100644 --- a/ipyparallel/apps/baseapp.py +++ b/ipyparallel/apps/baseapp.py @@ -1,6 +1,7 @@ """ The Base Application class for ipyparallel apps """ + import logging import os import re diff --git a/ipyparallel/apps/launcher.py b/ipyparallel/apps/launcher.py index 2cbcd19c..109269d8 100644 --- a/ipyparallel/apps/launcher.py +++ b/ipyparallel/apps/launcher.py @@ -1,4 +1,5 @@ """Deprecated import for ipyparallel.cluster.launcher""" + import warnings from ipyparallel.cluster.launcher import * # noqa diff --git a/ipyparallel/apps/logwatcher.py b/ipyparallel/apps/logwatcher.py index df46f96d..960792ac 100644 --- a/ipyparallel/apps/logwatcher.py +++ b/ipyparallel/apps/logwatcher.py @@ -1,6 +1,7 @@ """ A logger object that consolidates messages incoming from ipcluster processes. """ + import logging import zmq diff --git a/ipyparallel/client/_joblib.py b/ipyparallel/client/_joblib.py index ba1a8016..92b5d03e 100644 --- a/ipyparallel/client/_joblib.py +++ b/ipyparallel/client/_joblib.py @@ -1,4 +1,5 @@ """joblib parallel backend for IPython Parallel""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from joblib.parallel import AutoBatchingMixin, ParallelBackendBase diff --git a/ipyparallel/client/asyncresult.py b/ipyparallel/client/asyncresult.py index 05947d8b..f9f67cd6 100644 --- a/ipyparallel/client/asyncresult.py +++ b/ipyparallel/client/asyncresult.py @@ -1,4 +1,5 @@ """AsyncResult objects for the client""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import concurrent.futures diff --git a/ipyparallel/client/client.py b/ipyparallel/client/client.py index a34843ba..73c821b0 100644 --- a/ipyparallel/client/client.py +++ b/ipyparallel/client/client.py @@ -1,4 +1,5 @@ """A semi-synchronous Client for IPython parallel""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import asyncio diff --git a/ipyparallel/client/futures.py b/ipyparallel/client/futures.py index 7663f6ff..1b76bf1d 100644 --- a/ipyparallel/client/futures.py +++ b/ipyparallel/client/futures.py @@ -1,4 +1,5 @@ """Future-related utils""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import sys diff --git a/ipyparallel/client/magics.py b/ipyparallel/client/magics.py index 96861e65..dab324b9 100644 --- a/ipyparallel/client/magics.py +++ b/ipyparallel/client/magics.py @@ -25,6 +25,7 @@ {CONFIG_DOC} """ + import time from contextlib import contextmanager diff --git a/ipyparallel/client/map.py b/ipyparallel/client/map.py index f2c7aaec..25ed377f 100644 --- a/ipyparallel/client/map.py +++ b/ipyparallel/client/map.py @@ -3,6 +3,7 @@ Scattering consists of partitioning a sequence and sending the various pieces to individual nodes in a cluster. """ + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import sys diff --git a/ipyparallel/client/remotefunction.py b/ipyparallel/client/remotefunction.py index 87a2c27a..18991db7 100644 --- a/ipyparallel/client/remotefunction.py +++ b/ipyparallel/client/remotefunction.py @@ -1,4 +1,5 @@ """Remote Functions and decorators for Views.""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import sys diff --git a/ipyparallel/client/view.py b/ipyparallel/client/view.py index a6a4b609..37871149 100644 --- a/ipyparallel/client/view.py +++ b/ipyparallel/client/view.py @@ -1,4 +1,5 @@ """Views of remote engines.""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import builtins diff --git a/ipyparallel/cluster/_winhpcjob.py b/ipyparallel/cluster/_winhpcjob.py index a6575f5b..bcece71f 100644 --- a/ipyparallel/cluster/_winhpcjob.py +++ b/ipyparallel/cluster/_winhpcjob.py @@ -2,6 +2,7 @@ Job and task components for writing .xml files that the Windows HPC Server 2008 can use to start jobs. """ + import os import re import uuid diff --git a/ipyparallel/cluster/cluster.py b/ipyparallel/cluster/cluster.py index 93951322..e6d009ac 100644 --- a/ipyparallel/cluster/cluster.py +++ b/ipyparallel/cluster/cluster.py @@ -4,6 +4,7 @@ starts/stops/polls controllers, engines, etc. """ + import asyncio import atexit import glob diff --git a/ipyparallel/cluster/launcher.py b/ipyparallel/cluster/launcher.py index fc0cd0a7..8c59723f 100644 --- a/ipyparallel/cluster/launcher.py +++ b/ipyparallel/cluster/launcher.py @@ -1,4 +1,5 @@ """Facilities for launching IPython Parallel processes asynchronously.""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import asyncio diff --git a/ipyparallel/controller/app.py b/ipyparallel/controller/app.py index a6c5d345..f2beb8c9 100755 --- a/ipyparallel/controller/app.py +++ b/ipyparallel/controller/app.py @@ -923,9 +923,9 @@ def init_hub(self): # save to new json config files base = { 'key': self.session.key.decode('ascii'), - 'curve_serverkey': self.curve_publickey.decode("ascii") - if self.enable_curve - else None, + 'curve_serverkey': ( + self.curve_publickey.decode("ascii") if self.enable_curve else None + ), 'location': self.location, 'pack': self.session.packer, 'unpack': self.session.unpacker, @@ -982,9 +982,9 @@ def get_python_scheduler_args( 'mon_addr': monitor_url, 'not_addr': disambiguate_url(self.client_url('notification')), 'reg_addr': disambiguate_url(self.client_url('registration')), - 'identity': identity - if identity is not None - else bytes(scheduler_name, 'utf8'), + 'identity': ( + identity if identity is not None else bytes(scheduler_name, 'utf8') + ), 'logname': logname, 'loglevel': self.log_level, 'log_url': self.log_url, diff --git a/ipyparallel/controller/dependency.py b/ipyparallel/controller/dependency.py index b665b372..af86f601 100644 --- a/ipyparallel/controller/dependency.py +++ b/ipyparallel/controller/dependency.py @@ -1,5 +1,6 @@ """Dependency utilities """ + from types import ModuleType from ipyparallel.client.asyncresult import AsyncResult diff --git a/ipyparallel/controller/dictdb.py b/ipyparallel/controller/dictdb.py index 554605f5..8f85fb4a 100644 --- a/ipyparallel/controller/dictdb.py +++ b/ipyparallel/controller/dictdb.py @@ -32,6 +32,7 @@ $lt,$gt,$lte,$gte,$ne,$in,$nin,$all,$mod,$exists """ + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import copy diff --git a/ipyparallel/controller/hub.py b/ipyparallel/controller/hub.py index efc1cd6a..1dd76c4c 100644 --- a/ipyparallel/controller/hub.py +++ b/ipyparallel/controller/hub.py @@ -3,6 +3,7 @@ This is the master object that handles connections from engines and clients, and monitors traffic through the various queues. """ + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import inspect diff --git a/ipyparallel/controller/scheduler.py b/ipyparallel/controller/scheduler.py index 999ffda9..c7e13b5e 100644 --- a/ipyparallel/controller/scheduler.py +++ b/ipyparallel/controller/scheduler.py @@ -4,6 +4,7 @@ nor does it check msg_id DAG dependencies. For those, a slightly slower Python Scheduler exists. """ + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import logging diff --git a/ipyparallel/controller/sqlitedb.py b/ipyparallel/controller/sqlitedb.py index 473ce008..c27846bc 100644 --- a/ipyparallel/controller/sqlitedb.py +++ b/ipyparallel/controller/sqlitedb.py @@ -1,4 +1,5 @@ """A TaskRecord backend using sqlite3""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import json diff --git a/ipyparallel/engine/datapub.py b/ipyparallel/engine/datapub.py index 9f81b721..47dc2127 100644 --- a/ipyparallel/engine/datapub.py +++ b/ipyparallel/engine/datapub.py @@ -1,4 +1,5 @@ """Publishing native (typically pickled) objects.""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from ipykernel.jsonutil import json_clean diff --git a/ipyparallel/engine/kernel.py b/ipyparallel/engine/kernel.py index 2d11f854..542aeb9e 100644 --- a/ipyparallel/engine/kernel.py +++ b/ipyparallel/engine/kernel.py @@ -1,4 +1,5 @@ """IPython kernel for parallel computing""" + import asyncio import inspect import sys diff --git a/ipyparallel/engine/nanny.py b/ipyparallel/engine/nanny.py index b1c2c874..876efc02 100644 --- a/ipyparallel/engine/nanny.py +++ b/ipyparallel/engine/nanny.py @@ -13,6 +13,7 @@ only engine *sets* - Cluster API can efficiently signal all engines via mpiexec """ + import asyncio import logging import os diff --git a/ipyparallel/error.py b/ipyparallel/error.py index 4c90f0fd..400cd642 100644 --- a/ipyparallel/error.py +++ b/ipyparallel/error.py @@ -5,6 +5,7 @@ .. inheritance-diagram:: ipyparallel.error :parts: 3 """ + import builtins import sys import traceback diff --git a/ipyparallel/joblib.py b/ipyparallel/joblib.py index 0b3068a9..48237844 100644 --- a/ipyparallel/joblib.py +++ b/ipyparallel/joblib.py @@ -16,6 +16,7 @@ .. versionadded:: 5.1 """ + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from joblib.parallel import register_parallel_backend diff --git a/ipyparallel/nbextension/__init__.py b/ipyparallel/nbextension/__init__.py index 2008e700..aaa430c9 100644 --- a/ipyparallel/nbextension/__init__.py +++ b/ipyparallel/nbextension/__init__.py @@ -1,4 +1,5 @@ """Jupyter server extension(s)""" + import warnings diff --git a/ipyparallel/nbextension/base.py b/ipyparallel/nbextension/base.py index 34488fba..f972229a 100644 --- a/ipyparallel/nbextension/base.py +++ b/ipyparallel/nbextension/base.py @@ -1,4 +1,5 @@ """Place to put the base Handler""" + import warnings from functools import lru_cache diff --git a/ipyparallel/nbextension/handlers.py b/ipyparallel/nbextension/handlers.py index c6a82ed3..e9ba7f70 100644 --- a/ipyparallel/nbextension/handlers.py +++ b/ipyparallel/nbextension/handlers.py @@ -1,4 +1,5 @@ """Tornado handlers for IPython cluster web service.""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import json diff --git a/ipyparallel/nbextension/install.py b/ipyparallel/nbextension/install.py index d48ffaae..36f5ad1c 100644 --- a/ipyparallel/nbextension/install.py +++ b/ipyparallel/nbextension/install.py @@ -2,6 +2,7 @@ Only applicable for notebook < 7 """ + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from jupyter_core.paths import jupyter_config_dir diff --git a/ipyparallel/serialize/canning.py b/ipyparallel/serialize/canning.py index e641abed..544158f6 100644 --- a/ipyparallel/serialize/canning.py +++ b/ipyparallel/serialize/canning.py @@ -1,4 +1,5 @@ """Pickle-related utilities..""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import copy diff --git a/ipyparallel/serialize/codeutil.py b/ipyparallel/serialize/codeutil.py index 80d10776..ca0828a4 100644 --- a/ipyparallel/serialize/codeutil.py +++ b/ipyparallel/serialize/codeutil.py @@ -7,6 +7,7 @@ Reference: A. Tremols, P Cogolo, "Python Cookbook," p 302-305 """ + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import copyreg diff --git a/ipyparallel/serialize/serialize.py b/ipyparallel/serialize/serialize.py index 0db1fa4d..6ef790d7 100644 --- a/ipyparallel/serialize/serialize.py +++ b/ipyparallel/serialize/serialize.py @@ -1,4 +1,5 @@ """serialization utilities for apply messages""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. diff --git a/ipyparallel/tests/__init__.py b/ipyparallel/tests/__init__.py index f2929d3c..fbea36e2 100644 --- a/ipyparallel/tests/__init__.py +++ b/ipyparallel/tests/__init__.py @@ -1,4 +1,5 @@ """toplevel setup/teardown for parallel tests.""" + import asyncio import os import time diff --git a/ipyparallel/tests/clienttest.py b/ipyparallel/tests/clienttest.py index 8f21fba0..bf8635d2 100644 --- a/ipyparallel/tests/clienttest.py +++ b/ipyparallel/tests/clienttest.py @@ -1,4 +1,5 @@ """base class for parallel client tests""" + import os import signal import sys diff --git a/ipyparallel/tests/conftest.py b/ipyparallel/tests/conftest.py index 0100b749..74ba3384 100644 --- a/ipyparallel/tests/conftest.py +++ b/ipyparallel/tests/conftest.py @@ -1,4 +1,5 @@ """pytest fixtures""" + import inspect import logging import os diff --git a/ipyparallel/tests/test_apps.py b/ipyparallel/tests/test_apps.py index 29f7bb84..102151c3 100644 --- a/ipyparallel/tests/test_apps.py +++ b/ipyparallel/tests/test_apps.py @@ -1,4 +1,5 @@ """Test CLI application behavior""" + import glob import json import os diff --git a/ipyparallel/tests/test_async.py b/ipyparallel/tests/test_async.py index f3effdc2..ca352277 100644 --- a/ipyparallel/tests/test_async.py +++ b/ipyparallel/tests/test_async.py @@ -1,4 +1,5 @@ """tests for async utilities""" + import pytest from ipyparallel._async import AsyncFirst diff --git a/ipyparallel/tests/test_asyncresult.py b/ipyparallel/tests/test_asyncresult.py index e8eeba95..5221d9fc 100644 --- a/ipyparallel/tests/test_asyncresult.py +++ b/ipyparallel/tests/test_asyncresult.py @@ -1,4 +1,5 @@ """Tests for asyncresult.py""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import os diff --git a/ipyparallel/tests/test_client.py b/ipyparallel/tests/test_client.py index 5108050d..8ce65d63 100644 --- a/ipyparallel/tests/test_client.py +++ b/ipyparallel/tests/test_client.py @@ -1,4 +1,5 @@ """Tests for parallel client.py""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import os diff --git a/ipyparallel/tests/test_db.py b/ipyparallel/tests/test_db.py index 65c81c63..dc9eeef9 100644 --- a/ipyparallel/tests/test_db.py +++ b/ipyparallel/tests/test_db.py @@ -1,4 +1,5 @@ """Tests for db backends""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import logging diff --git a/ipyparallel/tests/test_dependency.py b/ipyparallel/tests/test_dependency.py index 7c13b208..95615ba4 100644 --- a/ipyparallel/tests/test_dependency.py +++ b/ipyparallel/tests/test_dependency.py @@ -1,4 +1,5 @@ """Tests for dependency.py""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import ipyparallel as ipp diff --git a/ipyparallel/tests/test_executor.py b/ipyparallel/tests/test_executor.py index 42832ff2..4bbdbb54 100644 --- a/ipyparallel/tests/test_executor.py +++ b/ipyparallel/tests/test_executor.py @@ -1,4 +1,5 @@ """Tests for Executor API""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import time diff --git a/ipyparallel/tests/test_launcher.py b/ipyparallel/tests/test_launcher.py index 2cb15ced..f0ec2d6b 100644 --- a/ipyparallel/tests/test_launcher.py +++ b/ipyparallel/tests/test_launcher.py @@ -3,6 +3,7 @@ Doesn't actually start any subprocesses, but goes through the motions of constructing objects, which should test basic config. """ + import logging import os import sys diff --git a/ipyparallel/tests/test_lbview.py b/ipyparallel/tests/test_lbview.py index 190205d0..4061c772 100644 --- a/ipyparallel/tests/test_lbview.py +++ b/ipyparallel/tests/test_lbview.py @@ -1,4 +1,5 @@ """test LoadBalancedView objects""" + import time from itertools import count diff --git a/ipyparallel/tests/test_magics.py b/ipyparallel/tests/test_magics.py index 08ced16e..542bc8d4 100644 --- a/ipyparallel/tests/test_magics.py +++ b/ipyparallel/tests/test_magics.py @@ -1,4 +1,5 @@ """Test Parallel magics""" + import re import signal import sys diff --git a/ipyparallel/tests/test_mongodb.py b/ipyparallel/tests/test_mongodb.py index 8ca5a81c..fe019203 100644 --- a/ipyparallel/tests/test_mongodb.py +++ b/ipyparallel/tests/test_mongodb.py @@ -1,4 +1,5 @@ """Tests for mongodb backend""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import os diff --git a/ipyparallel/tests/test_remotefunction.py b/ipyparallel/tests/test_remotefunction.py index d38a7238..4f176ded 100644 --- a/ipyparallel/tests/test_remotefunction.py +++ b/ipyparallel/tests/test_remotefunction.py @@ -1,4 +1,5 @@ """Tests for remote functions""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import ipyparallel as ipp diff --git a/ipyparallel/tests/test_serialize.py b/ipyparallel/tests/test_serialize.py index 74a81e4b..46f61456 100644 --- a/ipyparallel/tests/test_serialize.py +++ b/ipyparallel/tests/test_serialize.py @@ -1,4 +1,5 @@ """test serialization tools""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import pickle diff --git a/ipyparallel/tests/test_view.py b/ipyparallel/tests/test_view.py index 708a4041..14370813 100644 --- a/ipyparallel/tests/test_view.py +++ b/ipyparallel/tests/test_view.py @@ -1,4 +1,5 @@ """test View objects""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import base64 diff --git a/ipyparallel/tests/test_view_broadcast.py b/ipyparallel/tests/test_view_broadcast.py index 8e9a96e8..9a4023a9 100644 --- a/ipyparallel/tests/test_view_broadcast.py +++ b/ipyparallel/tests/test_view_broadcast.py @@ -1,4 +1,5 @@ """test BroadcastView objects""" + import pytest from . import test_view diff --git a/ipyparallel/traitlets.py b/ipyparallel/traitlets.py index 99a6ecb2..c3cdbf5c 100644 --- a/ipyparallel/traitlets.py +++ b/ipyparallel/traitlets.py @@ -1,4 +1,5 @@ """Custom ipyparallel trait types""" + import entrypoints from traitlets import List, TraitError, Type diff --git a/ipyparallel/util.py b/ipyparallel/util.py index c9cc659f..d94b59e7 100644 --- a/ipyparallel/util.py +++ b/ipyparallel/util.py @@ -1,4 +1,5 @@ """Some generic utilities for dealing with classes, urls, and serialization.""" + # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import asyncio @@ -488,9 +489,9 @@ def become_dask_worker(address, nanny=False, **kwargs): w = Nanny(address, **kwargs) else: w = Worker(address, **kwargs) - shell.user_ns['dask_worker'] = shell.user_ns[ - 'distributed_worker' - ] = kernel.distributed_worker = w + shell.user_ns['dask_worker'] = shell.user_ns['distributed_worker'] = ( + kernel.distributed_worker + ) = w kernel.io_loop.add_callback(w.start)