From d989a1ec7a176031341b8167d7f320fbf1c76030 Mon Sep 17 00:00:00 2001 From: Christian Beilschmidt Date: Fri, 17 Jan 2025 09:30:12 +0100 Subject: [PATCH 01/13] reusable-workflow --- .github/workflows/ci.yml | 203 ++---------------------------- .github/workflows/test-python.yml | 146 +++++++++++++++++++++ 2 files changed, 156 insertions(+), 193 deletions(-) create mode 100644 .github/workflows/test-python.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56cbc0b..669269f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,18 +8,7 @@ on: jobs: check: - runs-on: ubuntu-22.04 - - services: - postgres: - image: postgis/postgis - env: - POSTGRES_USER: geoengine - POSTGRES_PASSWORD: geoengine - POSTGRES_DB: geoengine - ports: - - 5432:5432 - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + uses: geo-engine/geoengine-python/.github/workflows/test-python.yml@reusable-workflows strategy: fail-fast: false @@ -27,189 +16,17 @@ jobs: # use all supported versions from https://devguide.python.org/versions/ python-version: ["3.9", "3.10", "3.11", "3.12"] - defaults: - run: - working-directory: library - - steps: - - name: Checkout library code - uses: actions/checkout@v4 - with: - path: library - - name: Read backend version - id: read-backend-version - run: echo "GEOENGINE_VERSION=$(cat .github/.backend_git_ref)" >> $GITHUB_OUTPUT - - name: Checkout Geo Engine code - uses: actions/checkout@v4 - with: - repository: geo-engine/geoengine - ref: ${{ steps.read-backend-version.outputs.GEOENGINE_VERSION }} - path: backend - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - tool-cache: true - android: true - dotnet: true - haskell: true - large-packages: true - docker-images: true - swap-storage: true - - name: Install lld & GDAL & Protobuf - run: | - sudo apt-get update - sudo apt-get install lld libgdal-dev gdal-bin build-essential clang curl protobuf-compiler libgeos-dev libproj-dev - sudo apt-get clean - export C_INCLUDE_PATH=/usr/include/gdal:$C_INCLUDE_PATH - export CPLUS_INCLUDE_PATH=/usr/include/gdal:$CPLUS_INCLUDE_PATH - sudo ldconfig - - name: Install Rustup - run: | - curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --profile minimal --default-toolchain none -y - echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install build dependencies - run: | - python -m pip install --upgrade pip - pip install -e . - pip install -e .[dev] - - name: Check Formatting - run: | - python -m pycodestyle - - name: Lint code - run: | - python -m pylint geoengine - - name: Type-check code - run: | - python -m mypy geoengine - - name: Build - run: python -m build . - - name: Install test dependencies - run: | - pip install -e .[test] - - name: Lint tests - run: | - python -m pylint tests - - name: Type-check tests - run: | - python -m mypy tests - - name: Test - run: pytest - env: - GEOENGINE_TEST_CODE_PATH: ${{ github.workspace }}/backend - GEOENGINE_TEST_BUILD_TYPE: "release" - - name: Examples - run: | - python -m pip install -e .[examples] - python test_all_notebooks.py - env: - GEOENGINE_TEST_CODE_PATH: ${{ github.workspace }}/backend - GEOENGINE_TEST_BUILD_TYPE: "release" + with: + python-version: ${{ matrix.python-version }} + use-uv: false + coverage: false # Checks the library using minimum version resolution # `uv` has this feature built-in, c.f. https://github.com/astral-sh/uv check-min-version: - runs-on: ubuntu-22.04 - - services: - postgres: - image: postgis/postgis - env: - POSTGRES_USER: geoengine - POSTGRES_PASSWORD: geoengine - POSTGRES_DB: geoengine - ports: - - 5432:5432 - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 - - defaults: - run: - working-directory: library - - env: - # use minimum supported versions from https://devguide.python.org/versions/ - python-version: "3.9" - # lowest compatible versions for all direct dependencies - # cf., https://github.com/astral-sh/uv#resolution-strategy - resolution: "lowest-direct" - - steps: - - name: Checkout library code - uses: actions/checkout@v4 - with: - path: library - - name: Read backend version - id: read-backend-version - run: echo "GEOENGINE_VERSION=$(cat .github/.backend_git_ref)" >> $GITHUB_OUTPUT - - name: Checkout Geo Engine code - uses: actions/checkout@v4 - with: - repository: geo-engine/geoengine - ref: ${{ steps.read-backend-version.outputs.GEOENGINE_VERSION }} - path: backend - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - tool-cache: true - android: true - dotnet: true - haskell: true - large-packages: true - docker-images: true - swap-storage: true - - name: Install lld & GDAL & Protobuf - run: | - sudo apt-get update - sudo apt-get install lld libgdal-dev gdal-bin build-essential clang curl protobuf-compiler libgeos-dev libproj-dev - sudo apt-get clean - export C_INCLUDE_PATH=/usr/include/gdal:$C_INCLUDE_PATH - export CPLUS_INCLUDE_PATH=/usr/include/gdal:$CPLUS_INCLUDE_PATH - sudo ldconfig - - name: Install Rustup - run: | - curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --profile minimal --default-toolchain none -y - echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH - - name: Set up Python ${{ env.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ env.python-version }} - - name: Install build dependencies - run: | - python -m pip install --upgrade pip - pip install uv - - uv venv - source .venv/bin/activate + uses: geo-engine/geoengine-python/.github/workflows/test-python.yml@reusable-workflows - uv pip install --resolution=${{ env.resolution }} -e . - uv pip install --resolution=${{ env.resolution }} -e .[dev] - - name: Build - run: | - source .venv/bin/activate - python -m build . - - name: Install test dependencies - run: | - source .venv/bin/activate - uv pip install --resolution=${{ env.resolution }} -e .[test] - - name: Test - run: | - source .venv/bin/activate - pytest --cov=geoengine --cov-report=lcov - env: - GEOENGINE_TEST_CODE_PATH: ${{ github.workspace }}/backend - GEOENGINE_TEST_BUILD_TYPE: "release" - - name: Upload coverage to Coveralls - uses: coverallsapp/github-action@v2 - with: - base-path: library - - name: Examples - run: | - source .venv/bin/activate - uv pip install --resolution=${{ env.resolution }} -e .[examples] - python test_all_notebooks.py - env: - GEOENGINE_TEST_CODE_PATH: ${{ github.workspace }}/backend - GEOENGINE_TEST_BUILD_TYPE: "release" + with: + python-version: 3.9 + use-uv: true + coverage: true diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml new file mode 100644 index 0000000..ba537a5 --- /dev/null +++ b/.github/workflows/test-python.yml @@ -0,0 +1,146 @@ +name: Test Python Library + +on: + workflow_call: + inputs: + python-version: + type: string + required: true + use-uv: + type: boolean + default: false + coverage: + type: boolean + default: false + +jobs: + check: + runs-on: ubuntu-24.04 + + services: + postgres: + image: postgis/postgis + env: + POSTGRES_USER: geoengine + POSTGRES_PASSWORD: geoengine + POSTGRES_DB: geoengine + ports: + - 5432:5432 + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + + defaults: + run: + working-directory: library + + steps: + - name: Checkout library code + uses: actions/checkout@v4 + with: + path: library + - name: Setup variables + id: vars + run: | + echo "GEOENGINE_VERSION=$(cat .github/.backend_git_ref)" >> $GITHUB_OUTPUT + if ${{ inputs.use-uv }}"; then + echo "PIP_PREFIX=uv" >> $GITHUB_OUTPUT + echo "PIP_RESOLUTION='--resolution=lowest-direct'" >> $GITHUB_OUTPUT + echo "VENV_CALL='source .venv/bin/activate'" >> $GITHUB_OUTPUT + else + echo "PIP_PREFIX=" >> $GITHUB_OUTPUT + echo "PIP_RESOLUTION=" >> $GITHUB_OUTPUT + echo "VENV_CALL=" >> $GITHUB_OUTPUT + fi + if ${{ inputs.coverage }}"; then + echo "COVERAGE_COMMAND='--cov=geoengine --cov-report=lcov'" >> $GITHUB_OUTPUT + else + echo "COVERAGE_COMMAND=" >> $GITHUB_OUTPUT + fi + - name: Checkout Geo Engine code + uses: actions/checkout@v4 + with: + repository: geo-engine/geoengine + ref: ${{ steps.vars.outputs.GEOENGINE_VERSION }} + path: backend + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + tool-cache: true + android: true + dotnet: true + haskell: true + large-packages: true + docker-images: true + swap-storage: true + - name: Install lld & GDAL & Protobuf + run: | + sudo apt-get update + sudo apt-get install lld libgdal-dev gdal-bin build-essential clang curl protobuf-compiler libgeos-dev libproj-dev + sudo apt-get clean + export C_INCLUDE_PATH=/usr/include/gdal:$C_INCLUDE_PATH + export CPLUS_INCLUDE_PATH=/usr/include/gdal:$CPLUS_INCLUDE_PATH + sudo ldconfig + - name: Install Rustup + run: | + curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --profile minimal --default-toolchain none -y + echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH + - name: Set up Python ${{ inputs.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ inputs.python-version }} + - name: Upgrade PIP + run: python -m pip install --upgrade pip + - name: Setup UV and create venv + if: ${{ inputs.use-uv }} + run: | + pip install uv + uv venv + - name: Install build dependencies + run: | + ${{ steps.vars.outputs.VENV_CALL }} + ${{ steps.vars.outputs.PIP_PREFIX }} pip install ${{ steps.vars.outputs.PIP_RESOLUTION }} -e .[dev] + - name: Check Formatting + run: | + ${{ steps.vars.outputs.VENV_CALL }} + python -m pycodestyle + - name: Lint code + run: | + ${{ steps.vars.outputs.VENV_CALL }} + python -m pylint geoengine + - name: Type-check code + run: | + ${{ steps.vars.outputs.VENV_CALL }} + python -m mypy geoengine + - name: Build + run: python -m build . + - name: Install test dependencies + run: | + ${{ steps.vars.outputs.VENV_CALL }} + ${{ steps.vars.outputs.PIP_PREFIX }} pip install ${{ steps.vars.outputs.PIP_RESOLUTION }} -e .[test] + - name: Lint tests + run: | + ${{ steps.vars.outputs.VENV_CALL }} + python -m pylint tests + - name: Type-check tests + run: | + ${{ steps.vars.outputs.VENV_CALL }} + python -m mypy tests + - name: Test + run: | + ${{ steps.vars.outputs.VENV_CALL }} + pytest ${{ steps.vars.outputs.COVERAGE_COMMAND }} + env: + GEOENGINE_TEST_CODE_PATH: ${{ github.workspace }}/backend + GEOENGINE_TEST_BUILD_TYPE: "release" + - name: Upload coverage to Coveralls + if: ${{ inputs.coverage }} + uses: coverallsapp/github-action@v2 + with: + base-path: library + - name: Examples + run: | + ${{ steps.vars.outputs.VENV_CALL }} + ${{ steps.vars.outputs.PIP_PREFIX }} pip install ${{ steps.vars.outputs.PIP_RESOLUTION }} -e .[examples] + python test_all_notebooks.py + env: + GEOENGINE_TEST_CODE_PATH: ${{ github.workspace }}/backend + GEOENGINE_TEST_BUILD_TYPE: "release" From bbd0173d69737ad9407a6c7452a250ab69ff72ba Mon Sep 17 00:00:00 2001 From: Christian Beilschmidt Date: Fri, 17 Jan 2025 09:32:28 +0100 Subject: [PATCH 02/13] typo --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 669269f..49ff072 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ on: jobs: check: - uses: geo-engine/geoengine-python/.github/workflows/test-python.yml@reusable-workflows + uses: geo-engine/geoengine-python/.github/workflows/test-python.yml@reusable-workflow strategy: fail-fast: false @@ -24,7 +24,7 @@ jobs: # Checks the library using minimum version resolution # `uv` has this feature built-in, c.f. https://github.com/astral-sh/uv check-min-version: - uses: geo-engine/geoengine-python/.github/workflows/test-python.yml@reusable-workflows + uses: geo-engine/geoengine-python/.github/workflows/test-python.yml@reusable-workflow with: python-version: 3.9 From 29c726268eddf4690028fd425b3b1d868293380a Mon Sep 17 00:00:00 2001 From: Christian Beilschmidt Date: Fri, 17 Jan 2025 09:34:36 +0100 Subject: [PATCH 03/13] if typo --- .github/workflows/test-python.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index ba537a5..91ebb82 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -41,7 +41,7 @@ jobs: id: vars run: | echo "GEOENGINE_VERSION=$(cat .github/.backend_git_ref)" >> $GITHUB_OUTPUT - if ${{ inputs.use-uv }}"; then + if ${{ inputs.use-uv }}; then echo "PIP_PREFIX=uv" >> $GITHUB_OUTPUT echo "PIP_RESOLUTION='--resolution=lowest-direct'" >> $GITHUB_OUTPUT echo "VENV_CALL='source .venv/bin/activate'" >> $GITHUB_OUTPUT @@ -50,7 +50,7 @@ jobs: echo "PIP_RESOLUTION=" >> $GITHUB_OUTPUT echo "VENV_CALL=" >> $GITHUB_OUTPUT fi - if ${{ inputs.coverage }}"; then + if ${{ inputs.coverage }}; then echo "COVERAGE_COMMAND='--cov=geoengine --cov-report=lcov'" >> $GITHUB_OUTPUT else echo "COVERAGE_COMMAND=" >> $GITHUB_OUTPUT From 60e2f008d4bc221bb50ddb5875ba1400a7912ebf Mon Sep 17 00:00:00 2001 From: Christian Beilschmidt Date: Fri, 17 Jan 2025 09:49:19 +0100 Subject: [PATCH 04/13] ticks --- .github/workflows/test-python.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index 91ebb82..e3008b2 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -15,7 +15,7 @@ on: jobs: check: - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 services: postgres: @@ -43,15 +43,15 @@ jobs: echo "GEOENGINE_VERSION=$(cat .github/.backend_git_ref)" >> $GITHUB_OUTPUT if ${{ inputs.use-uv }}; then echo "PIP_PREFIX=uv" >> $GITHUB_OUTPUT - echo "PIP_RESOLUTION='--resolution=lowest-direct'" >> $GITHUB_OUTPUT - echo "VENV_CALL='source .venv/bin/activate'" >> $GITHUB_OUTPUT + echo "PIP_RESOLUTION=--resolution=lowest-direct" >> $GITHUB_OUTPUT + echo "VENV_CALL=source .venv/bin/activate" >> $GITHUB_OUTPUT else echo "PIP_PREFIX=" >> $GITHUB_OUTPUT echo "PIP_RESOLUTION=" >> $GITHUB_OUTPUT echo "VENV_CALL=" >> $GITHUB_OUTPUT fi if ${{ inputs.coverage }}; then - echo "COVERAGE_COMMAND='--cov=geoengine --cov-report=lcov'" >> $GITHUB_OUTPUT + echo "COVERAGE_COMMAND=--cov=geoengine --cov-report=lcov" >> $GITHUB_OUTPUT else echo "COVERAGE_COMMAND=" >> $GITHUB_OUTPUT fi From 7be0302d2f0326b1a73d0f293b5997cfb03bafc9 Mon Sep 17 00:00:00 2001 From: Christian Beilschmidt Date: Fri, 17 Jan 2025 10:28:44 +0100 Subject: [PATCH 05/13] exclude hidden dirs from linting --- setup.cfg | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index b81c141..426c7f2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -76,4 +76,10 @@ ignore = E501, # one of W503 or W504 must be ignored W503 -exclude = build,env* +exclude = + # build dir + build, + # common venv dir + env*, + # hidden dirs + .?* From 20658a5fd73f73b6e225bc1a55bb5c28fe2eede9 Mon Sep 17 00:00:00 2001 From: Christian Beilschmidt Date: Fri, 17 Jan 2025 13:11:54 +0100 Subject: [PATCH 06/13] mypy --- .github/workflows/test-python.yml | 12 +++++------- setup.cfg | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index e3008b2..28e6ec3 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -42,12 +42,10 @@ jobs: run: | echo "GEOENGINE_VERSION=$(cat .github/.backend_git_ref)" >> $GITHUB_OUTPUT if ${{ inputs.use-uv }}; then - echo "PIP_PREFIX=uv" >> $GITHUB_OUTPUT - echo "PIP_RESOLUTION=--resolution=lowest-direct" >> $GITHUB_OUTPUT + echo "PIP_INSTALL=uv pip install --resolution=lowest-direct" >> $GITHUB_OUTPUT echo "VENV_CALL=source .venv/bin/activate" >> $GITHUB_OUTPUT else - echo "PIP_PREFIX=" >> $GITHUB_OUTPUT - echo "PIP_RESOLUTION=" >> $GITHUB_OUTPUT + echo "PIP_INSTALL=pip install" >> $GITHUB_OUTPUT echo "VENV_CALL=" >> $GITHUB_OUTPUT fi if ${{ inputs.coverage }}; then @@ -97,7 +95,7 @@ jobs: - name: Install build dependencies run: | ${{ steps.vars.outputs.VENV_CALL }} - ${{ steps.vars.outputs.PIP_PREFIX }} pip install ${{ steps.vars.outputs.PIP_RESOLUTION }} -e .[dev] + ${{ steps.vars.outputs.PIP_INSTALL }} -e .[dev] - name: Check Formatting run: | ${{ steps.vars.outputs.VENV_CALL }} @@ -115,7 +113,7 @@ jobs: - name: Install test dependencies run: | ${{ steps.vars.outputs.VENV_CALL }} - ${{ steps.vars.outputs.PIP_PREFIX }} pip install ${{ steps.vars.outputs.PIP_RESOLUTION }} -e .[test] + ${{ steps.vars.outputs.PIP_INSTALL }} -e .[test] - name: Lint tests run: | ${{ steps.vars.outputs.VENV_CALL }} @@ -139,7 +137,7 @@ jobs: - name: Examples run: | ${{ steps.vars.outputs.VENV_CALL }} - ${{ steps.vars.outputs.PIP_PREFIX }} pip install ${{ steps.vars.outputs.PIP_RESOLUTION }} -e .[examples] + ${{ steps.vars.outputs.PIP_INSTALL }} -e .[examples] python test_all_notebooks.py env: GEOENGINE_TEST_CODE_PATH: ${{ github.workspace }}/backend diff --git a/setup.cfg b/setup.cfg index 426c7f2..d489480 100644 --- a/setup.cfg +++ b/setup.cfg @@ -40,7 +40,7 @@ install_requires = [options.extras_require] dev = build >=0.7,<0.11 - mypy >=0.97,<2.0 + mypy >=1.14.1,<2.0 pdoc3 >=0.10,<0.11 pycodestyle >=2.8,<3 # formatter pylint >=3.3,<4 # code linter From 8d887b47a839701cf658f831622580d4cfa1347d Mon Sep 17 00:00:00 2001 From: Christian Beilschmidt Date: Fri, 17 Jan 2025 13:36:07 +0100 Subject: [PATCH 07/13] mypy --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index d489480..57b6c13 100644 --- a/setup.cfg +++ b/setup.cfg @@ -40,7 +40,7 @@ install_requires = [options.extras_require] dev = build >=0.7,<0.11 - mypy >=1.14.1,<2.0 + mypy >=1.13,<2.0 pdoc3 >=0.10,<0.11 pycodestyle >=2.8,<3 # formatter pylint >=3.3,<4 # code linter From 331b6e1663ad117edb348f1e66e2ecfecde5b056 Mon Sep 17 00:00:00 2001 From: Christian Beilschmidt Date: Fri, 17 Jan 2025 15:12:03 +0100 Subject: [PATCH 08/13] mypy --- .github/workflows/test-python.yml | 4 ++++ .venv/test.py | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 .venv/test.py diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index 28e6ec3..c6bc6aa 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -105,6 +105,8 @@ jobs: ${{ steps.vars.outputs.VENV_CALL }} python -m pylint geoengine - name: Type-check code + # mypy seems buggy with uv + if: ${{ !inputs.use-uv }} run: | ${{ steps.vars.outputs.VENV_CALL }} python -m mypy geoengine @@ -119,6 +121,8 @@ jobs: ${{ steps.vars.outputs.VENV_CALL }} python -m pylint tests - name: Type-check tests + # mypy seems buggy with uv + if: ${{ !inputs.use-uv }} run: | ${{ steps.vars.outputs.VENV_CALL }} python -m mypy tests diff --git a/.venv/test.py b/.venv/test.py new file mode 100644 index 0000000..45fb8c1 --- /dev/null +++ b/.venv/test.py @@ -0,0 +1,4 @@ +class User(object): + def __init__(self, name): + self.name = name + From bea95574a2ad441c56ec4af0e75cf2f22774b128 Mon Sep 17 00:00:00 2001 From: Christian Beilschmidt Date: Fri, 17 Jan 2025 15:13:09 +0100 Subject: [PATCH 09/13] mypy --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 57b6c13..d489480 100644 --- a/setup.cfg +++ b/setup.cfg @@ -40,7 +40,7 @@ install_requires = [options.extras_require] dev = build >=0.7,<0.11 - mypy >=1.13,<2.0 + mypy >=1.14.1,<2.0 pdoc3 >=0.10,<0.11 pycodestyle >=2.8,<3 # formatter pylint >=3.3,<4 # code linter From 2c41de62fca892d7d9c20a23f645904a99051b10 Mon Sep 17 00:00:00 2001 From: Christian Beilschmidt Date: Fri, 17 Jan 2025 15:14:03 +0100 Subject: [PATCH 10/13] unused file --- .gitignore | 1 + .venv/test.py | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 .venv/test.py diff --git a/.gitignore b/.gitignore index 145f9ad..29bd99a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ __pycache__ # Virtual Environments env env-* +.venv # Private files .pypirc diff --git a/.venv/test.py b/.venv/test.py deleted file mode 100644 index 45fb8c1..0000000 --- a/.venv/test.py +++ /dev/null @@ -1,4 +0,0 @@ -class User(object): - def __init__(self, name): - self.name = name - From f9438808921b2b63f81ce96ef56d2c2e44f4e828 Mon Sep 17 00:00:00 2001 From: Christian Beilschmidt Date: Fri, 17 Jan 2025 19:55:33 +0100 Subject: [PATCH 11/13] venv --- .github/workflows/test-python.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index c6bc6aa..a0807e6 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -111,7 +111,9 @@ jobs: ${{ steps.vars.outputs.VENV_CALL }} python -m mypy geoengine - name: Build - run: python -m build . + run: | + ${{ steps.vars.outputs.VENV_CALL }} + python -m build . - name: Install test dependencies run: | ${{ steps.vars.outputs.VENV_CALL }} From 4c210f75f82b11964394d9831d05978df9a489a2 Mon Sep 17 00:00:00 2001 From: Christian Beilschmidt Date: Mon, 20 Jan 2025 08:25:37 +0100 Subject: [PATCH 12/13] coverage on push to main --- .github/workflows/ci.yml | 4 ++++ README.md | 2 ++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49ff072..77a8926 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,10 @@ name: CI on: pull_request: merge_group: + # Creates a coverage of the main branch + push: + branches: + - main # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/README.md b/README.md index eda2ab4..a4aa3b8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Geo Engine Python Package [![CI](https://github.com/geo-engine/geoengine-python/actions/workflows/ci.yml/badge.svg)](https://github.com/geo-engine/geoengine-python/actions/workflows/ci.yml) +[![Coverage Status](https://coveralls.io/repos/github/geo-engine/geoengine-python/badge.svg)](https://coveralls.io/github/geo-engine/geoengine-python) +[![Documentation](https://img.shields.io/badge/documentation-python.docs.geoengine.io-blue)](https://python.docs.geoengine.io/) This package allows easy access to Geo Engine functionality from Python environments. From 23b56bada367e299ef2c6bbafcb657bb8120333b Mon Sep 17 00:00:00 2001 From: Christian Beilschmidt Date: Wed, 22 Jan 2025 12:45:13 +0100 Subject: [PATCH 13/13] add descriptions --- .github/workflows/test-python.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index a0807e6..86b67e4 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -6,12 +6,15 @@ on: python-version: type: string required: true + description: 'Python version to use, e.g., "3.9"' use-uv: type: boolean default: false + description: 'Use `uv` for minimum version resolution' coverage: type: boolean default: false + description: 'Generate coverage report' jobs: check: