Skip to content

Commit

Permalink
Merged 'imqcam-master' that adds support for conda installation.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauriaristi committed Aug 19, 2024
2 parents 5d587a2 + cd4747c commit 9431fb8
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/build_and_upload_conda.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build and upload conda package

on:
# release:
# types: [published]
push:
branches:
- master
pull_request:
types: [closed]
branches:
- master

jobs:
build_and_upload:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
arch: [x86_64, arm64]
exclude:
- os: ubuntu-latest
arch: arm64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Conda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: pyoti
auto-update-conda: true
python-version: 3.9
channels: conda-forge,defaults
channel-priority: strict
architecture: ${{ matrix.arch }}
- name: Set environment variable for sourcing conda (Linux)
if: runner.os == 'Linux'
run: |
echo "RUNNER_OS_SOURCE=/home/runner/.profile" >> $GITHUB_ENV
- name: Set environment variable for sourcing conda (Mac)
if: runner.os == 'macOS'
run: |
echo "RUNNER_OS_SOURCE=/Users/runner/.profile" >> $GITHUB_ENV
- name: Install build tools
run: |
source $RUNNER_OS_SOURCE
conda activate pyoti
conda install -y conda-build anaconda-client
- name: Build Conda package
run: |
source $RUNNER_OS_SOURCE
conda activate pyoti
conda build conda
- name: Upload Conda package
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
source $RUNNER_OS_SOURCE
conda activate pyoti
PACKAGE_PATH=$(conda build conda --output)
anaconda -t $ANACONDA_TOKEN upload -u mauriaristi $PACKAGE_PATH --channel main --label main --force
89 changes: 89 additions & 0 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package:
name: pyoti
version: "1.0.0"

source:
path: ..

build:
number: 0
script: |
mkdir build
cd build
cmake ..
echo "checking SP_DIR"
echo $SP_DIR
make
make gendata
cp -r pyoti $PREFIX/lib/python$PY_VER/site-packages/pyoti
cp -r data $PREFIX/lib/python$PY_VER/site-packages/data
matrix:
- os: linux
arch: x86_64
- os: osx
arch: x86_64
- os: osx
arch: arm64

requirements:
build:
- python=3.9.*
- numpy
- scipy
- pandas
- cython=0.29.*
- make
- cmake
- gfortran
- pip
- ipykernel
- conda-forge::pyvista
- conda-forge::gmsh
- conda-forge::python-gmsh
- conda-forge::vtk
- conda-forge::scikit-sparse
- conda-forge::scikit-umfpack

host:
- python=3.9.*
- numpy
- scipy
- pandas
- cython=0.29.*
- make
- cmake
- gfortran
- pip
- ipykernel
- conda-forge::pyvista
- conda-forge::gmsh
- conda-forge::python-gmsh
- conda-forge::vtk
- conda-forge::scikit-sparse
- conda-forge::scikit-umfpack

run:
- python=3.9.*
- numpy
- scipy
- pandas
- cython=0.29.*
- conda-forge::pyvista
- conda-forge::gmsh
- conda-forge::python-gmsh
- conda-forge::vtk
- conda-forge::scikit-sparse
- conda-forge::scikit-umfpack

test:
imports:
- pyoti
commands:
- python -c "import pyoti"

about:
home: imqcam/otilib

channels:
- conda-forge
- defaults
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dependencies:
- numpy
- scipy
- cython=0.29.*
- pandas
- make
- cmake
- pip
Expand Down

0 comments on commit 9431fb8

Please sign in to comment.