Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 17 additions & 59 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,64 +38,22 @@ jobs:
core.info(`PR opened correctly against ${allowed_basebranch}`);
}


tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
needs: initial_checks
strategy:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
with:
envs: |
- linux: py311-test-cov
- linux: py310-test-alldeps
toxargs: '-v --develop'
- linux: py39-test-oldestdeps-alldeps-cov-clocale
- windows: py310-test-alldeps
# - macos: py310-test-alldeps
# libraries:
# brew:
# - gcc

conda: true
coverage: codecov
fail-fast: true
matrix:
include:

- name: Python 3.11 with minimal dependencies and full coverage
os: ubuntu-latest
python: '3.11'
toxenv: py311-test-cov

- name: Python 3.10 with all optional dependencies
os: ubuntu-latest
python: '3.10'
toxenv: py310-test-alldeps
toxargs: -v --develop

- name: Python 3.9 with oldest supported version of all dependencies
os: ubuntu-18.04
python: '3.9'
toxenv: py39-test-oldestdeps-alldeps-cov-clocale

- name: Python 3.10 with all optional dependencies (Windows)
os: windows-latest
python: '3.10'
toxenv: py310-test-alldeps
toxposargs: --durations=50

- name: Python 3.10 with all optional dependencies (MacOS X)
os: macos-latest
python: '3.10'
toxenv: py310-test-alldeps
toxposargs: --durations=50

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install language-pack-fr and tzdata
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install language-pack-fr tzdata
- name: Install Python dependencies
run: python -m pip install --upgrade tox codecov
- name: Run tests
run: tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }}
- name: Upload coverage to codecov
if: ${{ contains(matrix.toxenv,'-cov') }}
uses: codecov/codecov-action@v2
with:
file: ./coverage.xml
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ repos:
hooks:
- id: mypy
additional_dependencies: [
"git+https://github.com/python-cosmology/cosmology-api.git#egg=cosmology-api"
"git+https://github.com/cosmology-api/cosmology-api.git#egg=cosmology-api"
]
args:
- --strict
13 changes: 7 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
"Programming Language :: Python :: 3",
]
dependencies = [
"cosmology.api @ git+https://github.com/python-cosmology/cosmology-api.git",
"cosmology.compat.astropy @ git+https://github.com/python-cosmology/cosmology-compat-astropy.git"
"cosmology.api @ git+https://github.com/cosmology-api/cosmology-api.git",
"cosmology.compat.astropy @ git+https://github.com/cosmology-api/cosmology-compat-astropy.git",
"cosmology.compat.camb @ git+https://github.com/cosmology-api/cosmology-compat-camb.git"
]

[project.optional-dependencies]
Expand All @@ -48,9 +49,9 @@
]

[project.urls]
homepage = "https://cosmology.readthedocs.org/core"
repository = "https://github.com/python-cosmology/cosmology-core"
documentation = "https://cosmology.readthedocs.org/core"
homepage = "https://cosmology.readthedocs.org/compat"
repository = "https://github.com/cosmology-api/cosmology-compat"
documentation = "https://cosmology.readthedocs.org/compat"


[build-system]
Expand Down Expand Up @@ -141,7 +142,7 @@ select = ["ALL"]
ignore = [
"ANN101", "ANN102", "ANN401",
"ARG001", "ARG002",
"D105", "D107", "D203", "D213",
"D105", "D107", "D203", "D213", "D401",
"FBT003",
"PD",
"RET505", "RET506", "RET507",
Expand Down
8 changes: 8 additions & 0 deletions tests/compat/test_astropy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Test the Cosmology API compat library."""


def test_imported():
"""This is a namespace package, so it should be importable."""
import cosmology.compat.astropy

assert cosmology.compat.astropy.__name__ == "cosmology.compat.astropy"
8 changes: 8 additions & 0 deletions tests/compat/test_camb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Test the Cosmology API compat library."""


def test_imported():
"""This is a namespace package, so it should be importable."""
import cosmology.compat.camb

assert cosmology.compat.camb.__name__ == "cosmology.compat.camb"