Skip to content

Make ShpWriter.shape return num of bytes, correctly name vars, and add shx round trip test #237

Make ShpWriter.shape return num of bytes, correctly name vars, and add shx round trip test

Make ShpWriter.shape return num of bytes, correctly name vars, and add shx round trip test #237

# This workflow will run the pre-commit hooks (including linters), and the tests with a variety of Python versions
name: Run pre-commit hooks and tests
on:
push:
pull_request:
workflow_call:
workflow_dispatch:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install the latest version of uv and set the python version
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: 0.11.15 # uv version
python-version: "3.14"
- name: uv Sync project, asserting locked with dev dependency group
run: uv sync --frozen --group lint
- run: uv run pre-commit run --all-files --show-diff-on-failure --color=always ${{ inputs.extra_args }}
shell: bash
mypy-strict:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install the latest version of uv and set the python version
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: 0.11.15 # uv version
python-version: "3.14"
# use latest mypy version here, (even though pinned to 1.19.1 in lint group for Python 3.9 support)
- name: Run mypy --strict
run: uvx mypy --strict ./src/shapefile.py
build_wheel_and_sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Build wheel from the project repo
uses: ./.github/actions/build_wheel_and_sdist
property-based_tests:
needs: build_wheel_and_sdist
strategy:
fail-fast: false
matrix:
python-version: [
"3.14",
]
os: [
"ubuntu-24.04",
]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v6
with:
path: ./Pyshp
- name: "Hypothesis tests"
if:
uses: ./Pyshp/.github/actions/test
with:
extra_args: '-m hypothesis'
run_doctests: 'no'
pyshp_repo_directory: ./Pyshp
Pytest_and_doctests:
needs: build_wheel_and_sdist
strategy:
fail-fast: false
matrix:
python-version: [
"3.14",
"3.13",
"3.12",
"3.15-dev",
"3.11",
"3.10",
"3.9",
]
os: [
"ubuntu-24.04",
"windows-latest",
"macos-latest",
]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v6
with:
path: ./Pyshp
- name: Non-network tests
uses: ./Pyshp/.github/actions/test
with:
pyshp_repo_directory: ./Pyshp
- name: "Network tests (on Localhost ${{ !(matrix.os == 'ubuntu-24.04' && matrix.python-version == '3.14') }})"
uses: ./Pyshp/.github/actions/test
with:
extra_args: '-m network'
replace_remote_urls_with_localhost: ${{ !(matrix.os == 'ubuntu-24.04' && matrix.python-version == '3.14') }}
# Checkout to ./PyShp, as the test job also needs to check out the artefact repo
pyshp_repo_directory: ./Pyshp