Skip to content

Update to recent Python versions and packaging structure#141

Merged
jacobtomlinson merged 19 commits intodask:mainfrom
jacobtomlinson:modern-python
Mar 4, 2026
Merged

Update to recent Python versions and packaging structure#141
jacobtomlinson merged 19 commits intodask:mainfrom
jacobtomlinson:modern-python

Conversation

@jacobtomlinson
Copy link
Member

@jacobtomlinson jacobtomlinson commented Oct 15, 2025

  • Update CI from Python 3.7/3.8 to cover the currently supported 3.10-3.13
  • Migrate from setup.py to pyproject.toml
  • Migrate from setuptools to hatchling
  • Migrate from versioneer to hatch-vcs (most of the deleted lines are related to removing this vendored dependency)
  • Bump GitHub Actions workflows to modern versions
  • Update release CI to most recent Python
  • Bump PyPI release action to tagged version

@yum-yab
Copy link

yum-yab commented Jan 29, 2026

@jacobtomlinson Just a ping if there are any plans on updating dask-mpi? I wanted to use it in my project, but unfortunately other dependencies require python versions >3.12 (strangely, uv and pixi have no problems installing it, but pip, which i have to use, fails solving the dependencies)

Before I spend effort downgrading, maybe this pull will eventually get merged and resolve my issues. Thanks!

@jacobtomlinson jacobtomlinson changed the title Update to recent Python versions Update to recent Python versions and packaging structure Feb 24, 2026
auto-update-conda: false
python-version: ${{ matrix.python }}
environment-file: ${{ env.ENV_FILE }}
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
Copy link
Member Author

Choose a reason for hiding this comment

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

This is not needed as of conda-incubator/setup-miniconda@v3

Copy link
Member Author

@jacobtomlinson jacobtomlinson Feb 24, 2026

Choose a reason for hiding this comment

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

This file now gets generated dynamically by setuptools-scm (via hatch-vcs) during build/install.

worker_options,
name,
):
from mpi4py import MPI
Copy link
Member Author

Choose a reason for hiding this comment

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

Importing this at import time was causing a race condition.

Comment on lines +169 to +170
if worker_task is not None:
await worker_task
Copy link
Member Author

Choose a reason for hiding this comment

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

Worker processes can hang if we fail to await the worker task in Python >= 3.11 so we are awaiting it explicitly during shutdown.

jacobtomlinson and others added 2 commits February 24, 2026 21:28
OpenMPI 5.x (PRRTE runtime) removed --oversubscribe and the old
OMPI_MCA_rmaps_base_oversubscribe MCA parameter. The correct way
to enable oversubscription is now via PRRTE_MCA_rmaps_default_mapping_policy.

Additionally, OpenMPI 5.x's default CPU binding policy can hang in
virtualized CI environments (e.g. GitHub Actions Azure VMs) where hwloc
misdetects the CPU topology. Disabling binding via
PRTE_MCA_rmaps_default_binding_policy=none fixes this.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment on lines +29 to +31
# OpenMPI 5.x removed --oversubscribe; use PRRTE's mapping policy instead
PRTE_MCA_rmaps_default_mapping_policy: ':OVERSUBSCRIBE'
# Disable CPU binding to avoid hangs on virtualized CI hardware (OpenMPI 5.x)
Copy link
Member Author

Choose a reason for hiding this comment

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

These options were updated in openmpi 5

@jacobtomlinson
Copy link
Member Author

This is now ready for review. @kmpaul if you have some time I would much appreciate it!

@jacobtomlinson
Copy link
Member Author

In the interest of getting a release out and the low maintenance capacity we currently have in Dask I'm going to merge this tomorrow if there are no further comments.

@jacobtomlinson jacobtomlinson merged commit f65c05f into dask:main Mar 4, 2026
18 of 19 checks passed
@jacobtomlinson jacobtomlinson deleted the modern-python branch March 4, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants