Skip to content

Commit 048e564

Browse files
committed
Restructure files
- added setup, uv - moved contents to install
1 parent 6d31108 commit 048e564

File tree

7 files changed

+135
-64
lines changed

7 files changed

+135
-64
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@ repos:
2525
.*test.*|
2626
^CHANGELOG.md$
2727
)
28-
# Include this if we add any Python code
29-
# - repo: https://github.com/astral-sh/ruff-pre-commit
30-
# rev: v0.9.3
31-
# hooks:
32-
# - id: ruff
33-
# args: ["--fix"]
34-
# - id: ruff-format
28+
- repo: https://github.com/astral-sh/ruff-pre-commit
29+
rev: v0.9.3
30+
hooks:
31+
- id: ruff
32+
args: ["--fix"]
33+
- id: ruff-format
3534
- repo: https://github.com/rapidsai/pre-commit-hooks
3635
rev: v0.6.0
3736
hooks:

requirements/overrides.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dask @ git+https://github.com/dask/dask.git@main
2+
distributed @ git+https://github.com/dask/distributed.git@main

scripts/check-version.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env python
2+
# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION & AFFILIATES.
3+
"""
4+
Print the git commit a rapids package was built from.
5+
"""
6+
7+
import argparse
8+
import importlib
9+
import sys
10+
import importlib.resources
11+
12+
13+
def parse_args(args=None):
14+
parser = argparse.ArgumentParser(description=__doc__)
15+
parser.add_argument("distribution", help="Package name to check.")
16+
17+
return parser.parse_args(args)
18+
19+
20+
def main(args=None):
21+
args = parse_args(args)
22+
dist = args.distribution
23+
24+
try:
25+
sha = importlib.resources.files(dist).joinpath("GIT_COMMIT").read_text().strip()
26+
except ModuleNotFoundError:
27+
print(f"Error: {dist} is not installed.", file=sys.stderr)
28+
except FileNotFoundError:
29+
print(f"Error: {dist} does not contain 'GIT_COMMIT' file.", file=sys.stderr)
30+
else:
31+
print(sha)
32+
sys.exit(0)
33+
sys.exit(1)
34+
35+
36+
if __name__ == "__main__":
37+
main()

scripts/install.sh

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/usr/bin/env bash
2+
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES.
3+
set -euo pipefail
4+
5+
# RAPIDS_CUDA_VERSION is like 12.15.1
6+
# We want cu12
7+
RAPIDS_PY_CUDA_SUFFIX=$(echo "cu${RAPIDS_CUDA_VERSION:-12.15.1}" | cut -d '.' -f 1)
8+
9+
# TODO: set this to main once dask-cudf is compatible
10+
# DASK_VERSION=main
11+
DASK_VERSION=main
12+
export PIP_YES=true
13+
export PIP_PRE=true
14+
15+
# Try
16+
uv pip install --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple \
17+
--overrides=requirements/overrides.txt \
18+
--prerelease allow \
19+
"cudf-${RAPIDS_PY_CUDA_SUFFIX}" \
20+
"dask-cudf-${RAPIDS_PY_CUDA_SUFFIX}" \
21+
"ucx-py-${RAPIDS_PY_CUDA_SUFFIX}" \
22+
"ucxx-${RAPIDS_PY_CUDA_SUFFIX}" \
23+
"scipy" \
24+
"dask-cuda"
25+
26+
# Clone cudf repo for tests
27+
CUDF_VERSION="branch-25.04"
28+
cudf_commit=$(./scripts/check-version.py cudf)
29+
30+
if [ ! -d "cudf" ]; then
31+
echo "Cloning cudf@{$CUDF_VERSION}"
32+
git clone https://github.com/rapidsai/cudf.git --branch $CUDF_VERSION
33+
fi
34+
35+
pushd cudf
36+
git checkout $cudf_commit
37+
popd
38+
39+
if [ ! -d "dask-cuda" ]; then
40+
echo "Cloning cudf@{$CUDF_VERSION}"
41+
git clone https://github.com/rapidsaicudf_commit/dask-cuda.git --branch $CUDF_VERSION
42+
fi
43+
44+
# Clone dask-cuda for tests
45+
# dask-cuda nightly wheels currently lack a __git_commit__.
46+
# Looking into it, but for now just use the branch.
47+
48+
# dask_cuda_commit=$(./scripts/check-version.py dask_cuda)
49+
50+
pushd dask-cuda
51+
git checkout $CUDF_VERSION
52+
popd
53+
54+
# depth needs to be sufficient to reach the last tag, so that the package
55+
# versions are set correctly
56+
if [ ! -d "dask" ]; then
57+
echo "Cloning dask@{$DASK_VERSION}"
58+
git clone https://github.com/dask/dask --depth 100 --branch $DASK_VERSION
59+
fi
60+
61+
if [ ! -d "distributed" ]; then
62+
echo "Cloning dask@{$DASK_VERSION}"
63+
git clone https://github.com/dask/distributed --depth 100 --branch $DASK_VERSION
64+
fi
65+
66+
pushd dask
67+
git checkout $DASK_VERSION
68+
popd
69+
70+
pushd distributed
71+
git checkout $DASK_VERSION
72+
popd
73+
74+
echo "[Setup done]"
75+
uv pip list

