From e9d4c7d842703e62d6ecc75cd2b6f874bdaaaec1 Mon Sep 17 00:00:00 2001 From: Elizabeth Campolongo <38985481+egrace479@users.noreply.github.com> Date: Thu, 1 Aug 2024 10:58:53 -0400 Subject: [PATCH] Update testing workflow with dev dependencies and full python coverage (#22) * Update run-tests.yml Add new tests to testing workflow with pytest * Update pyproject.toml Add pytest as dev dependency * Update run-tests.yml use .[dev] install for test workflow Set to test all supported python versions with matrix setup * Set up testing for PRs and pushes separately --- .github/workflows/run-pr-tests.yml | 30 ++++++++++++++++++++++++++++ .github/workflows/run-push-tests.yml | 28 ++++++++++++++++++++++++++ .github/workflows/run-tests.yml | 25 ----------------------- pyproject.toml | 4 ++++ 4 files changed, 62 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/run-pr-tests.yml create mode 100644 .github/workflows/run-push-tests.yml delete mode 100644 .github/workflows/run-tests.yml diff --git a/.github/workflows/run-pr-tests.yml b/.github/workflows/run-pr-tests.yml new file mode 100644 index 0000000..c5f5ff3 --- /dev/null +++ b/.github/workflows/run-pr-tests.yml @@ -0,0 +1,30 @@ +name: run-PR-tests + +on: + pull_request: + push: + branches: main + +jobs: + run-tests: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: install dependencies + run: pip install .[dev] + shell: bash + + - name: run tests + run: pytest + shell: bash diff --git a/.github/workflows/run-push-tests.yml b/.github/workflows/run-push-tests.yml new file mode 100644 index 0000000..bd53d94 --- /dev/null +++ b/.github/workflows/run-push-tests.yml @@ -0,0 +1,28 @@ +name: run-push-tests + +on: + push: + +jobs: + run-tests: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.12"] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: install dependencies + run: pip install .[dev] + shell: bash + + - name: run tests + run: pytest + shell: bash diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml deleted file mode 100644 index 8336014..0000000 --- a/.github/workflows/run-tests.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: run-tests - -on: - pull_request: - push: - -jobs: - run-tests: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: install dependencies - run: pip install . - shell: bash - - - name: run test - run: python -m unittest - shell: bash diff --git a/pyproject.toml b/pyproject.toml index 8022182..e5ee0d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,6 +29,10 @@ dependencies = [ "pillow", "sum-buddy @ git+https://github.com/Imageomics/sum-buddy.git@v0.1.0-alpha", ] + +[project.optional-dependencies] +dev = ["pytest"] + keywords = [ "downloader", "csv",