diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 979bfe1..0000000 --- a/.coveragerc +++ /dev/null @@ -1,4 +0,0 @@ -[run] -source = cotainr -omit = cotainr/tests/* -branch = True \ No newline at end of file diff --git a/.github/workflows/CI_pull_request.yml b/.github/workflows/CI_pull_request.yml index debdf83..d1bd810 100644 --- a/.github/workflows/CI_pull_request.yml +++ b/.github/workflows/CI_pull_request.yml @@ -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 @@ -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: | diff --git a/.github/workflows/CI_push.yml b/.github/workflows/CI_push.yml index 7ec6ab1..a053ebf 100644 --- a/.github/workflows/CI_push.yml +++ b/.github/workflows/CI_push.yml @@ -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" diff --git a/.github/workflows/SCHED_docs_linkcheck.yml b/.github/workflows/SCHED_docs_linkcheck.yml index 39157e3..ac0e338 100644 --- a/.github/workflows/SCHED_docs_linkcheck.yml +++ b/.github/workflows/SCHED_docs_linkcheck.yml @@ -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 diff --git a/.readthedocs.yml b/.readthedocs.yml index 550b6d8..91421d7 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -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 diff --git a/docs-requirements.txt b/docs-requirements.txt deleted file mode 100644 index 1f89a5e..0000000 --- a/docs-requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -numpydoc>=1.5.0 -pydata-sphinx-theme>=0.13.3 -sphinx>=7.2.5 -sphinx-design>=0.5.0 -myst-parser>=2.0.0 \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a8e9892 --- /dev/null +++ b/pyproject.toml @@ -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 diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 773daf8..0000000 --- a/pytest.ini +++ /dev/null @@ -1,9 +0,0 @@ -[pytest] -minversion = 6.0 -addopts = -ra -l --cov --cov-config=.coveragerc --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 \ No newline at end of file diff --git a/test-requirements.txt b/test-requirements.txt deleted file mode 100644 index e816bc6..0000000 --- a/test-requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -pytest>=6.0 -pytest-cov>=2.10 \ No newline at end of file