Skip to content

Commit

Permalink
Merge pull request #76 from dkazanc/cupy
Browse files Browse the repository at this point in the history
trying new conda build arrangements
  • Loading branch information
dkazanc authored Sep 7, 2023
2 parents 0ca7a8d + d7f2f84 commit d1d61c0
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 85 deletions.
52 changes: 30 additions & 22 deletions .github/workflows/tomobar_conda_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,39 @@ on: [push]

jobs:
build-linux:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'

- name: Install dependencies with Conda
run: |
$CONDA/bin/conda env update --file conda-recipe/environment/environment.yml --name base
$CONDA/bin/conda list
- name: Decrypt a secret
run: ./.scripts/decrypt_secret.sh
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}

- name: Upload the tested package to conda cloud
run: |
chmod +x ./.scripts/conda_upload.sh
./.scripts/conda_upload.sh
- name: Checkout repository code
uses: actions/checkout@v3
with:
ref: "master"
fetch-depth: 0

# setup Python 3.9
- name: Setup Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install dependencies with Conda
run: |
$CONDA/bin/conda install -c conda-forge conda-build
$CONDA/bin/conda install -c conda-forge anaconda-client
$CONDA/bin/conda update conda
$CONDA/bin/conda update conda-build
$CONDA/bin/conda list
- name: Decrypt a secret
run: ./.scripts/decrypt_secret.sh
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}

- name: Upload the tested package to conda cloud
run: |
chmod +x ./.scripts/conda_upload.sh
./.scripts/conda_upload.sh
8 changes: 2 additions & 6 deletions .scripts/conda_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ mkdir ~/conda-bld
conda config --set anaconda_upload no
export CONDA_BLD_PATH=~/conda-bld

for python_ver in 3.9 3.10; do
for numpy_ver in 1.21 1.22 1.23 1.24; do
export VERSION=`date +%Y.%m`"_py"$python_ver"_np"$numpy_ver
conda build . --numpy $numpy_ver --python $python_ver
done
done
export VERSION=$(date +%Y.%m)
$CONDA/bin/conda build .

# upload packages to conda
find $CONDA_BLD_PATH/$OS -name *.tar.bz2 | while read file
Expand Down
13 changes: 6 additions & 7 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,19 @@

### Python conda:
Install the ToMoBAR package from one of conda channels bellow:
```console
conda install -c dkazanc tomobar
conda install -c savu-dep tomobar
```

conda install -c httomo tomobar
```
or build using provided conda recipe:
```console
export VERSION=`date +%Y.%m` (unix) / set VERSION=2023.04 (Windows)
```
export VERSION=$(date +%Y.%m) (unix) / set VERSION=2023.04 (Windows)
conda build conda-recipe/ --numpy 1.23 --python 3.10
conda install -c file://${CONDA_PREFIX}/conda-bld/ tomobar --force-reinstall
```

### Python development environment
* Clone the repository from GitHub page
* Install dependencies from the environment file (or from explicit list file)
* Install dependencies from the [environment](https://github.com/dkazanc/ToMoBAR/tree/master/conda-recipe/environment/environment.yml) file
* Activate the environment with :code:`conda activate tomobar`
* From the root directory install the enviroment in development mode with :code:`pip install -e .[dev]`

Expand Down
1 change: 1 addition & 0 deletions conda-recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
python:
- 3.9
- 3.10
numpy:
- 1.24
7 changes: 3 additions & 4 deletions conda-recipe/environment/environment.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: tomobar
channels:
- conda-forge
- anaconda
dependencies:
- conda-forge::numpy
- conda-forge::python
Expand All @@ -12,6 +11,6 @@ dependencies:
- conda-forge::pyproject-flake8
- conda-forge::pydocstyle
- conda-forge::setuptools
- anaconda::ipython
- anaconda::conda-build
- anaconda::anaconda-client
- conda-forge::ipython
- conda-forge::conda-build
- conda-forge::anaconda-client
43 changes: 0 additions & 43 deletions conda-recipe/explicit_packages/tomobar_env_20_06_22.txt

This file was deleted.

5 changes: 2 additions & 3 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ requirements:
- pip
- setuptools
run:
- python
- numpy
- python={{ python }}
- numpy={{ numpy }}
- setuptools
- scipy
- pillow
- scikit-image
- pytest
Expand Down

0 comments on commit d1d61c0

Please sign in to comment.