Skip to content

Commit

Permalink
Merge branch 'master' into docs-save-figures
Browse files Browse the repository at this point in the history
  • Loading branch information
dominiquesydow committed Dec 26, 2022
2 parents 9df0513 + 84f9ff6 commit 9bbd316
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 146 deletions.
175 changes: 83 additions & 92 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,101 +16,97 @@ on:
# Nightly tests run on master by default:
# Scheduled workflows run on the latest commit on the default or base branch.
# (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)
- cron: "0 0 * * *"
- cron: "0 3 10 * *"

jobs:

test:
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
name: Test on ${{ matrix.cfg.os }}, Python ${{ matrix.cfg.python-version }}
runs-on: ${{ matrix.cfg.os }}
strategy:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
python-version: [3.7, 3.8, 3.9]
cfg:
- os: ubuntu-latest
python-version: "3.8"
- os: ubuntu-latest
python-version: "3.9"
- os: ubuntu-latest
python-version: "3.10"
- os: macos-latest
python-version: "3.8"
- os: windows-latest
python-version: "3.8"

steps:
- uses: actions/checkout@v1

- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
# More info on options: https://github.com/conda-incubator/setup-miniconda
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
environment-file: devtools/conda-envs/test_env.yaml

channels: conda-forge,defaults

activate-environment: test
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true