scripts/overrides.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# used to force installing dask / distributed main
2+
# even if another package like rapids-dask-dependency wants something else
3+
dask[test] @ git+https://github.com/dask/dask.git@main
4+
distributed @ git+https://github.com/dask/distributed.git@main

scripts/run.sh

Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,8 @@
11
#!/usr/bin/env bash
22
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES.
33

4-
# Install
54
set -euo pipefail
65

7-
8-
# RAPIDS_CUDA_VERSION is like 12.15.1
9-
# We want cu12
10-
RAPIDS_PY_CUDA_SUFFIX=$(echo "cu${RAPIDS_CUDA_VERSION:-12.15.1}" | cut -d '.' -f 1)
11-
12-
# TODO: set this to main once dask-cudf is compatible
13-
# DASK_VERSION=main
14-
DASK_VERSION=main
15-
export PIP_YES=true
16-
export PIP_PRE=true
17-
18-
pip install --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple \
19-
"cudf-${RAPIDS_PY_CUDA_SUFFIX}" \
20-
"dask-cudf-${RAPIDS_PY_CUDA_SUFFIX}" \
21-
"ucx-py-${RAPIDS_PY_CUDA_SUFFIX}" \
22-
"ucxx-${RAPIDS_PY_CUDA_SUFFIX}" \
23-
"scipy" \
24-
"dask-cuda"
25-
26-
27-
# Clone cudf repo for tests
28-
CUDF_VERSION="branch-25.04"
29-
30-
if [ ! -d "cudf" ]; then
31-
echo "Cloning cudf@{$CUDF_VERSION}"
32-
git clone https://github.com/rapidsai/cudf.git --branch $CUDF_VERSION
33-
fi
34-
35-
# Clone dask-cuda for tests
36-
37-
if [ ! -d "dask-cuda" ]; then
38-
echo "Cloning cudf@{$CUDF_VERSION}"
39-
git clone https://github.com/rapidsai/dask-cuda.git --branch $CUDF_VERSION
40-
fi
41-
42-
43-
# depth needs to be sufficient to reach the last tag, so that the package
44-
# versions are set correctly
45-
if [ ! -d "dask" ]; then
46-
echo "Cloning dask@{$DASK_VERSION}"
47-
git clone https://github.com/dask/dask --depth 100 --branch $DASK_VERSION
48-
fi
49-
50-
if [ ! -d "distributed" ]; then
51-
echo "Cloning dask@{$DASK_VERSION}"
52-
git clone https://github.com/dask/distributed --depth 100 --branch $DASK_VERSION
53-
fi
54-
55-
# Install everything, including any new dependencies
56-
pip uninstall dask distributed
57-
pip install -e ./dask[test]
58-
pip install -e ./distributed
59-
60-
echo "[Setup done]"
61-
pip list
62-
6+
./scripts/setup.sh
7+
./scripts/install.sh
638
./scripts/test.sh

scripts/setup.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES.
3+
4+
# Install
5+
set -euo pipefail
6+
7+
if ! command -v uv > /dev/null; then
8+
curl -LsSf https://astral.sh/uv/install.sh | sh
9+
fi

0 commit comments

Comments
 (0)