From a846515aaea6023c5d816f352ab3719ddf8313de Mon Sep 17 00:00:00 2001 From: rht Date: Mon, 1 Jul 2024 22:56:34 -0400 Subject: [PATCH 1/2] ci: Add GA for tests --- .github/workflows/build.yml | 61 +++++++++++++++++++++++++++++++++++++ pyproject.toml | 15 ++++++--- 2 files changed, 71 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..96808a8 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,61 @@ +name: build + +on: + push: + branches: + - main + - release** + paths-ignore: + - '**.md' + pull_request: + paths-ignore: + - '**.md' + workflow_dispatch: + schedule: + - cron: '0 6 * * 1' + +# This will cancel previous run if a newer job that obsoletes the said previous +# run, is started. +# Based on https://github.com/zulip/zulip/commit/4a11642cee3c8aec976d305d51a86e60e5d70522 +concurrency: + group: "${{ github.workflow }}-${{ github.head_ref || github.run_id }}" + cancel-in-progress: true + +jobs: + build: + runs-on: ${{ matrix.os }}-latest + # We need an explicit timeout because sometimes the batch_runner test never + # completes. + timeout-minutes: 6 + strategy: + fail-fast: False + matrix: + os: [windows, ubuntu, macos] + python-version: ["3.12"] + include: + - os: ubuntu + python-version: "3.11" + - os: ubuntu + python-version: "3.10" + # Disabled for now. See https://github.com/projectmesa/mesa/issues/1253 + #- os: ubuntu + # python-version: 'pypy-3.8' + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + - name: Install uv + run: pip install uv + - name: Install mesa-frames + # See https://github.com/astral-sh/uv/issues/1945 + run: | + uv pip install --system .[dev] + - name: Test with pytest + run: pytest --durations=10 --cov=mesa_frames tests/ --cov-report=xml + - if: matrix.os == 'ubuntu' + name: Codecov + uses: codecov/codecov-action@v4 diff --git a/pyproject.toml b/pyproject.toml index b714647..3a95cca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "mesa_frames" version = "0.1.0-alpha1" description = "An extension to the Mesa framework which uses pandas/Polars DataFrames for enhanced performance" authors = [ - { name = "Adam Amer" }, + { name = "Adam Amer" }, ] license = { text = "MIT" } dependencies = [ @@ -16,12 +16,17 @@ dependencies = [ [project.optional-dependencies] pandas = [ - "pandas~=2.2", - "geopandas", - "pyarrow", + "pandas~=2.2", + "geopandas", + "pyarrow", ] polars = [ - "polars", + "polars", +] +dev = [ + "mesa_frames[pandas,polars]", + "pytest", + "pytest-cov", ] [tool.hatch.build.targets.wheel] From 992401226a77d6734546e65946b10ac44cd89949 Mon Sep 17 00:00:00 2001 From: rht Date: Mon, 1 Jul 2024 23:04:22 -0400 Subject: [PATCH 2/2] Add typeguard and mesa dependency for .[dev] --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 3a95cca..05ac9ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,6 +27,8 @@ dev = [ "mesa_frames[pandas,polars]", "pytest", "pytest-cov", + "typeguard", + "mesa", ] [tool.hatch.build.targets.wheel]