Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# https://flake8.readthedocs.io/en/latest/user/error-codes.html

# Note: there cannot be spaces after commas here
exclude = __init__.py,versioneer.py,distributed/_concurrent_futures_thread.py
exclude = __init__.py,distributed/_concurrent_futures_thread.py
ignore =
# Ignores below are aligned with black https://github.com/psf/black/blob/main/.flake8
# Whitespace before ':'
Expand Down
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
# Cython files
*.c
*.so
distributed/scheduler.html

build/
dist/
*.egg-info
docs/build
continuous_integration/hdfs-initialized
.DS_Store
.cache
.coverage
Expand All @@ -32,6 +30,12 @@ tags
.venv/
.mypy_cache/

# Project specific
continuous_integration/hdfs-initialized
distributed/scheduler.html
distributed/_version.py

# Test reports
reports/
test_report*.html
test_report*.db
Expand Down
4 changes: 2 additions & 2 deletions continuous_integration/recipes/distributed/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ requirements:
- python >=3.10
- pip
- dask-core {{ dask_version }}
- versioneer =0.29
- setuptools >=62.6
- setuptools-scm
- setuptools >=80
- tomli # [py<311]
run:
- python >=3.10
Expand Down
26 changes: 7 additions & 19 deletions distributed/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import dask
from dask.config import config # type: ignore

from distributed._version import get_versions
from distributed.actor import Actor, ActorFuture, BaseActorFuture
from distributed.client import (
Client,
Expand Down Expand Up @@ -77,23 +76,13 @@
)
from distributed.worker_client import local_client, worker_client


def __getattr__(name):
global __version__, __git_revision__

if name == "__version__":
from importlib.metadata import version

__version__ = version("distributed")
return __version__

if name == "__git_revision__":
from distributed._version import get_versions

__git_revision__ = get_versions()["full-revisionid"]
return __git_revision__

raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
try:
# Backwards compatibility with versioneer
from distributed._version import __commit_id__ as __git_revision__
from distributed._version import __version__
except ImportError:
__git_revision__ = "unknown"
__version__ = "unknown"


__all__ = [
Expand Down Expand Up @@ -142,7 +131,6 @@ def __getattr__(name):
"get_client",
"get_task_metadata",
"get_task_stream",
"get_versions",
Copy link
Member Author

@jacobtomlinson jacobtomlinson Nov 4, 2025

Choose a reason for hiding this comment

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

Technically this is breaking, but this internal versioneer method was never intended to be exposed publicly anyway. If anyone is depending on this they should probably switch to __version__ or importlib.metadata.version("distributed").

"get_worker",
"local_client",
"performance_report",
Expand Down
Loading
Loading