Skip to content

Commit

Permalink
SMT from conda-forge + micromamba CI (#66)
Browse files Browse the repository at this point in the history
* use smt from conda forge

* try updated setup miniconda action

* try mamba ...

* this worked locally...

* try this...

* create-args for poython version

* touch setup.cfg

* activate env

* conda activate no good

* require setuptools>=64

* add packages

* double def

* python -m pip vs pip?

* get versions...

* specify python version

* more attempts...

* try no caching

* trying this...

* try micromamba shell

* cleanup

* build docs with micromamba

* Use docs env file

* check python version right before coverage run
  • Loading branch information
timothyas authored Nov 29, 2023
1 parent bcdbd78 commit de100d4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 31 deletions.
32 changes: 17 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
branches:
- "*"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build (${{ matrix.python-version }} | ${{ matrix.os }})
Expand All @@ -23,24 +27,24 @@ jobs:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Cache conda
uses: actions/cache@v3
env:
# Increase this value to reset cache if ci/environment.yaml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment.yaml') }}
- uses: conda-incubator/setup-miniconda@v2
- name: Create conda environment
uses: mamba-org/setup-micromamba@v1
with:
activate-environment: xesn # Defined in ci/environment*.yml
auto-update-conda: false
python-version: ${{ matrix.python-version }}
cache-downloads: true
cache-environment: true
micromamba-version: "latest"
environment-file: ci/environment.yaml
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
create-args: python=${{ matrix.python-version }}
- name: Install xesn
shell: micromamba-shell {0}
run: |
python -V
python -c "import setuptools; print(setuptools.__version__)"
python -m pip install -e . --no-deps
- name: Run Unit Tests
shell: bash -l {0}
run: |
python -V
coverage run --rcfile=coverage.toml -m pytest --verbose xesn/test/matrix.py xesn/test/esn.py xesn/test/lazy.py xesn/test/xdata.py xesn/test/optim.py xesn/test/psd.py xesn/test/cost.py xesn/test/driver.py
- name: Get coverage report
shell: bash -l {0}
Expand All @@ -52,5 +56,3 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: unittests # optional


26 changes: 13 additions & 13 deletions .github/workflows/sphinx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v2
env:
CACHE_NUMBER: 0
- uses: actions/checkout@v3
- name: Create conda environment
uses: mamba-org/setup-micromamba@v1
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('docs/environment.yaml') }}
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: xesn
auto-update-conda: false
python-version: 3.11
cache-downloads: true
cache-environment: true
micromamba-version: "latest"
environment-file: docs/environment.yaml
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
create-args: python=${{ matrix.python-version }}
- name: Install xesn
shell: micromamba-shell {0}
run: |
python -V
python -c "import setuptools; print(setuptools.__version__)"
python -m pip install -e . --no-deps
- name: Build Docs
shell: bash -l {0}
run: |
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ source="https://github.com/timothyas/xesn"
documentation="https://xesn.readthedocs.io/en/latest/"

[build-system]
requires = ["setuptools", "setuptools-scm"]
requires = ["setuptools>=64.0.0", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
where = ["xesn"]
[tool.setuptools]
packages = ["xesn"]

0 comments on commit de100d4

Please sign in to comment.