Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 22 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,39 @@ on:
- '.github/workflows/ci.yml'
pull_request:
env:
LATEST_PY_VERSION: '3.13'
LATEST_PY_VERSION: '3.14'

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
python-version: ['3.11', '3.12', '3.13', '3.14']

steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.9.*"
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: install lib postgres
uses: nyurik/action-setup-postgis@v2

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .["test"]
uv sync

- name: Run pre-commit
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
run: |
python -m pip install pre-commit
pre-commit run --all-files
uv run pre-commit run --all-files

- name: Run tests
run: python -m pytest --cov tipg --cov-report xml --cov-report term-missing --asyncio-mode=strict
run: uv run pytest --cov tipg --cov-report xml --cov-report term-missing --asyncio-mode=strict

- name: Upload Results
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
Expand All @@ -64,21 +65,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ env.LATEST_PY_VERSION }}
version: "0.9.*"
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: install lib postgres
uses: nyurik/action-setup-postgis@v2

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .["test"]
uv sync

- name: Run Benchmark
run: python -m pytest tests/benchmarks.py --benchmark-only --benchmark-columns 'min, max, mean, median' --benchmark-json output.json --asyncio-mode=strict
run: uv run pytest tests/benchmarks.py --benchmark-only --benchmark-columns 'min, max, mean, median' --benchmark-json output.json --asyncio-mode=strict

- name: Store and benchmark result
uses: benchmark-action/github-action-benchmark@v1
Expand Down Expand Up @@ -108,9 +111,7 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install hatch
python -m hatch build
uv sync --group deploy

- name: Set tag version
id: tag
Expand All @@ -120,15 +121,16 @@ jobs:
- name: Set module version
id: module
run: |
echo "version=$(hatch --quiet version)" >> $GITHUB_OUTPUT
echo "version=$(uv run hatch --quiet version)" >> $GITHUB_OUTPUT

- name: Build and publish
if: ${{ steps.tag.outputs.version }} == ${{ steps.module.outputs.version}}
env:
HATCH_INDEX_USER: ${{ secrets.PYPI_USERNAME }}
HATCH_INDEX_AUTH: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m hatch publish
uv run hatch build
uv run hatch publish

publish-docker:
needs: [tests]
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/deploy_mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,11 @@ jobs:
- name: Checkout master
uses: actions/checkout@v5

- name: Set up Python 3.11
uses: actions/setup-python@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: 3.11

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .["docs"]
version: "0.9.*"
enable-cache: true

- name: Deploy docs
run: mkdocs gh-deploy --force -f docs/mkdocs.yml
run: uv run --group docs mkdocs gh-deploy --force -f docs/mkdocs.yml
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.12.1
rev: v0.24
hooks:
- id: validate-pyproject

Expand Down
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Note: Minor version `0.X.0` update might break the API, It's recommended to pin
* rename `viewer_endpoint` function to `map_viewer` **breaking change**
* rename `/viewer` endpoint to `/map.html` **breaking change**
* changed container image to use non-root `user`
* update minimum python version to 3.11
* add python 3.14 support
* switch to UV for development

## [1.2.1] - 2025-08-26

Expand Down
15 changes: 10 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,29 @@

Issues and pull requests are more than welcome: https://github.com/developmentseed/tipg/issues

We recommand using [`uv`](https://docs.astral.sh/uv) as project manager for development.

See https://docs.astral.sh/uv/getting-started/installation/ for installation

**dev install**

```bash
git clone https://github.com/developmentseed/tipg.git
cd tipg
python -m pip install -e .["test,dev"]

uv sync
```

You can then run the tests with the following command:

```sh
python -m pytest --cov tipg --cov-report term-missing --asyncio-mode=strict
uv run pytest --cov tipg --cov-report term-missing --asyncio-mode=strict
```

and run benchmark

```sh
python -m pytest tests/benchmarks.py --benchmark-only --benchmark-columns 'min, max, mean, median' --asyncio-mode=strict
uv run pytest tests/benchmarks.py --benchmark-only --benchmark-columns 'min, max, mean, median' --asyncio-mode=strict
```

**pre-commit**
Expand All @@ -28,8 +33,8 @@ This repo is set to use `pre-commit` to run *isort*, *flake8*, *pydocstring*, *b

```bash
# Install pre-commit command
$ pip install pre-commit
uv run pre-commit install

# Setup pre-commit withing your local environment
$ pre-commit install
uv run pre-commit run --all-files
```
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
## Install

```bash
$ python -m pip install pip -U
$ python -m pip install tipg
python -m pip install pip -U
python -m pip install tipg

# or from source
$ git clone https://github.com/developmentseed/tipg.git
$ cd tipg
$ python -m pip install -e .
git clone https://github.com/developmentseed/tipg.git
cd tipg
python -m pip install -e .
```

## OGC Specifications
Expand Down Expand Up @@ -88,15 +88,13 @@ More info about configuration options at https://developmentseed.org/tipg/user_g
## Launch

```bash
$ python -m pip install uvicorn

# Set your PostGIS database instance URL in the environment
$ export DATABASE_URL=postgresql://username:password@0.0.0.0:5432/postgis
$ uvicorn tipg.main:app
export DATABASE_URL=postgresql://username:password@0.0.0.0:5432/postgis
uv run --group server uvicorn tipg.main:app

# or using Docker

$ docker-compose up app
docker-compose up app
```

<p align="center">
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG PYTHON_VERSION=3.12
ARG PYTHON_VERSION=3.14

FROM python:${PYTHON_VERSION}
RUN apt update && apt upgrade -y \
Expand Down
40 changes: 14 additions & 26 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "tipg"
description = "Simple and Fast Geospatial OGC Features and Tiles API for PostGIS."
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.11"
license = {file = "LICENSE"}
authors = [
{name = "Vincent Sarago", email = "vincent@developmentseed.org"},
Expand All @@ -13,11 +13,10 @@ classifiers = [
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering :: GIS",
]
dynamic = ["version"]
Expand All @@ -36,8 +35,8 @@ dependencies = [
"starlette-cramjam>=0.4,<0.6",
]

[project.optional-dependencies]
test = [
[dependency-groups]
dev = [
"pytest",
"pytest-cov",
"pytest-asyncio",
Expand All @@ -46,8 +45,6 @@ test = [
"pytest-postgresql",
"mapbox-vector-tile>=2.1",
"numpy",
]
dev = [
"pre-commit",
"bump-my-version",
]
Expand All @@ -61,36 +58,27 @@ docs = [
"griffe-inherited-docstrings>=1.0.0",
"mkdocstrings[python]>=0.25.1",
]
deploy = [
"hatch",
]

[project.urls]
Homepage = "https://developmentseed.org/tipg"
Source = "https://github.com/developmentseed/tipg"
Documentation = "https://developmentseed.org/tipg/"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.version]
path = "tipg/__init__.py"

[tool.hatch.build.targets.sdist]
exclude = [
"/tests",
"/dockerfiles",
"/docs",
"/data",
"docker-compose.yml",
"CONTRIBUTING.md",
"CHANGES.md",
".pytest_cache",
".github",
".bumpversion.cfg",
".env.example",
".flake8",
".gitignore",
".pre-commit-config.yaml",
]
only-include = ["tipg/"]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
only-include = ["tipg/"]

[tool.coverage.run]
branch = true
Expand Down
Loading
Loading