@@ -22,35 +22,32 @@ jobs:
2222 runs-on : ubuntu-latest
2323 strategy :
2424 matrix :
25- python-version :
26- - ' 3.10'
27- - ' 3.11'
28- - ' 3.12'
29- - ' 3.13'
25+ python-version : ['3.11', '3.12', '3.13']
3026
3127 steps :
3228 - uses : actions/checkout@v5
33- - name : Set up Python ${{ matrix.python-version }}
34- uses : actions/setup-python@v6
29+
30+ - name : Install uv
31+ uses : astral-sh/setup-uv@v7
3532 with :
33+ version : " 0.9.*"
34+ enable-cache : true
3635 python-version : ${{ matrix.python-version }}
3736
3837 - name : install lib postgres
3938 uses : nyurik/action-setup-postgis@v2
4039
4140 - name : Install dependencies
4241 run : |
43- python -m pip install --upgrade pip
44- python -m pip install -e .["test,psycopg"]
42+ uv sync --extra psycopg
4543
4644 - name : Run pre-commit
4745 if : ${{ matrix.python-version == env.LATEST_PY_VERSION }}
4846 run : |
49- python -m pip install pre-commit
50- pre-commit run --all-files
47+ uv run pre-commit run --all-files
5148
5249 - name : Run tests
53- run : python -m pytest --cov titiler.pgstac --cov-report xml --cov-report term-missing --asyncio-mode=strict -s -vv
50+ run : uv run pytest --cov titiler.pgstac --cov-report xml --cov-report term-missing --asyncio-mode=strict -s -vv
5451
5552 - name : Upload Results
5653 if : ${{ matrix.python-version == env.LATEST_PY_VERSION }}
@@ -65,14 +62,21 @@ jobs:
6562 needs : [tests]
6663 runs-on : ubuntu-latest
6764 env :
68- PGSTAC_VERSION : ' 0.9.2 '
65+ PGSTAC_VERSION : ' 0.9.8 '
6966 steps :
7067 - uses : actions/checkout@v5
7168
72- - name : Set up Python 3.12
73- uses : actions /setup-python@v6
69+ - name : Install uv
70+ uses : astral-sh /setup-uv@v7
7471 with :
75- python-version : ' 3.12'
72+ version : " 0.9.*"
73+ enable-cache : true
74+ python-version : ${{ env.LATEST_PY_VERSION }}
75+
76+ - name : Install dependencies
77+ run : |
78+ uv sync --extra psycopg
79+ uv pip install pypgstac==${{ env.PGSTAC_VERSION }}
7680
7781 - name : Launch services
7882 run : docker compose up -d tiler-uvicorn
@@ -82,23 +86,19 @@ jobs:
8286 - name : install lib postgres
8387 uses : nyurik/action-setup-postgis@v2
8488
85- - name : Install python dependencies
86- run : |
87- python -m pip install pypgstac==${{ env.PGSTAC_VERSION }} psycopg[pool] httpx pytest pytest-benchmark rasterio
88-
8989 - name : Ingest Stac Items/Collection
9090 run : |
91- pypgstac pgready --dsn postgresql://username:[email protected] :5439/postgis 92- pypgstac load collections benchmark/stac/collection.json --dsn postgresql://username:[email protected] :5439/postgis --method insert_ignore 93- pypgstac load items benchmark/stac/items.json --dsn postgresql://username:[email protected] :5439/postgis --method insert_ignore 91+ uv run pypgstac pgready --dsn postgresql://username:[email protected] :5439/postgis 92+ uv run pypgstac load collections benchmark/stac/collection.json --dsn postgresql://username:[email protected] :5439/postgis --method insert_ignore 93+ uv run pypgstac load items benchmark/stac/items.json --dsn postgresql://username:[email protected] :5439/postgis --method insert_ignore 9494
9595 - name : Sleep for 10 seconds
9696 run : sleep 10s
9797 shell : bash
9898
9999 - name : Run Benchmark
100100 run : |
101- python -m pytest .github/workflows/tests/benchmarks.py --benchmark-only --benchmark-columns 'min, max, mean, median' --benchmark-json output.json
101+ uv run --group benchmark pytest .github/workflows/tests/benchmarks.py --benchmark-only --benchmark-columns 'min, max, mean, median' --benchmark-json output.json
102102
103103 - name : Store and benchmark result
104104 uses : benchmark-action/github-action-benchmark@v1
@@ -124,17 +124,14 @@ jobs:
124124 if : startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
125125 steps :
126126 - uses : actions/checkout@v5
127- - name : Set up Python
128- uses : actions/setup-python@v6
127+
128+ - name : Install uv
129+ uses : astral-sh/setup-uv@v7
129130 with :
131+ version : " 0.9.*"
132+ enable-cache : true
130133 python-version : ${{ env.LATEST_PY_VERSION }}
131134
132- - name : Install dependencies
133- run : |
134- python -m pip install --upgrade pip
135- python -m pip install wheel twine build
136- python -m pip install .
137-
138135 - name : Set tag version
139136 id : tag
140137 run : |
@@ -144,17 +141,17 @@ jobs:
144141 - name : Set module version
145142 id : module
146143 run : |
147- echo version=$(python -c'import titiler.pgstac; print(titiler.pgstac.__version__)') >> $GITHUB_OUTPUT
148-
144+ echo version=$(uv run python -c'import titiler.pgstac; print(titiler.pgstac.__version__)') >> $GITHUB_OUTPUT
145+
149146 - name : Build and publish
150147 if : ${{ steps.tag.outputs.version }} == ${{ steps.module.outputs.version}}
151148 env :
152- TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
153- TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
149+ UV_PUBLISH_USERNAME : ${{ secrets.PYPI_USERNAME }}
150+ UV_PUBLISH_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
154151 run : |
155152 rm -rf dist
156- python -m build
157- twine upload dist/*
153+ uv build
154+ uv publish dist/*
158155
159156 publish-docker :
160157 needs : [tests]
0 commit comments