Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require Click 7.0+ in Dask #9595

Merged
merged 7 commits into from Oct 28, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions continuous_integration/environment-3.10.yaml
Expand Up @@ -44,6 +44,7 @@ dependencies:
# Need recent version of s3fs to support newer aiobotocore versions
# https://github.com/dask/s3fs/issues/514
- s3fs>=2021.8.0
- click
- cloudpickle
- crick
- cytoolz
Expand Down
1 change: 1 addition & 0 deletions continuous_integration/environment-3.8.yaml
Expand Up @@ -44,6 +44,7 @@ dependencies:
# Need recent version of s3fs to support newer aiobotocore versions
# https://github.com/dask/s3fs/issues/514
- s3fs>=2021.8.0
- click
- cloudpickle
- crick
- cytoolz
Expand Down
1 change: 1 addition & 0 deletions continuous_integration/environment-3.9.yaml
Expand Up @@ -44,6 +44,7 @@ dependencies:
# Need recent version of s3fs to support newer aiobotocore versions
# https://github.com/dask/s3fs/issues/514
- s3fs>=2021.8.0
- click
- cloudpickle
- crick
- cytoolz
Expand Down
1 change: 1 addition & 0 deletions continuous_integration/environment-mindeps-array.yaml
Expand Up @@ -6,6 +6,7 @@ dependencies:
- packaging=20.0
- python=3.8
- pyyaml>=5.3.1
- click>=6.6
jakirkham marked this conversation as resolved.
Show resolved Hide resolved
- cloudpickle=1.1.1
- partd=0.3.10
- fsspec=0.6.0
Expand Down
1 change: 1 addition & 0 deletions continuous_integration/environment-mindeps-dataframe.yaml
Expand Up @@ -6,6 +6,7 @@ dependencies:
- packaging=20.0
- python=3.8
- pyyaml>=5.3.1
- click>=6.6
jakirkham marked this conversation as resolved.
Show resolved Hide resolved
- cloudpickle=1.1.1
- partd=0.3.10
- fsspec=0.6.0
Expand Down
Expand Up @@ -6,6 +6,7 @@ dependencies:
- packaging=20.0
- python=3.8
- pyyaml>=5.3.1
- click>=6.6
jakirkham marked this conversation as resolved.
Show resolved Hide resolved
- cloudpickle=1.5.0 # this is in the min from distributed
- partd=0.3.10
- fsspec=0.6.0
Expand Down
Expand Up @@ -6,6 +6,7 @@ dependencies:
- packaging=20.0
- python=3.8
- pyyaml>=5.3.1
- click>=6.6
jakirkham marked this conversation as resolved.
Show resolved Hide resolved
- cloudpickle=1.1.1
- partd=0.3.10
- fsspec=0.6.0
Expand Down
2 changes: 1 addition & 1 deletion continuous_integration/recipe/meta.yaml
Expand Up @@ -25,6 +25,7 @@ requirements:

run:
- python >=3.8
- click >=6.6
jakirkham marked this conversation as resolved.
Show resolved Hide resolved
- cloudpickle >=1.1.1
- fsspec >=0.6.0
- packaging >=20.0
Expand All @@ -42,7 +43,6 @@ test:
- dask info versions --help
requires:
- pip
- click

about:
home: https://github.com/dask/dask/
Expand Down
2 changes: 1 addition & 1 deletion continuous_integration/scripts/test_imports.sh
Expand Up @@ -5,7 +5,7 @@ set -o errexit
test_import () {
echo "Create environment: python=$PYTHON_VERSION $1"
# Create an empty environment
mamba create -q -y -n test-imports -c conda-forge python=$PYTHON_VERSION packaging pyyaml fsspec toolz partd cloudpickle $1
mamba create -q -y -n test-imports -c conda-forge python=$PYTHON_VERSION packaging pyyaml fsspec toolz partd click cloudpickle $1
conda activate test-imports
if [[ $1 =~ "distributed" ]]; then
# dask[distributed] depends on the latest version of distributed
Expand Down
20 changes: 1 addition & 19 deletions dask/__main__.py
@@ -1,25 +1,7 @@
import sys

try:
import click
except ImportError:
click = None
from dask.cli import run_cli


def main():

if click is None:
msg = (
"The dask command requires click to be installed.\n\n"
"Install with conda or pip:\n\n"
" conda install click\n"
" pip install click\n"
)
print(msg, file=sys.stderr)
return 1

from dask.cli import run_cli

run_cli()


Expand Down
14 changes: 2 additions & 12 deletions dask/cli.py
@@ -1,20 +1,10 @@
import warnings

import click

from dask import __version__
from dask.compatibility import entry_points

try:
import click
except ImportError as e:
msg = (
"The dask.cli module requires click to be installed.\n\n"
"Install with conda or pip:\n\n"
" conda install click\n"
" pip install click\n"
)
raise ImportError(msg) from e


CONTEXT_SETTINGS = {
"help_option_names": ["-h", "--help"],
"max_content_width": 88,
Expand Down
6 changes: 2 additions & 4 deletions dask/tests/test_cli.py
@@ -1,12 +1,10 @@
import pytest

click = pytest.importorskip("click")

import importlib.metadata
import json
import platform
import sys

import click
import pytest
from click.testing import CliRunner

import dask
Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -33,6 +33,7 @@
]

install_requires = [
"click >= 6.6",
jakirkham marked this conversation as resolved.
Show resolved Hide resolved
"cloudpickle >= 1.1.1",
"fsspec >= 0.6.0",
"packaging >= 20.0",
Expand Down