From 7c4c787518103b3a53f5027d25e91b955559aa7d Mon Sep 17 00:00:00 2001 From: akcelero Date: Sun, 19 Nov 2023 00:47:19 +0100 Subject: [PATCH 1/6] feature: add github action and dependabot --- .github/dependabot.yaml | 15 ++++++++++++ .github/workflows/run-tests.yaml | 42 ++++++++++++++++++++++++++++++++ setup.py | 2 -- tox.ini | 14 +++++++++++ 4 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 .github/dependabot.yaml create mode 100644 .github/workflows/run-tests.yaml create mode 100644 tox.ini diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..7525e62 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,15 @@ +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + commit-message: + prefix: "[pip] " + + - package-ecosystem: "github-actions" + directory: "/.github/workflows/" + schedule: + interval: "daily" + commit-message: + prefix: "[github-actions] " diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml new file mode 100644 index 0000000..5918360 --- /dev/null +++ b/.github/workflows/run-tests.yaml @@ -0,0 +1,42 @@ +name: Tests + +on: [pull_request] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + max-parallel: 4 + matrix: + python-version: ["3.10", "3.11", "3.12"] + os: [ubuntu] + + defaults: + run: + shell: bash + working-directory: . + + steps: + - name: Checkout repo + uses: actions/checkout@v4.1.1 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + if: steps.cache-venv.outputs.cache-hit != 'true' + run: | + pip install ".[test]" + + - name: Test with pytest + run: | + python -m pytest --junitxml=pytest.xml --cov=merkle_zeppelin | tee pytest-result.txt + + - name: Make comment with test coverage + uses: MishaKav/pytest-coverage-comment@main + if: github.event_name != 'dependabot[bot]' + with: + pytest-coverage-path: ./pytest-result.txt + junitxml-path: ./pytest.xml diff --git a/setup.py b/setup.py index 7e189ae..d2bae39 100644 --- a/setup.py +++ b/setup.py @@ -44,8 +44,6 @@ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "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", "Programming Language :: Python :: 3.12", diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..7fe808e --- /dev/null +++ b/tox.ini @@ -0,0 +1,14 @@ +[pytest] +addopts = --maxfail=5 -rf +console_output_style = progress +minversion = 7.0.0 +testpaths = tests/ + +[coverage:report] +show_missing = True +skip_covered = True + +# SKIPPED ADDITIONAL MANAGEMENT COMMAND +exclude_lines = + def __str__ + pragma: no cover From 82b671a45538c1b0adea545c81fc0b7fa91f4e48 Mon Sep 17 00:00:00 2001 From: akcelero Date: Mon, 20 Nov 2023 14:06:39 +0100 Subject: [PATCH 2/6] Change os to ubuntu-latest --- .github/workflows/run-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 5918360..36d8602 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -9,7 +9,7 @@ jobs: max-parallel: 4 matrix: python-version: ["3.10", "3.11", "3.12"] - os: [ubuntu] + os: ["ubuntu-latest"] defaults: run: From 46dd66d08689ee6d4a22f4056c95718bca921f37 Mon Sep 17 00:00:00 2001 From: akcelero Date: Mon, 20 Nov 2023 14:07:49 +0100 Subject: [PATCH 3/6] Add python3.8 and 3.9 to tests --- .github/workflows/run-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 36d8602..13d656d 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -8,7 +8,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] os: ["ubuntu-latest"] defaults: From a2f1e5bb423c364c2681da87db97dd5fad0f0ce4 Mon Sep 17 00:00:00 2001 From: akcelero Date: Mon, 20 Nov 2023 14:10:33 +0100 Subject: [PATCH 4/6] Remove python3.8 from tests --- .github/workflows/run-tests.yaml | 2 +- setup.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 13d656d..d86cb97 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -8,7 +8,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12"] os: ["ubuntu-latest"] defaults: diff --git a/setup.py b/setup.py index d2bae39..dd15a41 100644 --- a/setup.py +++ b/setup.py @@ -44,6 +44,7 @@ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", From e02460c093ab93370117e15818792afab7a6e733 Mon Sep 17 00:00:00 2001 From: akcelero Date: Mon, 20 Nov 2023 14:13:26 +0100 Subject: [PATCH 5/6] improve tox.ini --- tox.ini | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 7fe808e..3c573e9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [pytest] -addopts = --maxfail=5 -rf +addopts = --maxfail=2 -rf console_output_style = progress minversion = 7.0.0 testpaths = tests/ @@ -7,8 +7,6 @@ testpaths = tests/ [coverage:report] show_missing = True skip_covered = True - -# SKIPPED ADDITIONAL MANAGEMENT COMMAND exclude_lines = def __str__ pragma: no cover From 638b6c6cac830f748bd2d3c7d81864e0e3d8dda1 Mon Sep 17 00:00:00 2001 From: akcelero Date: Mon, 20 Nov 2023 14:16:35 +0100 Subject: [PATCH 6/6] github action tests improvment --- .github/workflows/run-tests.yaml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index d86cb97..4e3655c 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -11,11 +11,6 @@ jobs: python-version: ["3.9", "3.10", "3.11", "3.12"] os: ["ubuntu-latest"] - defaults: - run: - shell: bash - working-directory: . - steps: - name: Checkout repo uses: actions/checkout@v4.1.1 @@ -27,15 +22,13 @@ jobs: - name: Install dependencies if: steps.cache-venv.outputs.cache-hit != 'true' - run: | - pip install ".[test]" + run: pip install ".[test]" - name: Test with pytest - run: | - python -m pytest --junitxml=pytest.xml --cov=merkle_zeppelin | tee pytest-result.txt + run: python -m pytest --junitxml=pytest.xml --cov=merkle_zeppelin | tee pytest-result.txt - name: Make comment with test coverage - uses: MishaKav/pytest-coverage-comment@main + uses: MishaKav/pytest-coverage-comment@v1.1.49 if: github.event_name != 'dependabot[bot]' with: pytest-coverage-path: ./pytest-result.txt