diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4949c98..4f7926c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,13 +4,22 @@ This project adheres to [Semantic Versioning](http://semver.org/).
 
 ## Unreleased
 
+### Fixed
+- Fix unintentional dependency on scikit-learn for `parallel` module tests. (#245, #303)
+
 ### Changed
 - Loosened version requirements of `pyyaml` to include `pyyaml<=5.99`. (#293)
 - Loosened version requirement of `jsonref` to include `0.2` to fix a
   DeprecationWarning under Python 3.7. (#295)
 - Changed pubnub version requirement in requirements.txt to match setup.py
   (#295)
+- Loosened version requirements of `click` to include v7 and `jsonschema`
+  to include v3. (#286, #300)
 - Surfaced `civis.io.split_schema_tablename` in the Sphinx docs. (#294)
+- Loosen `joblib` version requirement to include v0.13 and add code to
+  the Civis joblib backend which newer versions of `joblib` can take
+  advantage of. Also loosed version requirement on `cloudpickle` to
+  include v1. (#296, #299)
 
 ## 1.10.0 - 2019-04-09
 ### Added
diff --git a/civis/parallel.py b/civis/parallel.py
index 47fbafd..bb67edb 100644
--- a/civis/parallel.py
+++ b/civis/parallel.py
@@ -9,6 +9,7 @@ import logging
 import os
 import pickle
 import time
+import warnings
 
 import cloudpickle
 from joblib._parallel_backends import ParallelBackendBase
@@ -23,11 +24,20 @@ from civis.compat import TemporaryDirectory
 from civis.futures import _ContainerShellExecutor, CustomScriptExecutor
 
 try:
-    from sklearn.externals.joblib import (
-        register_parallel_backend as _sklearn_reg_para_backend)
-    NO_SKLEARN = False
+    with warnings.catch_warnings():
+        # Ignore the warning: "DeprecationWarning: sklearn.externals.joblib is
+        # deprecated in 0.21 and will be removed in 0.23. Please import this
+        # functionality directly from joblib, which can be installed with:
+        # pip install joblib. If this warning is raised when loading pickled
+        # models, you may need to re-serialize those models with
+        # scikit-learn 0.21+."
+        warnings.simplefilter('ignore', DeprecationWarning)
+        from sklearn.externals.joblib import (
+            register_parallel_backend as _sklearn_reg_para_backend)
+        NO_SKLEARN = False
 except ImportError:
     NO_SKLEARN = True
+    _sklearn_reg_para_backend = None
 
 log = logging.getLogger(__name__)
 _THIS_DIR = os.path.dirname(os.path.realpath(__file__))
@@ -716,9 +726,14 @@ class _CivisBackendResult:
 
         return _fetch_result
 
-    def get(self):
+    def get(self, timeout=None):
         """Block and return the result of the job
 
+        Parameters
+        ----------
+        timeout: float, optional
+            If provided, wait this many seconds before issuing a TimeoutError
+
         Returns
         -------
         The output of the function which ``joblib`` ran via Civis
@@ -736,7 +751,7 @@ class _CivisBackendResult:
         """
         if self.result is None:
             # Wait for the script to complete.
-            wait([self._future])
+            wait([self._future], timeout=timeout)
             self.result = self._future.remote_func_output
 
         if self._future.exception() or not self._future.result_fetched:
@@ -761,11 +776,16 @@ class _CivisBackend(ParallelBackendBase):
 
     Users should interact with this through ``make_backend_factory``.
     """
+    uses_threads = False
+    supports_sharedmem = False
+    supports_timeout = True
+
     def __init__(self, setup_cmd=_DEFAULT_SETUP_CMD,
                  from_template_id=None,
                  max_submit_retries=0,
                  client=None,
                  remote_backend='sequential',
+                 nesting_level=0,
                  **executor_kwargs):
         self.setup_cmd = setup_cmd
         self.from_template_id = from_template_id
@@ -773,6 +793,7 @@ class _CivisBackend(ParallelBackendBase):
         self.client = client
         self.remote_backend = remote_backend
         self.executor_kwargs = executor_kwargs
+        self.nesting_level = nesting_level
         self._init_civis_backend()
 
     @classmethod
@@ -821,6 +842,10 @@ class _CivisBackend(ParallelBackendBase):
         if not ensure_ready:
             self.executor.shutdown(wait=False)
 
+    def terminate(self):
+        """Shutdown the workers and free the shared memory."""
+        return self.abort_everything(ensure_ready=True)
+
     def apply_async(self, func, callback=None):
         """Schedule func to be run
         """
diff --git a/requirements.txt b/requirements.txt
index 6bffa78..27a97ed 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,13 +1,13 @@
 pyyaml>=3.0,<=5.99
-click>=6.0,<=6.99
+click>=6.0,<=7
 funcsigs==1.0.2 ; python_version == '2.7'
 future>=0.16,<=0.99 ; python_version == '2.7'
 futures==3.1.1 ; python_version == '2.7'
 jsonref>=0.1,<=0.2
 requests>=2.12.0,==2.*
-jsonschema>=2.5.1,==2.*
+jsonschema>=2.5.1,<=3
 functools32>=3.2,<=3.99 ; python_version == '2.7'
 six>=1.10,<=1.99
-joblib~=0.11
+joblib>=0.11,<=0.13
 pubnub>=4.0,<=4.99
-cloudpickle~=0.2
+cloudpickle<=0.2,<=1
diff --git a/setup.py b/setup.py
index 85bb9e0..1d52c97 100644
--- a/setup.py
+++ b/setup.py
@@ -52,14 +52,14 @@ def main():
         long_description=README,
         install_requires=[
             'pyyaml>=3.0,<=5.99',
-            'click>=6.0,<=6.99',
+            'click>=6.0,<=7',
             'jsonref>=0.1.0,<=0.2',
             'requests>=2.12.0,==2.*',
-            'jsonschema>=2.5.1,==2.*',
+            'jsonschema>=2.5.1,<=3',
             'six>=1.10,<=1.99',
-            'joblib>=0.11,<=0.11.99',
+            'joblib>=0.11,<=0.13.99',
             'pubnub>=4.0,<=4.99',
-            'cloudpickle>=0.2.0,<=0.99999',
+            'cloudpickle>=0.2.0,<=1.99999',
         ],
         extras_require={
             ':python_version=="2.7"': [

Test with newer version of click and update dependencies
civis-python requires `click` version 6, but there's now a v7. We should test with it and update the `requirements.txt` file.
diff --git a/civis/tests/test_parallel.py b/civis/tests/test_parallel.py
index 846fb52..f9d75fe 100644
--- a/civis/tests/test_parallel.py
+++ b/civis/tests/test_parallel.py
@@ -13,6 +13,7 @@ import requests
 
 import civis.parallel
 from civis.futures import ContainerFuture
+from civis.tests import create_client_mock
 
 
 @pytest.fixture
@@ -67,7 +68,7 @@ def _test_retries_helper(num_failures, max_submit_retries,
                          mock_custom_exec_cls, mock_executor_cls):
 
     mock_file_to_civis.return_value = 0
-    mock_result_cls.get.return_value = 123
+    mock_result_cls.return_value.get.return_value = [123]
 
     # A function to raise fake API errors the first num_failures times it is
     # called.
@@ -87,13 +88,17 @@ def _test_retries_helper(num_failures, max_submit_retries,
         factory = civis.parallel.make_backend_template_factory(
             from_template_id=from_template_id,
             max_submit_retries=max_submit_retries,
-            client=mock.Mock())
+            client=create_client_mock())
     else:
         factory = civis.parallel.make_backend_factory(
-            max_submit_retries=max_submit_retries, client=mock.Mock())
+            max_submit_retries=max_submit_retries, client=create_client_mock())
     register_parallel_backend('civis', factory)
     with parallel_backend('civis'):
-        parallel = Parallel(n_jobs=5, pre_dispatch='n_jobs')
+        # NB: joblib >v0.11 relies on callbacks from the result object to
+        # decide when it's done consuming inputs. We've mocked the result
+        # object here, so Parallel must be called either with n_jobs=1 or
+        # pre_dispatch='all' to consume the inputs all at once.
+        parallel = Parallel(n_jobs=1, pre_dispatch='n_jobs')
         if should_fail:
             with pytest.raises(civis.parallel.JobSubmissionError):
                 parallel(delayed(sqrt)(i ** 2) for i in range(3))
@@ -116,7 +121,11 @@ def test_template_submit(mock_file, mock_result, mock_pool):
     n_calls = 3
     register_parallel_backend('civis', factory)
     with parallel_backend('civis'):
-        parallel = Parallel(n_jobs=5, pre_dispatch='n_jobs')
+        # NB: joblib >v0.11 relies on callbacks from the result object to
+        # decide when it's done consuming inputs. We've mocked the result
+        # object here, so Parallel must be called either with n_jobs=1 or
+        # pre_dispatch='all' to consume the inputs all at once.
+        parallel = Parallel(n_jobs=1, pre_dispatch='n_jobs')
         parallel(delayed(sqrt)(i ** 2) for i in range(n_calls))
 
     assert mock_file.call_count == 3, "Upload 3 functions to run"
@@ -267,7 +276,7 @@ def test_infer_update_args(mock_make_factory, mock_job):
 
 
 @mock.patch.object(civis.parallel, 'make_backend_factory')
-def test_infer_from_custom_job(mock_make_factory):
+def test_infer_from_custom_job(mock_make_factory, mock_job):
     # Test that `infer_backend_factory` can find needed
     # parameters if it's run inside a custom job created
     # from a template.
@@ -279,14 +288,13 @@ def test_infer_from_custom_job(mock_make_factory):
                                 docker_image_name='image_name',
                                 docker_image_tag='tag',
                                 repo_http_uri='cabbage', repo_ref='servant'))
-    mock_script = mock_job()
     mock_template = Response(dict(id=999, script_id=171))
 
     def _get_container(job_id):
         if int(job_id) == 42:
             return mock_custom
         elif int(job_id) == 171:
-            return mock_script
+            return mock_job
         else:
             raise ValueError("Got job_id {}".format(job_id))
 
@@ -315,7 +323,7 @@ def test_infer_from_custom_job(mock_make_factory):
                        'hidden': True,
                        'remote_backend': 'sequential'}
     for key in civis.parallel.KEYS_TO_INFER:
-        expected_kwargs[key] = mock_script[key]
+        expected_kwargs[key] = mock_job[key]
     mock_make_factory.assert_called_once_with(**expected_kwargs)
 
 

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest
3.7
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
cbor2==5.4.6
certifi @ file:///croot/certifi_1671487769961/work/certifi
charset-normalizer==3.4.1
-e git+https://github.com/civisanalytics/civis-python.git@bdd0c664cb1e92da96e616fda183c262a41aee4f#egg=civis
click==6.7
cloudpickle==0.8.1
exceptiongroup==1.2.2
idna==3.10
importlib-metadata==6.7.0
iniconfig==2.0.0
joblib==0.11
jsonref==0.2
jsonschema==2.6.0
packaging==24.0
pluggy==1.2.0
pubnub==4.8.1
pycryptodomex==3.22.0
pytest==7.4.4
PyYAML==5.4.1
requests==2.31.0
six==1.17.0
tomli==2.0.1
typing_extensions==4.7.1
urllib3==2.0.7
zipp==3.15.0

name: civis-python
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - cbor2==5.4.6
      - charset-normalizer==3.4.1
      - click==6.7
      - cloudpickle==0.8.1
      - exceptiongroup==1.2.2
      - idna==3.10
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - joblib==0.11
      - jsonref==0.2
      - jsonschema==2.6.0
      - packaging==24.0
      - pluggy==1.2.0
      - pubnub==4.8.1
      - pycryptodomex==3.22.0
      - pytest==7.4.4
      - pyyaml==5.4.1
      - requests==2.31.0
      - six==1.17.0
      - tomli==2.0.1
      - typing-extensions==4.7.1
      - urllib3==2.0.7
      - zipp==3.15.0
prefix: /opt/conda/envs/civis-python

civis/tests/test_parallel.py::test_setup_remote_backend
civis/tests/test_parallel.py::test_retries civis/tests/test_parallel.py::test_from_template_id civis/tests/test_parallel.py::test_template_submit civis/tests/test_parallel.py::test_make_template civis/tests/test_parallel.py::test_setup_cmd civis/tests/test_parallel.py::test_default_setup_cmd_no_repo civis/tests/test_parallel.py::test_default_setup_cmd_with_repo civis/tests/test_parallel.py::test_infer_no_job_id_error civis/tests/test_parallel.py::test_infer civis/tests/test_parallel.py::test_infer_new_params civis/tests/test_parallel.py::test_infer_extra_param civis/tests/test_parallel.py::test_infer_update_resources civis/tests/test_parallel.py::test_infer_update_args civis/tests/test_parallel.py::test_infer_from_custom_job civis/tests/test_parallel.py::test_result_success civis/tests/test_parallel.py::test_result_callback_no_get civis/tests/test_parallel.py::test_result_exception civis/tests/test_parallel.py::test_result_exception_no_result civis/tests/test_parallel.py::test_result_callback_exception civis/tests/test_parallel.py::test_result_eventual_success civis/tests/test_parallel.py::test_result_eventual_failure civis/tests/test_parallel.py::test_civis_backend_from_existing civis/tests/test_parallel.py::test_civis_backend_pickles
setup.py requirements.txt civis/parallel.py CHANGELOG.md
setup.py requirements.txt civis/parallel.py CHANGELOG.md