Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
44faaaf
fixes issue with UPath on Windows
normanrz Oct 7, 2025
ded4a91
fix typing
normanrz Oct 7, 2025
b8334cd
better git clean check
normanrz Oct 7, 2025
7009949
fix wkw file listing
normanrz Oct 7, 2025
cf49920
wip
normanrz Oct 7, 2025
b1e78ab
upath all the way
normanrz Oct 8, 2025
f03e1c6
zip fix
normanrz Oct 8, 2025
618728c
zip fix
normanrz Oct 8, 2025
acf4d04
coverage
normanrz Oct 8, 2025
2c4b189
dev grouos
normanrz Oct 8, 2025
161d573
dev deps
normanrz Oct 8, 2025
21772e2
coverage
normanrz Oct 8, 2025
841a16d
coverage
normanrz Oct 8, 2025
497f5f2
coverage
normanrz Oct 8, 2025
89fab20
coverage
normanrz Oct 8, 2025
ae12285
coverage
normanrz Oct 8, 2025
609eb3d
coverage
normanrz Oct 8, 2025
7f941a2
changelog
normanrz Oct 8, 2025
1778849
changelog
normanrz Oct 8, 2025
92bf8f0
print commands
normanrz Oct 8, 2025
2b0a192
coverage
normanrz Oct 8, 2025
ddf74d1
skip
normanrz Oct 8, 2025
4886271
windows
normanrz Oct 8, 2025
ddf4134
upath 0.3.3
normanrz Oct 9, 2025
77a9f25
pr feedback
normanrz Oct 9, 2025
45d9cff
Merge branch 'master' into upath-0.3-windows
normanrz Oct 9, 2025
133b6d8
upgrade just upath, pytest-cov and coverage
normanrz Oct 9, 2025
9a87e2d
aiobotocore,aiosignal,anyio,attrs,botocore,cattrs
normanrz Oct 9, 2025
d1df5a5
tensorstore
normanrz Oct 9, 2025
c524b0c
tensorstore==0.1.77
normanrz Oct 9, 2025
2cdd0b2
tensorstore==0.1.76
normanrz Oct 9, 2025
f91d079
uv upgrade
normanrz Oct 9, 2025
d98f68c
unskip
normanrz Oct 9, 2025
befcebe
downgrade click
normanrz Oct 9, 2025
0366be3
lint
normanrz Oct 9, 2025
0ec549c
comment
normanrz Oct 10, 2025
6851042
merge
normanrz Oct 10, 2025
0ee6eab
fixes
normanrz Oct 10, 2025
afdd964
uv.lock
normanrz Oct 10, 2025
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
15 changes: 7 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ jobs:
timeout-minutes: 30
env:
PYTHON_VERSION: ${{ matrix.python-version }}
COVERAGE_FILE: "~/.local/share/coverage/${{ matrix.group }}.coverage"
run: ./test.sh --splits 3 --group ${{ matrix.group }} --splitting-algorithm least_duration --cov=webknossos --cov-report=

- name: Python tests
Expand All @@ -191,13 +190,13 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: coverage-report-${{ matrix.group }}
path: "~/.local/share/coverage/${{ matrix.group }}.coverage"
path: "webknossos/.coverage"
include-hidden-files: true
if-no-files-found: error
retention-days: 1 # Automatically deletes after 1 day

- name: Check if git is dirty
run: |
git diff --no-ext-diff --exit-code
[[ -z $(git status -s) ]]
run: ../_tooling/check_clean.sh

webknossos_windows:
needs: changes
Expand Down Expand Up @@ -262,7 +261,7 @@ jobs:
env:
COVERAGE_FILE: "~/coverage-files/result.coverage"
run: |
coverage combine ~/coverage-files/**/*.coverage
coverage combine ~/coverage-files/**/.coverage
coverage xml -i -o ~/coverage-files/result.xml

- name: Report coverage
Expand Down Expand Up @@ -301,8 +300,8 @@ jobs:
cd docs
./generate.sh --persist

- name: Push docs (for branch)
if: github.ref_type == 'branch'
- name: Push docs (for master)
if: github.ref == 'refs/heads/master'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
13 changes: 13 additions & 0 deletions _tooling/check_clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -eEuo pipefail

echo "🔍 Checking for uncommitted changes..."

# Include both committed and untracked changes
if ! git diff --quiet HEAD || [ -n "$(git ls-files --others --exclude-standard)" ]; then
echo "❌ Git working tree is dirty:"
git status --short
exit 1
fi

echo "✅ Working tree clean."
4 changes: 2 additions & 2 deletions cluster_tools/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ dask = ["distributed ~=2023.9.1"]
kubernetes = ["kubernetes ~=27.2.0"]
all=["cluster_tools[kubernetes]", "cluster_tools[dask]"]

