Skip to content

Commit

Permalink
Bump flake8 and black in pre-commit config and add support for 3.11 (#…
Browse files Browse the repository at this point in the history
…418)

* Bump flake8 and black in pre-commit config

* Use python 3.11 to build docs

* Add support for python 3.11
  • Loading branch information
lukaszo committed Feb 29, 2024
1 parent afe8e56 commit 1eb17ff
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -9,7 +9,7 @@ jobs:
fail-fast: true
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: Checkout source
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
@@ -1,12 +1,12 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.10.1
hooks:
- id: black
language_version: python3
exclude: versioneer.py
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
rev: 6.1.0
hooks:
- id: flake8
language_version: python3
2 changes: 1 addition & 1 deletion .readthedocs.yml
Expand Up @@ -19,4 +19,4 @@ submodules:
build:
os: ubuntu-22.04
tools:
python: "3"
python: "3.11"
38 changes: 38 additions & 0 deletions ci/environment-3.11.yml
@@ -0,0 +1,38 @@
name: dask-cloudprovider-test
channels:
- defaults
- conda-forge
dependencies:
- python=3.11
- nomkl
- pip
# Dask
- dask
# testing / CI
- flake8
- ipywidgets
- pytest
- pytest-asyncio
- black >=20.8b1
- pyyaml
# dask dependencies
- cloudpickle
- toolz
- cytoolz
- numpy
- partd
# distributed dependencies
- click >=6.6
- msgpack-python
- psutil >=5.0
- six
- sortedcontainers !=2.0.0,!=2.0.1
- tblib
- tornado >=5
- zict >=0.1.3
# `event_loop_policy` change See https://github.com/dask/distributed/pull/4212
- pytest-asyncio >=0.14.0
- pytest-timeout
- pip:
- git+https://github.com/dask/dask.git@main
- git+https://github.com/dask/distributed@main
2 changes: 0 additions & 2 deletions dask_cloudprovider/azure/tests/test_azurevm.py
Expand Up @@ -66,7 +66,6 @@ def inc(x):
@skip_without_credentials
@pytest.mark.external
async def test_create_cluster_sync():

with AzureVMCluster() as cluster:
with Client(cluster) as client:
cluster.scale(1)
Expand All @@ -84,7 +83,6 @@ def inc(x):
@skip_without_credentials
@pytest.mark.external
async def test_create_rapids_cluster_sync():

with AzureVMCluster(
vm_size="Standard_NC12s_v3",
docker_image="rapidsai/rapidsai:cuda11.0-runtime-ubuntu18.04-py3.9",
Expand Down
4 changes: 0 additions & 4 deletions dask_cloudprovider/gcp/instances.py
Expand Up @@ -110,7 +110,6 @@ def __init__(
self.service_account = service_account or self.config.get("service_account")

def create_gcp_config(self):

subnetwork = f"projects/{self.network_projectid}/regions/{self.general_zone}/subnetworks/{self.network}"
config = {
"name": self.name,
Expand Down Expand Up @@ -205,7 +204,6 @@ def create_gcp_config(self):
return config

async def create_vm(self):

self.cloud_init = self.cluster.render_process_cloud_init(self)

self.gcp_config = self.create_gcp_config()
Expand Down Expand Up @@ -591,7 +589,6 @@ def __init__(
service_account=None,
**kwargs,
):

self.compute = GCPCompute()

self.config = dask.config.get("cloudprovider.gcp", {})
Expand Down Expand Up @@ -650,7 +647,6 @@ def __init__(self):
self._compute = self.refresh_client()

def refresh_client(self):

if os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", False):
import google.oauth2.service_account # google-auth

Expand Down
2 changes: 0 additions & 2 deletions dask_cloudprovider/gcp/tests/test_gcp.py
Expand Up @@ -76,7 +76,6 @@ async def test_create_cluster():
async with GCPCluster(
asynchronous=True, env_vars={"FOO": "bar"}, security=True
) as cluster:

assert cluster.status == Status.running

cluster.scale(2)
Expand Down Expand Up @@ -132,7 +131,6 @@ async def test_create_rapids_cluster():
auto_shutdown=True,
bootstrap=False,
) as cluster:

assert cluster.status == Status.running

cluster.scale(1)
Expand Down
4 changes: 2 additions & 2 deletions versioneer.py
Expand Up @@ -343,9 +343,9 @@ def get_config_from_root(root):
# configparser.NoOptionError (if it lacks "VCS="). See the docstring at
# the top of versioneer.py for instructions on writing your setup.cfg .
setup_cfg = os.path.join(root, "setup.cfg")
parser = configparser.SafeConfigParser()
parser = configparser.ConfigParser()
with open(setup_cfg, "r") as f:
parser.readfp(f)
parser.read_file(f)
VCS = parser.get("versioneer", "VCS") # mandatory

def get(parser, name):
Expand Down

0 comments on commit 1eb17ff

Please sign in to comment.