From 2a24b7f6d2f608cb7cc2d97161f696e389d1df7b Mon Sep 17 00:00:00 2001 From: Tai Sakuma Date: Thu, 8 Feb 2024 12:49:25 -0500 Subject: [PATCH 1/4] Require nextline-graphql --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ec24a1b..2dbef71 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", ] -dependencies = ["httpx>=0.26"] +dependencies = ["nextline-graphql>=0.7.3", "httpx>=0.26"] dynamic = ["version"] [project.optional-dependencies] From cd8741901c7ca5d178e09ed72a08d3ed9727508c Mon Sep 17 00:00:00 2001 From: Tai Sakuma Date: Thu, 8 Feb 2024 12:53:48 -0500 Subject: [PATCH 2/4] Update GitHub Actions workflow to run unit tests --- .github/workflows/test.yml | 39 ------------------------- .github/workflows/unit-test.yml | 50 +++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 39 deletions(-) delete mode 100644 .github/workflows/test.yml create mode 100644 .github/workflows/unit-test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 1deccef..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: test - -on: - push: - branches: [main, master] - pull_request: - branches: [main, master] - -concurrency: - group: test-${{ github.head_ref }} - cancel-in-progress: true - -env: - PYTHONUNBUFFERED: "1" - FORCE_COLOR: "1" - -jobs: - run: - name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] - - steps: - - uses: actions/checkout@v3 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install Hatch - run: pip install --upgrade hatch - - - name: Run tests - run: hatch run cov diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml new file mode 100644 index 0000000..cb32518 --- /dev/null +++ b/.github/workflows/unit-test.yml @@ -0,0 +1,50 @@ +name: Run unit tests + +on: + push: + branches: + - "**" + pull_request: + branches: + - "**" + +concurrency: + group: unit-test-${{ github.head_ref }} + cancel-in-progress: true + +env: + PYTHONUNBUFFERED: "1" + FORCE_COLOR: "1" + +jobs: + run: + name: Python ${{ matrix.python-version }} on Linux + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + python-version: ["3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install packages + run: | + pip install --upgrade pip + pip install -e '.[tests]' + pip list + + - name: Run tests + run: pytest -vv --cov --cov-report=xml + + # - name: Upload coverage to Codecov + # uses: codecov/codecov-action@v4 + # with: + # fail_ci_if_error: true + # verbose: true From fcd2b715ddcba076f710d6ae8dd3c1e05281d71d Mon Sep 17 00:00:00 2001 From: Tai Sakuma Date: Thu, 8 Feb 2024 13:15:56 -0500 Subject: [PATCH 3/4] Add a GitHub Actions workflow for type checking --- .github/workflows/type-check.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/type-check.yml diff --git a/.github/workflows/type-check.yml b/.github/workflows/type-check.yml new file mode 100644 index 0000000..c93c350 --- /dev/null +++ b/.github/workflows/type-check.yml @@ -0,0 +1,30 @@ +name: Check static types + +on: + push: + branches: + - "**" + pull_request: + branches: + - "**" + +jobs: + run: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: Install packages + run: | + pip install --upgrade pip + pip install -e '.[tests]' + pip install --upgrade mypy + + - name: Run mypy + run: mypy --show-traceback src/ From 5e363139551c93468e527b3ae16fd95a4c877d3e Mon Sep 17 00:00:00 2001 From: Tai Sakuma Date: Thu, 8 Feb 2024 13:18:50 -0500 Subject: [PATCH 4/4] Add badges to README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5e36820..a198da8 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ [![PyPI - Version](https://img.shields.io/pypi/v/nextline-alert.svg)](https://pypi.org/project/nextline-alert) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/nextline-alert.svg)](https://pypi.org/project/nextline-alert) +[![Test Status](https://github.com/simonsobs/nextline-alert/actions/workflows/unit-test.yml/badge.svg)](https://github.com/simonsobs/nextline-alert/actions/workflows/unit-test.yml) +[![Test Status](https://github.com/simonsobs/nextline-alert/actions/workflows/type-check.yml/badge.svg)](https://github.com/simonsobs/nextline-alert/actions/workflows/type-check.yml) A plugin for [nextline-graphql](https://github.com/simonsobs/nextline-graphql). Emit alerts to [Campana](https://github.com/simonsobs/campana)