From 51cabd5fdb99c757a8aff49d48d285f9016050b8 Mon Sep 17 00:00:00 2001 From: Ryan McGinty Date: Fri, 20 Dec 2024 22:49:01 -0800 Subject: [PATCH 1/3] Add Codecov integration and update GitHub Actions workflow --- .github/workflows/build.yml | 18 ++++++++++++++++++ README.md | 1 + codecov.yml | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 codecov.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 417f5ac..51458dc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,8 @@ on: branches: [ main ] paths-ignore: - '**/_version.py' + workflow_dispatch: + jobs: test: @@ -35,3 +37,19 @@ jobs: run: | make release shell: bash + - name: Upload coverage reports + if: | + ${{ + success() + && ( + (github.event_name == 'pull_request' && github.base_ref == 'main') + || (github.event_name == 'push' && github.ref_name == 'main') + || github.event_name == 'workflow_dispatch' + ) + && matrix.python-version == '3.11' + }} + uses: codecov/codecov-action@v5 + with: + # https://github.com/codecov/codecov-action#arguments + token: ${{ secrets.CODECOV_TOKEN }} + env_vars: PYTHON_VERSION diff --git a/README.md b/README.md index 512b3f7..eb92b9b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # AIBS Informatics AWS Utils [![Build Status](https://github.com/AllenInstitute/aibs-informatics-aws-utils/actions/workflows/build.yml/badge.svg)](https://github.com/AllenInstitute/aibs-informatics-aws-utils/actions/workflows/build.yml) +[![codecov](https://codecov.io/gh/AllenInstitute/aibs-informatics-aws-utils/graph/badge.svg?token=I3A5UC9CMX)](https://codecov.io/gh/AllenInstitute/aibs-informatics-aws-utils) --- diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..a6bc968 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,34 @@ +codecov: + bot: aibsgithub + +coverage: + range: 0..100 + status: + project: + default: + target: auto # auto compares coverage to the previous base commit + informational: true + patch: + default: + informational: true + +comment: + layout: "reach, diff, flags, files" + behavior: default + require_changes: false # if true: only post the comment if coverage changes + require_head: yes # [yes :: must have a head report to post] + require_base: no # default yes + +github_checks: + # set to true in future perhaps? + annotations: false + +flag_management: + default_rules: # the rules that will be followed for any flag added, generally + carryforward: true + statuses: + - type: project + target: auto + threshold: 1% + - type: patch + target: 90% \ No newline at end of file From a3b5d207ce236930b9370dc6f2d8f7775e9a1b10 Mon Sep 17 00:00:00 2001 From: Ryan McGinty Date: Sun, 22 Dec 2024 13:46:02 -0800 Subject: [PATCH 2/3] add missing stubs for pytz, requests --- pyproject.toml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9469f4c..3e64565 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,11 +25,18 @@ dependencies = [ [project.optional-dependencies] dev = [ + "aibs-informatics-aws-utils[stubs]~=0.0.5", "aibs-informatics-test-resources[all]~=0.0.4", - "boto3-stubs[athena,apigateway,batch,ecr,ecs,efs,essential,fsx,logs,secretsmanager,ses,sns,ssm,sts,stepfunctions]", "moto[all] ~= 5.0", ] +stubs = [ + "boto3-stubs[athena,apigateway,batch,ecr,ecs,efs,essential,fsx,logs,secretsmanager,ses,sns,ssm,sts,stepfunctions]", + "boto3-stubs", + "types-pytz", + "types-requests", +] + release = [ "build", "bump-my-version", From c78e3db3d901260eed546cab84aa326c3f9146c3 Mon Sep 17 00:00:00 2001 From: Ryan McGinty Date: Sun, 22 Dec 2024 14:04:56 -0800 Subject: [PATCH 3/3] pinning mypy==1.13.x to avoid stubs bugs --- pyproject.toml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3e64565..2bb6ae2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,16 +25,10 @@ dependencies = [ [project.optional-dependencies] dev = [ - "aibs-informatics-aws-utils[stubs]~=0.0.5", "aibs-informatics-test-resources[all]~=0.0.4", - "moto[all] ~= 5.0", -] - -stubs = [ "boto3-stubs[athena,apigateway,batch,ecr,ecs,efs,essential,fsx,logs,secretsmanager,ses,sns,ssm,sts,stepfunctions]", - "boto3-stubs", - "types-pytz", - "types-requests", + "moto[all] ~= 5.0", + "mypy~=1.13.0", ] release = [