Skip to content

Commit

Permalink
AB#525 Consolidated setup in pyproject.toml and updated GH-actions ve…
Browse files Browse the repository at this point in the history
…rsions.
  • Loading branch information
Chroxvi committed Mar 5, 2024
1 parent 6d0f2ff commit f70bfa4
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 37 deletions.
4 changes: 0 additions & 4 deletions .coveragerc

This file was deleted.

15 changes: 9 additions & 6 deletions .github/workflows/CI_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
singularity-version: "3.9.2"
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Attempt to restore Singularity/Apptainer installer from cache
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-singularity-installer
with:
path: ./singularity_installer.deb
Expand All @@ -45,19 +45,22 @@ jobs:
sudo apt install ./singularity_installer.deb
singularity --version
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: "**/test-requirements.txt"
cache-dependency-path: |
**/pyproject.toml
**/tests/__init__.py # Make cache key depend on test file to differentiate from docs cache
- name: Install test dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r test-requirements.txt
python3 -m pip install flit>=3.4
flit install --only-deps --extras=test
- name: Run test suite via pytest
run: pytest -vv --junitxml=pytest_junit_out.xml
- name: Archive the test results and coverage
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test-results-and-coverage_python${{ matrix.python-version }}_${{ matrix.singularity-provider }}${{ matrix.singularity-version }}
path: |
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/CI_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,19 @@ jobs:
python-version: ["3.9", "3.11"]
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: "**/test-requirements.txt"
cache-dependency-path: |
**/pyproject.toml
**/tests/__init__.py # Make cache key depend on test file to differentiate from docs cache
- name: Install test dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r test-requirements.txt
python3 -m pip install flit>=3.4
flit install --only-deps --extras=test
- name: Run unittests via pytest
run: pytest -vv -m "not endtoend and not singularity_integration and not conda_integration"
11 changes: 7 additions & 4 deletions .github/workflows/SCHED_docs_linkcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: pip
cache-dependency-path: "**/docs-requirements.txt"
cache-dependency-path: |
**/pyproject.toml
**/doc/conf.py # Make cache key depend on docs file to differentiate from test cache
- name: Install docs dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r docs-requirements.txt
python3 -m pip install flit>=3.4
flit install --only-deps --extras=docs
- name: Build documentation
run: |
make -C doc apidoc
Expand Down
5 changes: 2 additions & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ build:
python: "3"
jobs:
pre_build:
- python3 -m pip install flit>=3.4
- flit install --only-deps --extras=docs
- make -C doc apidoc
- make -C doc relnotes
sphinx:
builder: html
configuration: doc/conf.py
fail_on_warning: true
python:
install:
- requirements: docs-requirements.txt
5 changes: 0 additions & 5 deletions docs-requirements.txt

This file was deleted.

63 changes: 63 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[build-system]
requires = ["flit_core >=3.4,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "cotainr"
authors = [{name = "DeiC, deic.dk"}]
readme = "README.md"
dynamic = ["version", "description"]
requires-python = ">=3.8" # Synchronize this with _minimum_dependency_version in __init__.py
maintainers = [
{name = "Christian Schou Oxvig"},
{name = "Eske Christiansen"}]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: European Union Public Licence 1.2 (EUPL 1.2)",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11", # Synchronize this with _minimum_dependency_version in __init__.py and the CI setup
"Topic :: Scientific/Engineering",
]
keywords = ["container", "singularity", "apptainer"]

[project.optional-dependencies]
test = [
"pytest>=6.0",
"pytest-cov>=2.10",
]
docs = [
"numpydoc>=1.5.0",
"pydata-sphinx-theme>=0.13.3",
"sphinx>=7.2.5",
"sphinx-design>=0.5.0",
"myst-parser>=2.0.0",
]

[project.urls]
Documentation = "https://cotainr.readthedocs.io"
Source = "https://github.com/DeiC-HPC/cotainr"
Issues = "https://github.com/DeiC-HPC/cotainr/issues"

[project.scripts]
cotainr = "cotainr.cli:main"

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-ra -l --cov --cov-report=term-missing --cov-report=html"
testpaths = ["cotainr/tests"]
junit_suite_name = "cotainr_test_suite"
markers = [
"conda_integration: marks tests of integration with conda/mamba",
"endtoend: marks end-to-end test cases",
"singularity_integration: marks tests of integration with singularity",
]

[tool.coverage.run]
source = ["cotainr"]
omit = ["cotainr/tests/*"]
branch = true
9 changes: 0 additions & 9 deletions pytest.ini

This file was deleted.

2 changes: 0 additions & 2 deletions test-requirements.txt

This file was deleted.

0 comments on commit f70bfa4

Please sign in to comment.