Skip to content

Commit 9e57c1f

Browse files
authored
Merge pull request #6 from developmentseed/kyle/revamp
Revamp
2 parents 18d54f5 + 4279338 commit 9e57c1f

File tree

13 files changed

+997
-579
lines changed

13 files changed

+997
-579
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,55 +4,49 @@ name: CI
44
on:
55
push:
66
branches:
7-
- main
7+
- main
88
tags:
9-
- '*'
9+
- "*"
1010
pull_request:
11-
env:
12-
LATEST_PY_VERSION: '3.13'
1311

1412
jobs:
15-
tests:
13+
lint-python:
14+
name: Lint
1615
runs-on: ubuntu-latest
17-
strategy:
18-
matrix:
19-
python-version:
20-
- '3.11'
21-
- '3.12'
22-
- '3.13'
23-
2416
steps:
25-
- uses: actions/checkout@v5
26-
- name: Set up Python ${{ matrix.python-version }}
27-
uses: actions/setup-python@v6
17+
- uses: actions/checkout@v4
18+
19+
- name: Install a specific version of uv
20+
uses: astral-sh/setup-uv@v6
2821
with:
29-
python-version: ${{ matrix.python-version }}
22+
version: "latest"
3023

31-
- name: Install aiopmtiles
32-
run: |
33-
python -m pip install --upgrade pip
34-
python -m pip install .["test","aws","gcp"]
24+
# Ensure docs build without warnings
25+
# - name: Check docs
26+
# run: uv run --group docs mkdocs build --strict
3527

36-
- name: run pre-commit
37-
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
38-
run: |
39-
python -m pip install pre-commit
40-
pre-commit run --all-files
28+
# Use ruff-action so we get annotations in the Github UI
29+
- uses: astral-sh/ruff-action@v3
4130

42-
- name: Run test
43-
run: python -m pytest --cov aiopmtiles --cov-report xml --cov-report term-missing
31+
pytest:
32+
name: Pytest
33+
runs-on: ubuntu-latest
34+
strategy:
35+
matrix:
36+
python-version: ["3.11", "3.12", "3.13", "3.14"]
37+
steps:
38+
- uses: actions/checkout@v4
4439

45-
- name: Upload Results
46-
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
47-
uses: codecov/codecov-action@v1
40+
- name: Install a specific version of uv
41+
uses: astral-sh/setup-uv@v6
4842
with:
49-
file: ./coverage.xml
50-
flags: unittests
51-
name: ${{ matrix.python-version }}
52-
fail_ci_if_error: false
43+
version: "latest"
44+
45+
- name: Run pytest
46+
run: uv run pytest
5347

5448
publish:
55-
needs: [tests]
49+
needs: [pytest]
5650
runs-on: ubuntu-latest
5751
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
5852
steps:

.pre-commit-config.yaml

Lines changed: 0 additions & 33 deletions
This file was deleted.

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,28 +48,30 @@ $ python -m pip install git+http://github.com/developmentseed/aiopmtiles
4848
## Example
4949

5050
```python
51+
from async_pmtiles import PMTilesReader
52+
from obstore.store import HTTPStore
5153

52-
from aiopmtiles import Reader
54+
store = HTTPStore("https://r2-public.protomaps.com/protomaps-sample-datasets")
55+
src = await PMTilesReader.open("cb_2018_us_zcta510_500k.pmtiles", store=store)
5356

54-
async with Reader("https://r2-public.protomaps.com/protomaps-sample-datasets/cb_2018_us_zcta510_500k.pmtiles") as src:
55-
# PMTiles Metadata
56-
meta = src.metadata
57+
# PMTiles Metadata
58+
meta = await src.metadata()
5759

58-
# Spatial Metadata
59-
bounds = src.bounds
60-
minzoom, maxzoom = src.minzoom, src.maxzoom
60+
# Spatial Metadata
61+
bounds = src.bounds
62+
minzoom, maxzoom = src.minzoom, src.maxzoom
6163

62-
# Is the data a Vector Tile Archive
63-
assert src.is_vector
64+
# Is the data a Vector Tile Archive
65+
assert src.is_vector
6466

65-
# PMTiles tiles type
66-
tile_type = src._header["tile_type"]
67+
# PMTiles tiles type
68+
src.tile_type
6769

68-
# Tile Compression
69-
comp = src.tile_compression
70+
# Tile Compression
71+
src.tile_compression
7072

71-
# Get Tile
72-
data = await src.get_tile(0, 0, 0)
73+
# Get Tile
74+
data = await src.get_tile(x=0, y=0, z=0)
7375
```
7476

7577
## Contribution & Development

aiopmtiles/__init__.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

aiopmtiles/aiopmtiles.py

Lines changed: 0 additions & 145 deletions
This file was deleted.

0 commit comments

Comments
 (0)