diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 15b0ac83c..69a2ace92 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 diff --git a/benchmarks/cluster_start.py b/benchmarks/cluster_start.py index 2ff715675..aafbb5c15 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 99eeff0c8..f73270813 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 ce8a23d3e..7dfed2aa1 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 37245760b..8e2426b03 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 0a5c6a162..450ccb020 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 8b7916942..b5a0f5f99 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 2a0159e90..1b08507e6 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 76f56bde6..2e96a7e0b 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 e0bb6dcad..34fd1abe5 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 d39e2cdba..2bd21d86e 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 c849c78ac..e480109ea 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 8f46ba795..d49199dab 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 d928b25bc..eef7a31bb 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 0c158b23a..57a154714 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 fe1284683..bbf05dce0 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 b0ddbe702..e6ebaac6f 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 2cbcd19c6..109269d8c 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 df46f96d6..960792acf 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 ba1a80166..92b5d03ee 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 05947d8b9..f9f67cd66 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 a34843ba1..73c821b08 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 7663f6ffd..1b76bf1d7 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 96861e65b..dab324b91 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 f2c7aaec3..25ed377f3 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 87a2c27a1..18991db7d 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 a6a4b6090..378711492 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 a6575f5b9..bcece71fb 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 93951322a..e6d009ac3 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 fc0cd0a71..8c59723f3 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 a6c5d3459..f2beb8c94 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 b665b372d..af86f6017 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 554605f56..8f85fb4a7 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 efc1cd6a8..1dd76c4c7 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 999ffda9d..c7e13b5ec 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 473ce008e..c27846bcb 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 9f81b721e..47dc21279 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 2d11f8549..542aeb9e9 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 b1c2c874b..876efc02c 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 4c90f0fd3..400cd642a 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 0b3068a94..482378449 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 2008e700d..aaa430c95 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 34488fba5..f972229ab 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 c6a82ed35..e9ba7f704 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 d48ffaae3..36f5ad1ca 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 e641abedf..544158f65 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 80d107765..ca0828a42 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 0db1fa4d8..6ef790d7a 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 f2929d3cd..fbea36e2e 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 8f21fba00..bf8635d26 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 0100b7495..74ba3384c 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 29f7bb84d..102151c32 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 f3effdc24..ca3522779 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 e8eeba95e..5221d9fc6 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 5108050d2..8ce65d63f 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 65c81c639..dc9eeef99 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 7c13b208a..95615ba4f 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 42832ff2f..4bbdbb548 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 2cb15ced9..f0ec2d6b4 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 190205d03..4061c7725 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 08ced16ed..542bc8d4e 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 8ca5a81cb..fe019203e 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 d38a72382..4f176ded4 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 74a81e4b9..46f614560 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 708a40418..143708133 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 8e9a96e81..9a4023a97 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 99a6ecb2c..c3cdbf5c0 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 c9cc659ff..d94b59e7e 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)