From 713ec041136a7098f8ef2e6fe5a8f654b1c32c3b Mon Sep 17 00:00:00 2001 From: Dylan Date: Tue, 29 Oct 2024 18:33:43 +0000 Subject: [PATCH] Added pytest CI --- .github/workflows/{pypi.yml => pypi.yaml} | 0 .../workflows/{pyright.yml => pyright.yaml} | 0 .github/workflows/{pytest.yml => pytest.yaml} | 15 ++++++--- .github/workflows/{ruff.yml => ruff.yaml} | 0 .../{sphinx-docs.yml => sphinx-docs.yaml} | 0 poetry.lock | 33 +++++++++++++++++-- pyproject.toml | 3 +- 7 files changed, 44 insertions(+), 7 deletions(-) rename .github/workflows/{pypi.yml => pypi.yaml} (100%) rename .github/workflows/{pyright.yml => pyright.yaml} (100%) rename .github/workflows/{pytest.yml => pytest.yaml} (58%) rename .github/workflows/{ruff.yml => ruff.yaml} (100%) rename .github/workflows/{sphinx-docs.yml => sphinx-docs.yaml} (100%) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yaml similarity index 100% rename from .github/workflows/pypi.yml rename to .github/workflows/pypi.yaml diff --git a/.github/workflows/pyright.yml b/.github/workflows/pyright.yaml similarity index 100% rename from .github/workflows/pyright.yml rename to .github/workflows/pyright.yaml diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yaml similarity index 58% rename from .github/workflows/pytest.yml rename to .github/workflows/pytest.yaml index 0854f0e..6baf317 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yaml @@ -19,9 +19,9 @@ on: jobs: test: runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.10", "3.11", "3.12"] + # strategy: + # matrix: + # python-version: ["3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 @@ -32,4 +32,11 @@ jobs: - name: Install the project dependencies run: poetry install --with=dev - name: Run the tests - run: pytest tests + run: pytest tests --cov=dfttools --cov-report xml + + # TODO when approved for the maurergroup organisation + # - name: Coveralls GitHub Action + # uses: coverallsapp/github-action@v2.3.4 + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} + # parallel: true # Enable parallel support for Coveralls if needed diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yaml similarity index 100% rename from .github/workflows/ruff.yml rename to .github/workflows/ruff.yaml diff --git a/.github/workflows/sphinx-docs.yml b/.github/workflows/sphinx-docs.yaml similarity index 100% rename from .github/workflows/sphinx-docs.yml rename to .github/workflows/sphinx-docs.yaml diff --git a/poetry.lock b/poetry.lock index 9e75089..66e8a44 100644 --- a/poetry.lock +++ b/poetry.lock @@ -389,6 +389,25 @@ tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.1 [package.extras] toml = ["tomli"] +[[package]] +name = "coveralls" +version = "4.0.1" +description = "Show coverage stats online via coveralls.io" +optional = false +python-versions = "<3.13,>=3.8" +files = [ + {file = "coveralls-4.0.1-py3-none-any.whl", hash = "sha256:7a6b1fa9848332c7b2221afb20f3df90272ac0167060f41b5fe90429b30b1809"}, + {file = "coveralls-4.0.1.tar.gz", hash = "sha256:7b2a0a2bcef94f295e3cf28dcc55ca40b71c77d1c2446b538e85f0f7bc21aa69"}, +] + +[package.dependencies] +coverage = {version = ">=5.0,<6.0.dev0 || >6.1,<6.1.1 || >6.1.1,<8.0", extras = ["toml"]} +docopt = ">=0.6.1,<0.7.0" +requests = ">=1.0.0,<3.0.0" + +[package.extras] +yaml = ["pyyaml (>=3.10,<7.0)"] + [[package]] name = "cycler" version = "0.12.1" @@ -404,6 +423,16 @@ files = [ docs = ["ipython", "matplotlib", "numpydoc", "sphinx"] tests = ["pytest", "pytest-cov", "pytest-xdist"] +[[package]] +name = "docopt" +version = "0.6.2" +description = "Pythonic argument parser, that will make you smile" +optional = false +python-versions = "*" +files = [ + {file = "docopt-0.6.2.tar.gz", hash = "sha256:49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491"}, +] + [[package]] name = "docutils" version = "0.21.2" @@ -1766,5 +1795,5 @@ files = [ [metadata] lock-version = "2.0" -python-versions = "^3.10" -content-hash = "5cd240c054a48392de43eb9235a618df03699b13a8f0b2faa6ad03c50bacbd54" +python-versions = "^3.10, <3.13" +content-hash = "d1e9bd2f2a28120fd6f1943985c293074f2b6d9ae9e4e7fabb4adf8f48e554f6" diff --git a/pyproject.toml b/pyproject.toml index 1970534..1357afe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ license = "GPL-3.0" readme = "README.md" [tool.poetry.dependencies] -python = "^3.10" +python = "<=3.10,<3.13" numpy = "^1.26.4" scipy = "^1.13.0" ase = "^3.22.1" @@ -28,6 +28,7 @@ pyright = "^1.1.373" ptpython = "^3.0.26" pytest = "^8.2.0" pytest-cov = "^5.0.0" +coveralls = "^4.0.1" [tool.poetry.group.docs] optional = true