[tool.uv]
dev-dependencies = [
[dependency-groups]
dev = [
"icecream ~=2.1.1",
"mypy ~=1.15.0",
"pytest ~=8.3.3",
Expand Down
1 change: 1 addition & 0 deletions webknossos/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ For upgrade instructions, please check the respective _Breaking Changes_ section
- Dataset.add_layer_as_ref() now accepts RemoteLayer objects as well as Layer objects. [#1371](https://github.com/scalableminds/webknossos-libs/pull/1371])

### Changed
- Replaced `pathlib.Path` for `upath.UPath` internally. `pathlib.Path` is still supported for user-facing APIs. Adds support for `universal_pathlib` version 0.3.x. [#1374](https://github.com/scalableminds/webknossos-libs/pull/1374)
- Only use fs-based copy for mags on local file systems and S3. Other protocols, e.g. memory and HTTP, have caveats that break fs-based copying. [#1365](https://github.com/scalableminds/webknossos-libs/pull/1365)
- The `add_*` methods in `Attachments` now return the created attachment objects, similar to `add_layer` and `add_mag`. [#1365](https://github.com/scalableminds/webknossos-libs/pull/1365)
- The returned dataset ID from dataset exploration is now used. [#1378](https://github.com/scalableminds/webknossos-libs/pull/1378)
Expand Down
13 changes: 8 additions & 5 deletions webknossos/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ dependencies = [
"rich ~=13.8.0",
"s3fs>=2024.6.1",
"scipy >=1.13",
"tensorstore~=0.1.74",
"tensorstore ==0.1.76; sys_platform == 'win32'", # tensorstore crashes on windows with >0.1.76
"tensorstore ~=0.1.78; sys_platform != 'win32'",
"typer ~=0.12.5",
"typing-extensions ~=4.0",
"universal-pathlib ~=0.2",
"universal-pathlib ~=0.3",
"wkw ==1.1.24",
"zipp ~=3.5.0",
]
Expand Down Expand Up @@ -89,9 +90,8 @@ all = [
"webknossos[examples]",
]

[tool.uv]
extra-index-url = ["https://pypi.scm.io/simple"]
dev-dependencies = [
[dependency-groups]
dev = [
"coverage>=7.8.0",
"fsspec ~=2024.6.0",
"hypothesis ~=6.35.0",
Expand All @@ -110,6 +110,9 @@ dev-dependencies = [
"ruff ~=0.11.0",
]

[tool.uv]
extra-index-url = ["https://pypi.scm.io/simple"]

[tool.uv.sources]
cluster-tools = { path = "../cluster_tools", editable = true }

Expand Down
9 changes: 5 additions & 4 deletions webknossos/script_collection/test_segmentation_heuristic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys
from pathlib import Path

from upath import UPath

import webknossos as wk
from webknossos.dataset._utils.segmentation_recognition import (
Expand All @@ -9,11 +10,11 @@
)


def looks_like_remote_dataset(path: Path) -> bool:
def looks_like_remote_dataset(path: UPath) -> bool:
return len([item for item in path.iterdir() if item.is_dir()]) == 0


def main(path_to_datasets: Path) -> None:
def main(path_to_datasets: UPath) -> None:
wrongly_predicted: list[str] = []
correctly_predicted: list[str] = []
failures: list[str] = []
Expand Down Expand Up @@ -79,4 +80,4 @@ def main(path_to_datasets: Path) -> None:


if __name__ == "__main__":
main(Path("../webknossos/binaryData/sample_organization/"))
main(UPath("../webknossos/binaryData/sample_organization/"))
1 change: 1 addition & 0 deletions webknossos/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -eEuo pipefail
set -x

source local_wk_setup.sh

Expand Down
13 changes: 5 additions & 8 deletions webknossos/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
import os
import warnings
from collections.abc import Generator, Iterator
from os import makedirs
from pathlib import Path
from shutil import rmtree, unpack_archive
from shutil import unpack_archive
from typing import Any

import fsspec.implementations.http as http
Expand All @@ -16,6 +15,7 @@
import webknossos as wk
from webknossos.client._upload_dataset import _cached_get_upload_datastore
from webknossos.client.context import _clear_all_context_caches
from webknossos.utils import rmtree

from .constants import TESTDATA_DIR, TESTOUTPUT_DIR

Expand Down Expand Up @@ -98,7 +98,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:

@pytest.fixture(autouse=True, scope="function")
def clear_testoutput() -> Generator:
makedirs(TESTOUTPUT_DIR, exist_ok=True)
TESTOUTPUT_DIR.mkdir(parents=True, exist_ok=True)
yield
rmtree(TESTOUTPUT_DIR)

Expand Down Expand Up @@ -145,12 +145,9 @@ def use_replay_proxay(request: Any) -> Generator:


@pytest.fixture(scope="session")
def WT1_path() -> Path:
def WT1_upath() -> UPath:
ds_path = TESTDATA_DIR / "WT1_wkw"
if ds_path.exists():
rmtree(ds_path)
unpack_archive(
TESTDATA_DIR / "WT1_wkw.tar.gz",
ds_path,
)
unpack_archive(str(TESTDATA_DIR / "WT1_wkw.tar.gz"), str(ds_path))
return ds_path
Loading
Loading