Skip to content

Commit

Permalink
Merge pull request #2 from levje/levje/dpo-fix-scilpy-install
Browse files Browse the repository at this point in the history
update install scripts
  • Loading branch information
levje authored Nov 8, 2024
2 parents 87917b4 + b220438 commit a3ed821
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ jobs:
env:
SETUPTOOLS_USE_DISTUTILS: "stdlib"
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
./install.sh
python -m pip install pytest pytest-console-scripts
bash install.sh
- name: Run tests
run: python -m pytest .
22 changes: 12 additions & 10 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/bash
set -e

# Install required packages
# Print OS information compatible with Linux, macOS and Windows
echo "Platform:" $(uname )
# Print python version
echo "Python version: $(python --version)"
# If platform has CUDA installed

# If cuda is installed, check the version
if [ -x "$(command -v nvidia-smi)" ]; then
# Print GPU name
echo "Found GPU: $(nvidia-smi --query-gpu=name --format=csv,noheader)"
# Print CUDA version from grepping nvidia-smi
echo "Found CUDA version: $(nvidia-smi | grep "CUDA Version" | awk '{print $9}')"
# Check CUDA version and format as cuXXX

FOUND_CUDA=$(nvidia-smi | grep "CUDA Version" | awk '{print $9}' | sed 's/\.//g')
if (( $FOUND_CUDA == 118 )); then
CUDA_VERSION="cu118"
Expand All @@ -24,9 +24,8 @@ else
CUDA_VERSION="cpu"
fi

echo "Installing required packages."

pip install Cython==0.29.* numpy==1.23.* packaging --quiet
echo "Updating pip ..."
pip install --upgrade pip --quiet

if [[ "$OSTYPE" == "darwin"* ]]; then
echo "Installing PyTorch 2.2.0"
Expand All @@ -38,7 +37,10 @@ else
pip install torch==2.2.0 torchvision==0.17.0 torchaudio==2.2.0 --extra-index-url https://download.pytorch.org/whl/${CUDA_VERSION} --quiet
fi

echo "Installing other required packages ..."
pip install -r requirements.txt --quiet

# Install other required packages and modules
echo "Finalizing installation ..."
pip install -e . --quiet
pip install -e .
echo "Done !"
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build-system]
requires = ["setuptools", "wheel", "torch==2.2.0"]
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dwi-ml @ git+https://github.com/scil-vital/dwi_ml@for_beluga_scilpy2
dwi-ml @ git+https://github.com/levje/dwi_ml@update_scilpy
pytest
8 changes: 3 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@

here = os.path.abspath(os.path.dirname(__file__))

with open('requirements.txt') as f:
required_dependencies = f.read().splitlines()
external_dependencies = []
for dependency in required_dependencies:
external_dependencies.append(dependency)
external_dependencies = [
"dwi-ml"
]

setup(
name='Track-to-Learn',
Expand Down

0 comments on commit a3ed821

Please sign in to comment.