- name: Install package
# conda setup requires this special shell
shell: bash -l {0}
run: |
python -m pip install . --no-deps
conda list
- name: Run package tests
shell: bash -l {0}
run: |
pytest -v --cov=dynophores --cov-report=xml --color=yes dynophores/tests/
- name: Run docs notebooks tests
shell: bash -l {0}
run: |
PYTEST_ARGS="--nbval-lax --current-env --nbval-cell-timeout=900"
pytest $PYTEST_ARGS docs/tutorials/*.ipynb -vvv
pytest $PYTEST_ARGS dynophores/notebooks/*.ipynb -vvv
- name: CodeCov
uses: codecov/codecov-action@v2
with:
files: ./coverage.xml
flags: unittests
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
- uses: actions/checkout@v3

- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
# More info on options: https://github.com/marketplace/actions/provision-with-micromamba
- uses: mamba-org/provision-with-micromamba@main
with:
environment-file: devtools/conda-envs/test_env.yaml
environment-name: test
channels: conda-forge,defaults
extra-specs: |
python=${{ matrix.python-version }}
- name: Install package
shell: bash -l {0}
run: |
python -m pip install . --no-deps
micromamba list
- name: Run tests
shell: bash -l {0}
run: |
pytest -v --cov=dynophores --cov-report=xml --color=yes dynophores/tests/
- name: Run docs notebooks tests
shell: bash -l {0}
run: |
PYTEST_ARGS="--nbval-lax --current-env --nbval-cell-timeout=900"
pytest $PYTEST_ARGS docs/tutorials/*.ipynb -vvv
pytest $PYTEST_ARGS dynophores/notebooks/*.ipynb -vvv
- name: CodeCov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unittests
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}

lint-format:
runs-on: ubuntu-latest
env:
CI_OS: ubuntu-latest
PACKAGE: "dynophores"
PYVER: "3.7"
name: Lint/format test on ${{ matrix.os }}, Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8]

steps:
- name: Checkout the code
uses: actions/checkout@v2
- uses: actions/checkout@v3

# More info on options: https://github.com/conda-incubator/setup-miniconda
- uses: conda-incubator/setup-miniconda@v2
# More info on options: https://github.com/marketplace/actions/provision-with-micromamba
- uses: mamba-org/provision-with-micromamba@main
with:
python-version: ${{ matrix.python-version }}
environment-file: devtools/conda-envs/test_env.yaml
channels: conda-forge,defaults,bioconda
activate-environment: test
auto-update-conda: true
auto-activate-base: false
show-channel-urls: true
# mamba-version: "*"
environment-name: test
channels: conda-forge,defaults
extra-specs: |
python=${{ matrix.python-version }}
- name: Install linter and formatter
shell: bash -l {0}
run: |
conda install -y flake8 black
python -m pip install black-nb shyaml
python -m pip install flake8-nb
python -m pip install shyaml flake8 black black-nb flake8-nb
- name: Run black check
shell: bash -l {0}
if: always()
run: |
black --check -l 99 dynophores
Expand All @@ -121,7 +117,6 @@ jobs:
- name: Run black-nb check
shell: bash -l {0}
if: always()
run: |
black-nb --check -l 99 docs/tutorials/*.ipynb
black-nb --check -l 99 dynophores/notebooks/*.ipynb
Expand All @@ -132,35 +127,31 @@ jobs:
flake8-nb --config setup.cfg docs/tutorials/*.ipynb
flake8-nb --config setup.cfg dynophores/notebooks/*.ipynb
docs:
runs-on: ubuntu-latest
env:
CI_OS: ubuntu-latest
PACKAGE: "dynophores"
PYVER: "3.7"
name: Docs test on ${{ matrix.os }}, Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8]

steps:
- name: Checkout the code
uses: actions/checkout@v2
- uses: actions/checkout@v3

# More info on options: https://github.com/conda-incubator/setup-miniconda
- uses: conda-incubator/setup-miniconda@v2
# More info on options: https://github.com/marketplace/actions/provision-with-micromamba
- uses: mamba-org/provision-with-micromamba@main
with:
python-version: ${{ matrix.python-version }}
environment-file: devtools/conda-envs/test_env.yaml
channels: conda-forge,defaults,bioconda
activate-environment: test
auto-update-conda: true
auto-activate-base: false
show-channel-urls: true
# mamba-version: "*"
environment-name: test
channels: conda-forge,defaults
extra-specs: |
python=${{ matrix.python-version }}
- name: Install package
shell: bash -l {0}
run: |
python -m pip install . --no-deps
conda list
micromamba list
- name: Run sphinx
shell: bash -l {0}
Expand Down
9 changes: 7 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@
# Required
version: 2

sphinx:
configuration: docs/conf.py
# Default
formats: []

build:
os: "ubuntu-20.04"
tools:
python: "mambaforge-4.10"

conda:
environment: devtools/conda-envs/test_env.yaml
19 changes: 8 additions & 11 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@ channels:
- conda-forge
- defaults
dependencies:
# Base depends
- python>=3.6
# Base depends
- python>=3.8
- pip
- numpy
- pandas
- pandas
- matplotlib
- seaborn
- jupyter
- jupyterlab>=3
- ipywidgets>=7.5
# https://github.com/wolberlab/dynophores/issues/59
- ipywidgets<8
- ipympl
- nglview>=3
- rdkit
- mdanalysis
# Testing
- pytest 5.*
- pytest
- pytest-xdist
- pytest-cov
- nbval
- shyaml
- pytest-cov
- codecov
# Docs
- sphinx
Expand All @@ -33,8 +33,5 @@ dependencies:
- black
- flake8
- pip:
- black-nb
- flake8-nb

## For Jupyter lab extensions, run:
# jupyter labextension install @jupyter-widgets/jupyterlab-manager nglview-js-widgets @ijmbarr/jupyterlab_spellchecker @jupyter-widgets/html-manager
- black-nb
- flake8-nb
41 changes: 0 additions & 41 deletions devtools/legacy-miniconda-setup/before_install.sh

This file was deleted.

2 changes: 2 additions & 0 deletions docs/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Installing
We are assuming you have a working ``mamba`` installation in your computer.
If this is not the case, please refer to their `official documentation <https://mamba.readthedocs.io/en/latest/installation.html#mamba>`_.

If you installed ``mamba`` into an existing ``conda`` installation, also make sure that the ``conda-forge`` channel is configured by running ``conda config --add channels conda-forge``.


Install from the conda package
------------------------------
Expand Down

0 comments on commit 9bbd316

Please sign in to comment.