Skip to content

Commit

Permalink
variable python version, pip f90wrap for MAC?
Browse files Browse the repository at this point in the history
  • Loading branch information
missing-user committed Nov 17, 2024
1 parent 427e1c7 commit 22a6b4e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 58 deletions.
62 changes: 10 additions & 52 deletions .github/workflows/python_wrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ jobs:
python -c "import spec; print('success')"
conda-build-ubuntu:
runs-on: ubuntu-latest
runs-on: {{ matrix.os }}
name: python_wrapper conda build
matrix:
python-version: ["3.9", "3.11", "3.12"]
os: ["ubuntu-latest", "macos-latest"]
defaults:
run:
shell: bash -l {0}
Expand All @@ -44,58 +47,13 @@ jobs:
miniconda-version: "latest"
environment-name: spec_wrapper
environment-file: spec_env.yml
python-version: ${{ matrix.python-version }}
activate-environment: spec_wrapper
# - name: Echo conda environment
# run: conda env export
- name: conda environment
run: conda env export
- name: pip environment
run: pip freeze
- name: Test if installation is ok
run: |
echo $CONDA_PREFIX
conda env export
pip freeze
python --version
python -c "import numpy; print('numpy')"
python -c "import spec; print('success')"
python -c "import py_spec; print('py_spec success')"
conda-test:
name: minimal conda example
runs-on: "ubuntu-latest"
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
environment-file: minimalenv.yml
activate-environment: test
- name: "Call conda install"
run: |
python --version
python -c "import numpy; print('numpy')"
conda-build-macos:
name: Ex2 Mac
runs-on: "macos-latest"
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
environment-file: minimalenv.yml
activate-environment: test
- name: Sh
shell: sh -l {0}
run: |
conda info
conda list
printenv | sort
- name: Bash
shell: bash -el {0}
run: |
conda info
conda list
printenv | sort
python --version
python -c "import numpy; print('numpy')"
python -c "import py_spec; print('py_spec success')"
9 changes: 3 additions & 6 deletions spec_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ channels:
- conda-forge
dependencies:
# Common dependencies
- python=3.11

# Platform agnostic build dependencies
- c-compiler
Expand All @@ -27,18 +26,16 @@ dependencies:
- cmake
- ninja
- f90nml
- f90wrap

- pip
# Install the spec wrapper and py_spec package in editable mode
# as enabled by https://github.com/conda/conda/pull/3969
- pip:
- "."
- "./Utilities/pythontools"
- f90wrap
- -e "."
- -e "./Utilities/pythontools"

# Set environment variables
variables:
# Append py_spec to the python path, so completion is availble in your IDE
PYTHONPATH: "'$PYTHONPATH:$PWD'/Utilities/pythontools"
# Append the spec executable to the PATH, so it can be called from anywhere
# PATH: "'${PATH}:$PWD'"

0 comments on commit 22a6b4e

Please sign in to comment.