From ffbf986e6443f859474ad1b546469d1e7eda81a8 Mon Sep 17 00:00:00 2001 From: Alan Rubin Date: Sun, 12 Apr 2026 09:50:29 -0400 Subject: [PATCH 01/19] add support for range-based protein equality --- src/mavehgvs/patterns/protein.py | 4 +++- src/mavehgvs/variant.py | 23 ++++++++++++++--------- tests/test_patterns/test_protein.py | 1 + tests/test_variant.py | 27 +++++++++++++++++++++++++-- 4 files changed, 43 insertions(+), 12 deletions(-) diff --git a/src/mavehgvs/patterns/protein.py b/src/mavehgvs/patterns/protein.py index 0979e62..dd342d0 100644 --- a/src/mavehgvs/patterns/protein.py +++ b/src/mavehgvs/patterns/protein.py @@ -13,7 +13,9 @@ """ pro_equal: str = ( - rf"(?P(?:(?P{aa_pos})?(?P=))|(?P\(=\)))" + rf"(?P(?:(?:(?P{aa_pos})|" + + rf"(?:(?P{aa_pos})_(?P{aa_pos})))?(?P=))|" + + rf"(?P\(=\)))" ) """str: Pattern matching protein equality or synonymous variant. """ diff --git a/src/mavehgvs/variant.py b/src/mavehgvs/variant.py index ea3a0cb..2353c87 100644 --- a/src/mavehgvs/variant.py +++ b/src/mavehgvs/variant.py @@ -396,19 +396,24 @@ def _variant_dictionary_to_string( # noqa: max-complexity: 25 raise MaveHgvsParseError("variant dictionary missing required keys") if variant_type == "equal": - expected_keys = ["variant_type", "prefix"] + expected_keys = ["variant_type", "prefix", "start_position", "end_position"] if prefix == "p": - expected_keys.extend(["position", "target"]) - else: - expected_keys.extend(["start_position", "end_position"]) + expected_keys.extend(["start_target", "end_target"]) if sorted(vdict.keys()) != sorted(expected_keys): raise MaveHgvsParseError("variant dictionary contains invalid keys") - if prefix == "p": - variant_string = f"{vdict['target']}{vdict['position']}=" - elif vdict["start_position"] == vdict["end_position"]: - variant_string = f"{vdict['start_position']}=" + if vdict["start_position"] == vdict["end_position"]: + if prefix == "p": + if vdict["start_target"] == vdict["end_target"]: + variant_string = f"{vdict['start_target']}{vdict['start_position']}=" + else: + raise MaveHgvsParseError("amino acid mismatch at same position") + else: + variant_string = f"{vdict['start_position']}=" else: - variant_string = f"{vdict['start_position']}_{vdict['end_position']}=" + if prefix == "p": + variant_string = f"{vdict['start_target']}{vdict['start_position']}_{vdict['end_target']}{vdict['end_position']}=" + else: + variant_string = f"{vdict['start_position']}_{vdict['end_position']}=" elif variant_type == "sub": if sorted(vdict.keys()) != sorted( ["variant_type", "prefix", "position", "target", "variant"] diff --git a/tests/test_patterns/test_protein.py b/tests/test_patterns/test_protein.py index e2b2aeb..f35d0b2 100644 --- a/tests/test_patterns/test_protein.py +++ b/tests/test_patterns/test_protein.py @@ -24,6 +24,7 @@ def setUpClass(cls): "=", "(=)", "Cys22=", + "Gly12_Glu14=", ] cls.invalid_strings = ["=22", "Arg18(=)", "Cys-22", "=="] diff --git a/tests/test_variant.py b/tests/test_variant.py index 74fc7d5..5e1a605 100644 --- a/tests/test_variant.py +++ b/tests/test_variant.py @@ -80,6 +80,7 @@ def test_sub(self) -> None: "c.12=", "g.88_99=", "c.43-6_595+12=", + "p.Glu12_Gly14=", ] for s in variant_strings: @@ -229,6 +230,7 @@ def test_creation(self): invalid_variant_strings = [ "p.[Glu27Trp;=;Ter345Lys]", "p.[(=);Gly18del;Glu27Trp;Ter345Lys]", + "p.[Gln7_Asn19=;Glu27Trp;Ter345Lys]", "c.[12T>A;=;78+5_78+10del]", "c.[1_3=;12T>A;78+5_78+10del]", "p.[Glu27fs;Arg48Lys]", @@ -296,11 +298,24 @@ def test_equal(self): { "variant_type": "equal", "prefix": "p", - "position": "27", - "target": "Glu", + "start_position": "27", + "start_target": "Glu", + "end_position": "27", + "end_target": "Glu", }, "p.Glu27=", ), + ( + { + "variant_type": "equal", + "prefix": "p", + "start_position": "12", + "start_target": "Glu", + "end_position": "14", + "end_target": "Gly", + }, + "p.Glu12_Gly14=", + ), ( { "variant_type": "equal", @@ -523,6 +538,14 @@ def test_delins(self): "end_target": "Cys", "variant": "AlaGly", }, + { + "variant_type": "equal", + "prefix": "p", + "start_position": "27", + "start_target": "Glu", + "end_position": "27", + "end_target": "Asp", + }, ] for d, s in valid_dict_tuples: From 73ba0ba795cb4899e5674948d9c547b3eda19f9a Mon Sep 17 00:00:00 2001 From: Alan Rubin Date: Sun, 12 Apr 2026 10:01:03 -0400 Subject: [PATCH 02/19] add support for creating full-length identical variants via dict --- src/mavehgvs/variant.py | 36 +++++++++++++++++++++--------------- tests/test_variant.py | 22 ++++++++++++++++++++++ 2 files changed, 43 insertions(+), 15 deletions(-) diff --git a/src/mavehgvs/variant.py b/src/mavehgvs/variant.py index 2353c87..96128b1 100644 --- a/src/mavehgvs/variant.py +++ b/src/mavehgvs/variant.py @@ -396,24 +396,30 @@ def _variant_dictionary_to_string( # noqa: max-complexity: 25 raise MaveHgvsParseError("variant dictionary missing required keys") if variant_type == "equal": - expected_keys = ["variant_type", "prefix", "start_position", "end_position"] - if prefix == "p": - expected_keys.extend(["start_target", "end_target"]) - if sorted(vdict.keys()) != sorted(expected_keys): - raise MaveHgvsParseError("variant dictionary contains invalid keys") - if vdict["start_position"] == vdict["end_position"]: - if prefix == "p": - if vdict["start_target"] == vdict["end_target"]: - variant_string = f"{vdict['start_target']}{vdict['start_position']}=" - else: - raise MaveHgvsParseError("amino acid mismatch at same position") - else: - variant_string = f"{vdict['start_position']}=" + # special case for fully-identical variants + if sorted(vdict.keys()) == ["prefix", "variant_type"]: + variant_string = "=" + elif sorted(vdict.keys()) == ["prefix", "synonymous", "variant_type"] and prefix == "p": + variant_string = "(=)" else: + expected_keys = ["variant_type", "prefix", "start_position", "end_position"] if prefix == "p": - variant_string = f"{vdict['start_target']}{vdict['start_position']}_{vdict['end_target']}{vdict['end_position']}=" + expected_keys.extend(["start_target", "end_target"]) + if sorted(vdict.keys()) != sorted(expected_keys): + raise MaveHgvsParseError("variant dictionary contains invalid keys") + if vdict["start_position"] == vdict["end_position"]: + if prefix == "p": + if vdict["start_target"] == vdict["end_target"]: + variant_string = f"{vdict['start_target']}{vdict['start_position']}=" + else: + raise MaveHgvsParseError("amino acid mismatch at same position") + else: + variant_string = f"{vdict['start_position']}=" else: - variant_string = f"{vdict['start_position']}_{vdict['end_position']}=" + if prefix == "p": + variant_string = f"{vdict['start_target']}{vdict['start_position']}_{vdict['end_target']}{vdict['end_position']}=" + else: + variant_string = f"{vdict['start_position']}_{vdict['end_position']}=" elif variant_type == "sub": if sorted(vdict.keys()) != sorted( ["variant_type", "prefix", "position", "target", "variant"] diff --git a/tests/test_variant.py b/tests/test_variant.py index 5e1a605..cf1b4bb 100644 --- a/tests/test_variant.py +++ b/tests/test_variant.py @@ -294,6 +294,28 @@ def test_overlaps(self): class TestCreateSingleVariantFromValues(unittest.TestCase): def test_equal(self): valid_dict_tuples = [ + ( + { + "variant_type": "equal", + "prefix": "p", + }, + "p.=", + ), + ( + { + "variant_type": "equal", + "prefix": "p", + "synonymous": True, + }, + "p.(=)", + ), + ( + { + "variant_type": "equal", + "prefix": "c", + }, + "c.=", + ), ( { "variant_type": "equal", From dfd5ba47f71bc1df2e1a3736cdff11d6e5b54e19 Mon Sep 17 00:00:00 2001 From: Alan Rubin Date: Tue, 19 May 2026 14:22:03 +1000 Subject: [PATCH 03/19] update tested python versions --- .github/workflows/python-package.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index c995ae7..f3a28fe 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -12,32 +12,37 @@ on: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.11", "3.12", "3.13", "3.14"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} + - name: Install dependencies run: | python -m pip install --upgrade pip python -m pip install flake8 pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Install package run: | python -m pip install . + - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --statistics + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest run: | pytest From fa9afc625d935ebc8b51a4182959006e3c82928c Mon Sep 17 00:00:00 2001 From: Alan Rubin Date: Tue, 19 May 2026 14:22:27 +1000 Subject: [PATCH 04/19] update to new pypi publication system --- .github/workflows/python-publish.yml | 63 ++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 18 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index c831f7a..ea8306c 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -1,4 +1,4 @@ -# This workflow will upload a Python Package using Twine when a release is created +# This workflow will upload a Python Package to PyPI when a release is created # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries # This workflow uses actions that are not certified by GitHub. @@ -16,24 +16,51 @@ permissions: contents: read jobs: - deploy: + release-build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: Build release distributions + run: | + python -m pip install --upgrade pip + python -m pip install hatch + python -m hatch build + + - name: Upload distributions + uses: actions/upload-artifact@v4 + with: + name: release-dists + path: dist/ + + pypi-publish: runs-on: ubuntu-latest + needs: + - release-build + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + + # Dedicated environments with protections for publishing are strongly recommended. + # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules + environment: + name: pypi + # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status: + url: https://pypi.org/p/mavehgvs steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v3 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install hatch - - name: Build package - run: hatch build - - name: Publish package - uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 - with: - user: __token__ - password: ${{ secrets.PYPI_MAVEHGVS }} + - name: Retrieve release distributions + uses: actions/download-artifact@v4 + with: + name: release-dists + path: dist/ + + - name: Publish release distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: dist/ From 3a55dcf3ce06af55e88902d5086bb118983e6d0a Mon Sep 17 00:00:00 2001 From: Alan Rubin Date: Tue, 19 May 2026 14:33:25 +1000 Subject: [PATCH 05/19] update pre-commit versions --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1912aef..693cee5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,10 @@ repos: - repo: https://github.com/psf/black - rev: 23.1.0 + rev: 26.5.1 hooks: - id: black language_version: python3.11 - repo: https://github.com/pycqa/flake8 - rev: 5.0.4 + rev: 7.3.0 hooks: - id: flake8 From 16abb0e709b4f88dd9ccc936c7f2e447e08259ad Mon Sep 17 00:00:00 2001 From: Alan Rubin Date: Tue, 19 May 2026 14:37:43 +1000 Subject: [PATCH 06/19] remove old CI badges --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index c9cd0aa..4efa181 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -[![Build Status](https://travis-ci.com/VariantEffect/mavehgvs.svg?branch=main)](https://travis-ci.com/VariantEffect/mavehgvs) -[![Coverage Status](https://coveralls.io/repos/github/VariantEffect/mavehgvs/badge.svg?branch=main)](https://coveralls.io/github/VariantEffect/mavehgvs?branch=main) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) # mavehgvs From ca2fb491ce5b794f387be0675275832998845dce Mon Sep 17 00:00:00 2001 From: Alan Rubin Date: Tue, 19 May 2026 14:38:16 +1000 Subject: [PATCH 07/19] bump version --- src/mavehgvs/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mavehgvs/__init__.py b/src/mavehgvs/__init__.py index 2a3438d..853b097 100644 --- a/src/mavehgvs/__init__.py +++ b/src/mavehgvs/__init__.py @@ -3,7 +3,7 @@ from mavehgvs.variant import Variant from mavehgvs.util import parse_variant_strings -__version__ = "0.7.0" +__version__ = "0.8.0" __all__ = [ "__version__", From 5c0dc5281628f47d10df0b1f6918a3ff5d340fbd Mon Sep 17 00:00:00 2001 From: Alan Rubin Date: Tue, 19 May 2026 14:46:15 +1000 Subject: [PATCH 08/19] black formatting --- src/mavehgvs/patterns/util.py | 3 +-- src/mavehgvs/variant.py | 29 +++++++++++++++++++++++------ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/mavehgvs/patterns/util.py b/src/mavehgvs/patterns/util.py index 7ac5cfa..1175905 100644 --- a/src/mavehgvs/patterns/util.py +++ b/src/mavehgvs/patterns/util.py @@ -1,5 +1,4 @@ -"""Utility functions for working with mavehgvs regex pattern strings. -""" +"""Utility functions for working with mavehgvs regex pattern strings.""" import re from typing import Sequence, Optional diff --git a/src/mavehgvs/variant.py b/src/mavehgvs/variant.py index 96128b1..ae959e2 100644 --- a/src/mavehgvs/variant.py +++ b/src/mavehgvs/variant.py @@ -399,10 +399,18 @@ def _variant_dictionary_to_string( # noqa: max-complexity: 25 # special case for fully-identical variants if sorted(vdict.keys()) == ["prefix", "variant_type"]: variant_string = "=" - elif sorted(vdict.keys()) == ["prefix", "synonymous", "variant_type"] and prefix == "p": + elif ( + sorted(vdict.keys()) == ["prefix", "synonymous", "variant_type"] + and prefix == "p" + ): variant_string = "(=)" else: - expected_keys = ["variant_type", "prefix", "start_position", "end_position"] + expected_keys = [ + "variant_type", + "prefix", + "start_position", + "end_position", + ] if prefix == "p": expected_keys.extend(["start_target", "end_target"]) if sorted(vdict.keys()) != sorted(expected_keys): @@ -410,16 +418,25 @@ def _variant_dictionary_to_string( # noqa: max-complexity: 25 if vdict["start_position"] == vdict["end_position"]: if prefix == "p": if vdict["start_target"] == vdict["end_target"]: - variant_string = f"{vdict['start_target']}{vdict['start_position']}=" + variant_string = ( + f"{vdict['start_target']}{vdict['start_position']}=" + ) else: - raise MaveHgvsParseError("amino acid mismatch at same position") + raise MaveHgvsParseError( + "amino acid mismatch at same position" + ) else: variant_string = f"{vdict['start_position']}=" else: if prefix == "p": - variant_string = f"{vdict['start_target']}{vdict['start_position']}_{vdict['end_target']}{vdict['end_position']}=" + variant_string = ( + f"{vdict['start_target']}{vdict['start_position']}_" + f"{vdict['end_target']}{vdict['end_position']}=" + ) else: - variant_string = f"{vdict['start_position']}_{vdict['end_position']}=" + variant_string = ( + f"{vdict['start_position']}_{vdict['end_position']}=" + ) elif variant_type == "sub": if sorted(vdict.keys()) != sorted( ["variant_type", "prefix", "position", "target", "variant"] From f9e7b9749c008f7847eef10c69b5e35a713dbd9c Mon Sep 17 00:00:00 2001 From: Alan Rubin Date: Tue, 19 May 2026 14:46:23 +1000 Subject: [PATCH 09/19] add black configuration --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index c3f948a..8ed647c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,3 +50,7 @@ exclude = [ [tool.setuptools.package-data] "mavehgvs" = ["py.typed"] + +[tool.black] +line-length = 88 +target-version = ['py311'] From 80f7812c2736bc1032795687d11024ea6c0a8a99 Mon Sep 17 00:00:00 2001 From: Alan Rubin Date: Tue, 19 May 2026 14:50:26 +1000 Subject: [PATCH 10/19] add test for coverage --- tests/test_variant.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_variant.py b/tests/test_variant.py index cf1b4bb..d52fd84 100644 --- a/tests/test_variant.py +++ b/tests/test_variant.py @@ -606,6 +606,13 @@ def test_extra_keys(self): "variant": "Ser", "position": "Ala", }, + { + "variant_type": "fs", + "prefix": "p", + "position": 80, + "target": "Cys", + "start_position": 23, + }, ] for d in invalid_dicts: From 6a5991aa2fbf9e3acca599c860eaefc75915d8f6 Mon Sep 17 00:00:00 2001 From: Alan Rubin Date: Wed, 20 May 2026 15:58:57 +1000 Subject: [PATCH 11/19] add coveralls.io --- .github/workflows/python-package.yml | 18 +++++++++++++++--- README.md | 1 + 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index f3a28fe..4d6bfd7 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -1,4 +1,5 @@ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# It will also update the test coverage using coveralls.io # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python name: Python package @@ -29,7 +30,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install flake8 pytest + python -m pip install flake8 pytest pytest-cov if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Install package @@ -43,6 +44,17 @@ jobs: # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest + - name: Test with pytest and output coverage report run: | - pytest + pytest --cov=src --cov-report=lcov:coverage-${{ matrix.python-version }}.lcov + + # report coverage under Python 3.11 since that's what MaveDB is using + coverage: + needs: build + if: ${{ always() }} + runs-on: ubuntu-latest + steps: + - name: Coveralls GitHub Action + uses: coverallsapp/github-action@v2 + with: + file: coverage-3.11.lcov diff --git a/README.md b/README.md index 4efa181..ffc785c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![Coverage Status](https://coveralls.io/repos/github/VariantEffect/mavehgvs/badge.svg?branch=main)](https://coveralls.io/github/VariantEffect/mavehgvs?branch=main) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) # mavehgvs From d25cf763ba3adffcad516bf862d68c57b4ee6638 Mon Sep 17 00:00:00 2001 From: Alan Rubin Date: Wed, 20 May 2026 16:04:42 +1000 Subject: [PATCH 12/19] fix actions --- .github/workflows/python-package.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 4d6bfd7..979327c 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -48,12 +48,25 @@ jobs: run: | pytest --cov=src --cov-report=lcov:coverage-${{ matrix.python-version }}.lcov + - name: Upload coverage artefact + # save the file for the Python version we care about (3.11) + if: matrix.python-version == '3.11' + uses: actions/upload-artifact@v4 + with: + name: coverage-report + path: coverage-3.11.lcov + # report coverage under Python 3.11 since that's what MaveDB is using coverage: needs: build if: ${{ always() }} runs-on: ubuntu-latest steps: + - name: Download coverage artefact + uses: actions/download-artifact@v4 + with: + name: coverage-report + - name: Coveralls GitHub Action uses: coverallsapp/github-action@v2 with: From 1af7d5c6b48677ab58a08e7a1f2da7dfb02b8274 Mon Sep 17 00:00:00 2001 From: Alan Rubin Date: Wed, 20 May 2026 16:10:00 +1000 Subject: [PATCH 13/19] test coverage generation --- .github/workflows/python-package.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 979327c..bbc3901 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -47,6 +47,12 @@ jobs: - name: Test with pytest and output coverage report run: | pytest --cov=src --cov-report=lcov:coverage-${{ matrix.python-version }}.lcov + wc -l coverage-${{ matrix.python-version }}.lcov + head -20 coverage-${{ matrix.python-version }}.lcov + + - name: Test with pytest and output coverage report (terminal version) + run: | + pytest --cov=src --cov-report=term - name: Upload coverage artefact # save the file for the Python version we care about (3.11) From d29c4fd277daadd01005d8c735d7a459fddee724 Mon Sep 17 00:00:00 2001 From: Alan Rubin Date: Wed, 20 May 2026 16:14:55 +1000 Subject: [PATCH 14/19] fix and update actions version --- .github/workflows/python-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index bbc3901..13ffd33 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -52,7 +52,7 @@ jobs: - name: Test with pytest and output coverage report (terminal version) run: | - pytest --cov=src --cov-report=term + pytest --cov=mavehgvs --cov-report=term - name: Upload coverage artefact # save the file for the Python version we care about (3.11) From d5c5fc1ae5cb17677e007fdd7605de8d0c775824 Mon Sep 17 00:00:00 2001 From: Alan Rubin Date: Wed, 20 May 2026 16:17:07 +1000 Subject: [PATCH 15/19] fix coverage test --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 13ffd33..e6429ce 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -46,7 +46,7 @@ jobs: - name: Test with pytest and output coverage report run: | - pytest --cov=src --cov-report=lcov:coverage-${{ matrix.python-version }}.lcov + pytest --cov=mavehgvs --cov-report=lcov:coverage-${{ matrix.python-version }}.lcov wc -l coverage-${{ matrix.python-version }}.lcov head -20 coverage-${{ matrix.python-version }}.lcov From 57dec597e048a8b0fd2599b7d8e0e2c58aefc160 Mon Sep 17 00:00:00 2001 From: Alan Rubin Date: Wed, 20 May 2026 16:25:47 +1000 Subject: [PATCH 16/19] simplify action --- .github/workflows/python-package.yml | 29 ++++------------------------ 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index e6429ce..dc578f7 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -50,30 +50,9 @@ jobs: wc -l coverage-${{ matrix.python-version }}.lcov head -20 coverage-${{ matrix.python-version }}.lcov - - name: Test with pytest and output coverage report (terminal version) - run: | - pytest --cov=mavehgvs --cov-report=term - - - name: Upload coverage artefact - # save the file for the Python version we care about (3.11) + - name: Send coverage to coveralls.io + # only calculate coverage for the Python version being used by MaveDB if: matrix.python-version == '3.11' - uses: actions/upload-artifact@v4 + uses: coverallsapp/github-action@v2 with: - name: coverage-report - path: coverage-3.11.lcov - - # report coverage under Python 3.11 since that's what MaveDB is using - coverage: - needs: build - if: ${{ always() }} - runs-on: ubuntu-latest - steps: - - name: Download coverage artefact - uses: actions/download-artifact@v4 - with: - name: coverage-report - - - name: Coveralls GitHub Action - uses: coverallsapp/github-action@v2 - with: - file: coverage-3.11.lcov + file: coverage-${{ matrix.python-version }}.lcov From 6f6f73d769c6c88a8b34d9438c7c58337631dbd5 Mon Sep 17 00:00:00 2001 From: Alan Rubin Date: Wed, 20 May 2026 16:39:38 +1000 Subject: [PATCH 17/19] remove extra output and change format --- .github/workflows/python-package.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index dc578f7..0b724fa 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -46,13 +46,11 @@ jobs: - name: Test with pytest and output coverage report run: | - pytest --cov=mavehgvs --cov-report=lcov:coverage-${{ matrix.python-version }}.lcov - wc -l coverage-${{ matrix.python-version }}.lcov - head -20 coverage-${{ matrix.python-version }}.lcov + pytest --cov=mavehgvs --cov-report=coveralls:coverage-${{ matrix.python-version }}.json - name: Send coverage to coveralls.io # only calculate coverage for the Python version being used by MaveDB if: matrix.python-version == '3.11' uses: coverallsapp/github-action@v2 with: - file: coverage-${{ matrix.python-version }}.lcov + file: coverage-${{ matrix.python-version }}.json From 54f5a503fdbafeb29196ba1d9ab97422d3a5c514 Mon Sep 17 00:00:00 2001 From: Alan Rubin Date: Wed, 20 May 2026 16:41:09 +1000 Subject: [PATCH 18/19] fix format name --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 0b724fa..5e4a3fa 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -46,7 +46,7 @@ jobs: - name: Test with pytest and output coverage report run: | - pytest --cov=mavehgvs --cov-report=coveralls:coverage-${{ matrix.python-version }}.json + pytest --cov=mavehgvs --cov-report=json:coverage-${{ matrix.python-version }}.json - name: Send coverage to coveralls.io # only calculate coverage for the Python version being used by MaveDB From 78e061118290a37a59febb49528314ff23c8905a Mon Sep 17 00:00:00 2001 From: Alan Rubin Date: Wed, 20 May 2026 16:43:56 +1000 Subject: [PATCH 19/19] update format again --- .github/workflows/python-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 5e4a3fa..5c9e79f 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -46,11 +46,11 @@ jobs: - name: Test with pytest and output coverage report run: | - pytest --cov=mavehgvs --cov-report=json:coverage-${{ matrix.python-version }}.json + pytest --cov=mavehgvs --cov-report=xml:coverage-${{ matrix.python-version }}.xml --cov-report=term - name: Send coverage to coveralls.io # only calculate coverage for the Python version being used by MaveDB if: matrix.python-version == '3.11' uses: coverallsapp/github-action@v2 with: - file: coverage-${{ matrix.python-version }}.json + file: coverage-${{ matrix.python-version }}.xml