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

Add support for Python 3.13 #8904

Merged
merged 23 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
environment: [mindeps, "3.10", "3.11", "3.12"]
environment: [mindeps, "3.10", "3.11", "3.12", "3.13"]
label: [default]
extra_packages: [null]
# Cherry-pick test modules to split the overall runtime roughly in half
Expand All @@ -40,6 +40,8 @@ jobs:
environment: "3.10"
- os: macos-latest
environment: "3.11"
- os: macos-latest
environment: "3.13"

- os: windows-latest
environment: mindeps
Expand Down Expand Up @@ -174,6 +176,13 @@ jobs:
|| steps.cache.outputs.cache-hit != 'true'
)

- name: Install PyArrow nightlies for Python 3.13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, not anymore. Just removed it

if: ${{ matrix.environment == '3.13' }}
shell: bash -l {0}
run: |
pip install --extra-index-url https://pypi.fury.io/arrow-nightlies/ --prefer-binary --pre pyarrow
pip install git+https://github.com/dask/dask-expr

- name: Install
shell: bash -l {0}
run: |
Expand Down
55 changes: 55 additions & 0 deletions continuous_integration/environment-3.13.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: dask-distributed-313
channels:
- conda-forge
dependencies:
- python=3.13
- packaging
- pip
- asyncssh
- bokeh>3
- click
- cloudpickle
- coverage
- dask # overridden by git tip below
- filesystem-spec # overridden by git tip below
- gilknocker
- h5py
- ipykernel
- ipywidgets
- jinja2
- jupyter-server-proxy
- jupyterlab
- locket
- msgpack-python
- netcdf4
- paramiko
- pre-commit
- prometheus_client
- psutil
- pyarrow
- pytest
- pytest-cov
- pytest-faulthandler
- pytest-repeat
- pytest-rerunfailures
- pytest-timeout
- requests
- s3fs # overridden by git tip below
- scikit-learn
- scipy
- sortedcollections
- tblib
- toolz
- tornado
- zict # overridden by git tip below
- zstandard
# Temporary fix for https://github.com/pypa/setuptools/issues/4496
- setuptools < 71
- pip:
- git+https://github.com/dask/dask
- git+https://github.com/dask/dask-expr
- git+https://github.com/dask/zict
# Revert after https://github.com/dask/distributed/issues/8614 is fixed
# - git+https://github.com/dask/s3fs
# - git+https://github.com/fsspec/filesystem_spec
- keras
2 changes: 2 additions & 0 deletions distributed/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ def _get_tls_context(self, tls, purpose):
# IP addresses rather than hostnames
ctx.check_hostname = False

ctx.verify_flags &= ~ssl.VERIFY_X509_STRICT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've gone ahead and turned this new VERIFY_X509_STRICT flag off here (it was previously off by default in older versions of Python but was flipped on by default in Python 3.13). This seems not ideal, but also not that bad given that's what we've always done prior to Python 3.13. @jacobtomlinson (or anyone else) let me know if you have a better suggestion, I'm not verify familiar with our TLS security code paths.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using https://github.com/python-trio/trustme to generate the certificates used for testing on the fly would get this to pass (as it sets the appropriate flags on the certificates and generally keeps these flags up to date)

of course, distributed users would also need to configure their certificates to meet these stronger security standards


if tls.get("ciphers"):
ctx.set_ciphers(tls.get("ciphers"))

Expand Down
2 changes: 2 additions & 0 deletions distributed/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1541,6 +1541,7 @@ def get_server_ssl_context(
ctx = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH, cafile=get_cert(ca_file))
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_REQUIRED
ctx.verify_flags &= ~ssl.VERIFY_X509_STRICT
ctx.load_cert_chain(get_cert(certfile), get_cert(keyfile))
return ctx

Expand All @@ -1551,6 +1552,7 @@ def get_client_ssl_context(
ctx = ssl.create_default_context(ssl.Purpose.SERVER_AUTH, cafile=get_cert(ca_file))
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_REQUIRED
ctx.verify_flags &= ~ssl.VERIFY_X509_STRICT
ctx.load_cert_chain(get_cert(certfile), get_cert(keyfile))
return ctx

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
"Topic :: System :: Distributed Computing",
]
Expand Down
Loading