Skip to content

Commit 6b6ed0d

Browse files
switch to uv (#1244)
* switch to uv * switch to hatch * switch to hatch * update changelog
1 parent 00023fd commit 6b6ed0d

File tree

20 files changed

+5808
-217
lines changed

20 files changed

+5808
-217
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,45 +30,44 @@ jobs:
3030

3131
steps:
3232
- uses: actions/checkout@v5
33-
- name: Set up Python ${{ matrix.python-version }}
34-
uses: actions/setup-python@v6
33+
34+
- name: Install uv
35+
uses: astral-sh/setup-uv@v7
3536
with:
36-
python-version: ${{ matrix.python-version }}
37+
version: "0.9.*"
38+
enable-cache: true
39+
40+
- name: Set up Python ${{ matrix.python-version }}
41+
run: uv python install ${{ matrix.python-version }}
3742

3843
- name: Install dependencies
3944
run: |
40-
python -m pip install --upgrade pip
45+
uv sync
4146
4247
- name: Test titiler.core
4348
run: |
44-
python -m pip install -e src/titiler/core["test","telemetry"]
45-
python -m pytest src/titiler/core --cov=titiler.core --cov-report=xml --cov-append --cov-report=term-missing
49+
uv run pytest src/titiler/core --cov=titiler.core --cov-report=xml --cov-append --cov-report=term-missing
4650
4751
- name: Test titiler.extensions
4852
run: |
49-
python -m pip install -e src/titiler/extensions["test,cogeo,stac"]
50-
python -m pytest src/titiler/extensions --cov=titiler.extensions --cov-report=xml --cov-append --cov-report=term-missing
53+
uv run pytest src/titiler/extensions --cov=titiler.extensions --cov-report=xml --cov-append --cov-report=term-missing
5154
5255
- name: Test titiler.xarray
5356
run: |
54-
python -m pip install -e src/titiler/xarray["test"]
55-
python -m pytest src/titiler/xarray --cov=titiler.xarray --cov-report=xml --cov-append --cov-report=term-missing
57+
uv run pytest src/titiler/xarray --cov=titiler.xarray --cov-report=xml --cov-append --cov-report=term-missing
5658
5759
- name: Test titiler.mosaic
5860
run: |
59-
python -m pip install -e src/titiler/mosaic["test"]
60-
python -m pytest src/titiler/mosaic --cov=titiler.mosaic --cov-report=xml --cov-append --cov-report=term-missing
61+
uv run pytest src/titiler/mosaic --cov=titiler.mosaic --cov-report=xml --cov-append --cov-report=term-missing
6162
6263
- name: Test titiler.application
6364
run: |
64-
python -m pip install -e src/titiler/application["test"]
65-
python -m pytest src/titiler/application --cov=titiler.application --cov-report=xml --cov-append --cov-report=term-missing
65+
uv run pytest src/titiler/application --cov=titiler.application --cov-report=xml --cov-append --cov-report=term-missing
6666
6767
- name: run pre-commit
6868
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
6969
run: |
70-
python -m pip install pre-commit
71-
pre-commit run --all-files
70+
uv run pre-commit run --all-files
7271
7372
- name: Upload Results
7473
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
@@ -85,15 +84,19 @@ jobs:
8584
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
8685
steps:
8786
- uses: actions/checkout@v5
88-
- name: Set up Python
89-
uses: actions/setup-python@v6
87+
88+
- name: Install uv
89+
uses: astral-sh/setup-uv@v7
9090
with:
91-
python-version: ${{ env.LATEST_PY_VERSION }}
91+
version: "0.9.*"
92+
enable-cache: true
93+
94+
- name: Set up Python ${{ matrix.python-version }}
95+
run: uv python install ${{ matrix.python-version }}
9296

9397
- name: Install dependencies
9498
run: |
95-
python -m pip install --upgrade pip
96-
pip install twine build hatch
99+
uv sync
97100
98101
- name: Set tag version
99102
id: tag
@@ -103,13 +106,13 @@ jobs:
103106
- name: Set module version
104107
id: module
105108
run: |
106-
echo "version=$(hatch --quiet version)" >> $GITHUB_OUTPUT
109+
echo "version=$(uv version --short)" >> $GITHUB_OUTPUT
107110
108111
- name: Build and publish titiler packages
109112
if: ${{ steps.tag.outputs.version }} == ${{ steps.module.outputs.version}}
110113
env:
111-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
112-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
114+
UV_PUBLISH_USERNAME: ${{ secrets.PYPI_USERNAME }}
115+
UV_PUBLISH_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
113116
run: |
114117
scripts/publish
115118

.github/workflows/deploy_mkdocs.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,11 @@ jobs:
2121
- name: Checkout main
2222
uses: actions/checkout@v5
2323

24-
- name: Set up Python 3.11
25-
uses: actions/setup-python@v6
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v7
2626
with:
27-
python-version: 3.11
28-
29-
- name: Install dependencies
30-
run: |
31-
python -m pip install --upgrade pip
32-
python -m pip install src/titiler/core src/titiler/extensions["cogeo,stac"] src/titiler/xarray src/titiler/mosaic src/titiler/application
33-
python -m pip install -r requirements/requirements-docs.txt
34-
35-
27+
version: "0.9.*"
28+
enable-cache: true
29+
3630
- name: Deploy docs
37-
run: mkdocs gh-deploy --force -f docs/mkdocs.yml
31+
run: uv run --group docs mkdocs gh-deploy --force -f docs/mkdocs.yml

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/abravalheri/validate-pyproject
3-
rev: v0.12.1
3+
rev: v0.24
44
hooks:
55
- id: validate-pyproject
66

CHANGES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
## Unreleased
44

5+
### Misc
6+
7+
* update docker image to python:3.13
8+
* switch to `uv` for development
9+
* switch to `hatch` for python package build-system
10+
* remove `titiler` metapackage **breaking change**
11+
512
## 0.24.2 (2025-10-16)
613

714
### titiler.core

CONTRIBUTING.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,27 @@
22

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

5+
We recommand using [`uv`](https://docs.astral.sh/uv) as project manager for development.
6+
7+
See https://docs.astral.sh/uv/getting-started/installation/ for installation
8+
59
**dev install**
610

711
```bash
812
git clone https://github.com/developmentseed/titiler.git
913
cd titiler
10-
11-
python -m pip install \
12-
pre-commit \
13-
-e src/titiler/core["test"] \
14-
-e src/titiler/extensions["test,cogeo,stac"] \
15-
-e src/titiler/mosaic["test"] \
16-
-e src/titiler/application["test"]
14+
uv sync --dev
1715
```
1816

1917
**pre-commit**
2018

2119
This repo is set to use `pre-commit` to run *isort*, *flake8*, *pydocstring*, *black* ("uncompromising Python code formatter") and mypy when committing new code.
2220

2321
```bash
24-
pre-commit install
22+
uv run pre-commit install
23+
24+
# If needed, you can run pre-commit script manually
25+
uv run pre-commit run --all-files
2526
```
2627

2728
### Run tests
@@ -30,35 +31,37 @@ Each `titiler`'s modules has its own test suite which can be ran independently
3031

3132
```
3233
# titiler.core
33-
python -m pytest src/titiler/core --cov=titiler.core --cov-report=xml --cov-append --cov-report=term-missing
34+
uv run pytest src/titiler/core --cov=titiler.core --cov-report=xml --cov-append --cov-report=term-missing
3435
3536
# titiler.extensions
36-
python -m pytest src/titiler/extensions --cov=titiler.extensions --cov-report=xml --cov-append --cov-report=term-missing
37+
uv run pytest src/titiler/extensions --cov=titiler.extensions --cov-report=xml --cov-append --cov-report=term-missing
3738
3839
# titiler.mosaic
39-
python -m pytest src/titiler/mosaic --cov=titiler.mosaic --cov-report=xml --cov-append --cov-report=term-missing
40+
uv run pytest src/titiler/mosaic --cov=titiler.mosaic --cov-report=xml --cov-append --cov-report=term-missing
4041
4142
# titiler.application
42-
python -m pytest src/titiler/application --cov=titiler.application --cov-report=xml --cov-append --cov-report=term-missing
43+
uv run pytest src/titiler/application --cov=titiler.application --cov-report=xml --cov-append --cov-report=term-missing
4344
```
4445

4546
### Docs
4647

4748
```bash
4849
git clone https://github.com/developmentseed/titiler.git
4950
cd titiler
50-
python -m pip install -r requirements/requirements-docs.txt
51+
52+
# Build docs
53+
uv run --group docs mkdocs build -f docs/mkdocs.yml
5154
```
5255

5356
Hot-reloading docs:
5457

5558
```bash
56-
mkdocs serve -f docs/mkdocs.yml
59+
uv run --group docs mkdocs serve -f docs/mkdocs.yml --livereload
5760
```
5861

5962
To manually deploy docs (note you should never need to do this because Github
6063
Actions deploys automatically for new commits.):
6164

6265
```bash
63-
mkdocs gh-deploy -f docs/mkdocs.yml
66+
uv run --group docs mkdocs gh-deploy -f docs/mkdocs.yml
6467
```

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,9 @@ To install from sources and run for development:
9191
git clone https://github.com/developmentseed/titiler.git
9292
cd titiler
9393
94-
python -m pip install -U pip
95-
python -m pip install -e src/titiler/core -e src/titiler/xarray -e src/titiler/extensions -e src/titiler/mosaic -e src/titiler/application
96-
python -m pip install uvicorn
97-
98-
uvicorn titiler.application.main:app --reload
94+
uv sync
95+
uv run pip install uvicorn
96+
uv run uvicorn titiler.application.main:app --reload
9997
```
10098

10199
## Docker

RELEASING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This is a checklist for releasing a new version of **titiler**.
88

99
3. Update `version: {chart_version}` (e.g: `version: 1.1.6 -> version: 1.1.7`) in `deployment/k8s/charts/Chart.yaml`
1010

11-
4. Run [`bump-my-version`](https://callowayproject.github.io/bump-my-version/) to update all titiler's module versions: `bump-my-version bump minor --new-version 0.20.0`
11+
4. Run [`bump-my-version`](https://callowayproject.github.io/bump-my-version/) to update all titiler's module versions: `uv run bump-my-version bump minor --new-version 0.20.0`
1212

1313
5. Push your release branch, create a PR, and get approval
1414

dockerfiles/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG PYTHON_VERSION=3.12
1+
ARG PYTHON_VERSION=3.13
22

33
FROM python:${PYTHON_VERSION}
44
RUN apt update && apt upgrade -y \

dockerfiles/Dockerfile.xarray

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG PYTHON_VERSION=3.12
1+
ARG PYTHON_VERSION=3.13
22

33
FROM python:${PYTHON_VERSION}
44
RUN apt update && apt upgrade -y \

0 commit comments

Comments
 (0)