format "Returns:" doc strings for dicts #103
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Runs the complete test suite incl. many external command line dependencies (like Openbabel) | |
# as well as the pymatgen.ext package. Coverage used to be computed based on this workflow. | |
name: Tests | |
on: | |
push: | |
branches: [master] | |
paths-ignore: ["**/*.md", docs/**] | |
pull_request: | |
branches: [master] | |
paths-ignore: ["**/*.md", docs/**] | |
workflow_dispatch: | |
workflow_call: # make this workflow reusable by release.yml | |
permissions: | |
contents: read | |
jobs: | |
test: | |
# prevent this action from running on forks | |
if: github.repository == 'materialsproject/pymatgen' | |
defaults: | |
run: | |
shell: bash -l {0} # enables conda/mamba env activation by reading bash profile | |
strategy: | |
fail-fast: false | |
matrix: | |
# pytest-split automatically distributes work load so parallel jobs finish in similar time | |
os: [ubuntu-latest, windows-latest] | |
python-version: ["3.9", "3.12"] | |
split: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] | |
# include/exclude is meant to maximize CI coverage of different platforms and python | |
# versions while minimizing the total number of jobs. We run all pytest splits with the | |
# oldest supported python version (currently 3.9) on windows (seems most likely to surface | |
# errors) and with newest version (currently 3.12) on ubuntu (to get complete and speedy | |
# coverage on unix). We ignore mac-os, which is assumed to be similar to ubuntu. | |
exclude: | |
- os: windows-latest | |
python-version: "3.12" | |
- os: ubuntu-latest | |
python-version: "3.9" | |
runs-on: ${{ matrix.os }} | |
env: | |
PMG_MAPI_KEY: ${{ secrets.PMG_MAPI_KEY }} | |
PMG_VASP_PSP_DIR: ${{ github.workspace }}/tests/files | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
- name: Set up micromamba | |
uses: mamba-org/setup-micromamba@main | |
- name: Create mamba environment | |
run: | | |
micromamba create -n pmg python=${{ matrix.python-version }} --yes | |
- name: Install uv | |
run: micromamba run -n pmg pip install uv | |
- name: Install ubuntu-only conda dependencies | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
micromamba install -n pmg -c conda-forge enumlib packmol bader openbabel openff-toolkit --yes | |
- name: Install pymatgen and dependencies | |
run: | | |
micromamba activate pmg | |
# TODO remove temporary fix. added since uv install torch is flaky. | |
# track https://github.com/astral-sh/uv/issues/1921 for resolution | |
pip install torch | |
uv pip install numpy cython | |
uv pip install --editable '.[dev,optional]' | |
# TODO remove next line installing ase from main branch when FrechetCellFilter is released | |
uv pip install --upgrade 'git+https://gitlab.com/ase/ase' | |
- name: pytest split ${{ matrix.split }} | |
run: | | |
micromamba activate pmg | |
pytest --splits 10 --group ${{ matrix.split }} --durations-path tests/files/.pytest-split-durations tests |