Skip to content

Commit

Permalink
manage more dependencies in dependencies.yaml, add 'numpy' run depend…
Browse files Browse the repository at this point in the history
…ency to conda packages
  • Loading branch information
jameslamb committed Oct 17, 2024
1 parent 0efba33 commit a4d7667
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 10 deletions.
13 changes: 8 additions & 5 deletions ci/test_wheel.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.
# Copyright (c) 2023-2024, NVIDIA CORPORATION.

set -e # abort the script on error
set -o pipefail # piped commands propagate their error
Expand All @@ -9,23 +9,26 @@ mkdir -p ./dist
RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
RAPIDS_PY_WHEEL_NAME="pylibwholegraph_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./dist

# echo to expand wildcard before adding `[extra]` requires for pip
python -m pip install $(echo ./dist/pylibwholegraph*.whl)

# determine PyTorch source
PKG_CUDA_VER="$(echo ${CUDA_VERSION} | cut -d '.' -f1,2 | tr -d '.')"
PKG_CUDA_VER_MAJOR=${PKG_CUDA_VER:0:2}
if [[ "${PKG_CUDA_VER_MAJOR}" == "12" ]]; then
INDEX_URL="https://download.pytorch.org/whl/cu121"
else
INDEX_URL="https://download.pytorch.org/whl/cu${PKG_CUDA_VER}"
fi

# echo to expand wildcard before adding `[extra]` requires for pip
python -m pip install \
"$(echo ./dist/pylibwholegraph*.whl)[test]"


RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}
RAPIDS_COVERAGE_DIR=${RAPIDS_COVERAGE_DIR:-"${PWD}/coverage-results"}
mkdir -p "${RAPIDS_TESTS_DIR}" "${RAPIDS_COVERAGE_DIR}"

rapids-logger "Installing PyTorch"
rapids-retry python -m pip install --pre torch --index-url ${INDEX_URL}
rapids-retry python -m pip install pytest pytest-forked numpy
rapids-logger "pytest pylibwholegraph"
cd python/pylibwholegraph/pylibwholegraph/tests
python -m pytest \
Expand Down
1 change: 1 addition & 0 deletions conda/recipes/pylibwholegraph/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ requirements:
- cudatoolkit
{% endif %}
- libwholegraph ={{ version }}
- numpy>=1.23,<3.0a0
- python

about:
Expand Down
24 changes: 20 additions & 4 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,21 @@ files:
key: requires
includes:
- python_build_wheel
py_run_pylibwholegraph:
output: pyproject
pyproject_dir: python/pylibwholegraph
extras:
table: project
includes:
- run
py_test_pylibwholegraph:
output: pyproject
pyproject_dir: python/pylibwholegraph
extras:
table: project.optional-dependencies
key: test
includes:
- test_python
channels:
- rapidsai
- rapidsai-nightly
Expand Down Expand Up @@ -211,7 +226,8 @@ dependencies:
run:
common:
- output_types: [conda, requirements]
packages: []
packages:
- &numpy numpy>=1.23,<3.0a0
test_cpp:
common:
- output_types: [conda]
Expand All @@ -224,10 +240,10 @@ dependencies:
- c-compiler
- cxx-compiler
- *nccl
- output_types: [conda, requirements]
packages:
- ninja
- numpy>=1.23,<3.0a0
- output_types: [conda, pyproject, requirements]
packages:
- *numpy
- pytest
- pytest-forked
- pytest-xdist
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ from libcpp cimport bool
from cpython cimport Py_buffer
from cpython cimport array
import array
import numpy as np
from cpython.ref cimport PyObject, Py_INCREF, Py_DECREF
from cpython.object cimport Py_TYPE, PyObject_CallObject
from cpython.tuple cimport *
Expand Down
10 changes: 10 additions & 0 deletions python/pylibwholegraph/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,17 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.


[project.optional-dependencies]
test = [
"numpy>=1.23,<3.0a0",
"pytest",
"pytest-forked",
"pytest-xdist",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.
[tool.rapids-build-backend]
build-backend = "scikit_build_core.build"
dependencies-file = "../../dependencies.yaml"
Expand Down

0 comments on commit a4d7667

Please sign in to comment.