Skip to content

Commit 2ad2682

Browse files
Merge pull request #31 from developmentseed/feature/switch-to-uv
switch to UV
2 parents 12817ea + 84a27a9 commit 2ad2682

File tree

7 files changed

+2263
-58
lines changed

7 files changed

+2263
-58
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,59 +16,56 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
python-version:
20-
- '3.9'
21-
- '3.10'
22-
- '3.11'
23-
- '3.12'
24-
- '3.13'
19+
python-version: ['3.11', '3.12', '3.13']
2520

2621
steps:
27-
- uses: actions/checkout@v4
28-
- name: Set up Python ${{ matrix.python-version }}
29-
uses: actions/setup-python@v5
22+
- uses: actions/checkout@v5
23+
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v7
3026
with:
27+
version: "0.9.*"
28+
enable-cache: true
3129
python-version: ${{ matrix.python-version }}
3230

3331
- name: Install dependencies
3432
run: |
35-
python -m pip install --upgrade pip
36-
python -m pip install .["test"]
37-
38-
- name: Run tests
39-
run: python -m pytest --cov tilebench --cov-report xml --cov-report term-missing
33+
uv sync
4034
41-
- name: run pre-commit
35+
- name: Run pre-commit
4236
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
4337
run: |
44-
python -m pip install pre-commit
45-
pre-commit run --all-files
38+
uv run pre-commit run --all-files
39+
40+
- name: Run tests
41+
run: uv run pytest --cov tilebench --cov-report xml --cov-report term-missing
4642

4743
- name: Upload Results
4844
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
49-
uses: codecov/codecov-action@v1
45+
uses: codecov/codecov-action@v5
5046
with:
51-
file: ./coverage.xml
47+
files: ./coverage.xml
5248
flags: unittests
53-
name: ${{ matrix.python-version }}
5449
fail_ci_if_error: false
50+
token: ${{ secrets.CODECOV_TOKEN }}
5551

5652
publish:
5753
needs: [tests]
5854
runs-on: ubuntu-latest
5955
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
6056
steps:
61-
- uses: actions/checkout@v4
62-
- name: Set up Python ${{ env.LATEST_PY_VERSION }}
63-
uses: actions/setup-python@v5
57+
- uses: actions/checkout@v5
58+
59+
- name: Install uv
60+
uses: astral-sh/setup-uv@v7
6461
with:
62+
version: "0.9.*"
63+
enable-cache: true
6564
python-version: ${{ env.LATEST_PY_VERSION }}
6665

6766
- name: Install dependencies
6867
run: |
69-
python -m pip install --upgrade pip
70-
python -m pip install hatch
71-
python -m hatch build
68+
uv sync --group deploy
7269
7370
- name: Set tag version
7471
id: tag
@@ -78,28 +75,29 @@ jobs:
7875
- name: Set module version
7976
id: module
8077
run: |
81-
echo "version=$(hatch --quiet version)" >> $GITHUB_OUTPUT
78+
echo "version=$(uv run hatch --quiet version)" >> $GITHUB_OUTPUT
8279
8380
- name: Show version
8481
run: |
8582
echo "${{ steps.tag.outputs.version }}"
8683
echo "${{ steps.module.outputs.version }}"
8784
88-
- name: publish
85+
- name: Build and publish
8986
if: ${{ steps.tag.outputs.version }} == ${{ steps.module.outputs.version}}
9087
env:
9188
HATCH_INDEX_USER: ${{ secrets.PYPI_USERNAME }}
9289
HATCH_INDEX_AUTH: ${{ secrets.PYPI_PASSWORD }}
9390
run: |
94-
python -m hatch publish
91+
uv run hatch build
92+
uv run hatch publish
9593
9694
publish-docker:
9795
needs: [tests]
9896
if: github.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
9997
runs-on: ubuntu-latest
10098
steps:
10199
- name: Checkout
102-
uses: actions/checkout@v4
100+
uses: actions/checkout@v5
103101

104102
- name: Set up QEMU
105103
uses: docker/setup-qemu-action@v1

.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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
## Unreleased
22

3+
## 0.17.0 (2025-11-17)
4+
35
* switch to official python base image over `bitnami`
46
* switch to preferred `ENV` setting in Dockerfile
7+
* switch to UV for development
8+
* set minimum python version to `>=3.11`
59

610
## 0.16.0 (2025-04-30)
711

CONTRIBUTING.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,28 @@
22

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

5-
**dev install**
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+
9+
### dev install
610

711
```bash
812
git clone https://github.com/developmentseed/tilebench.git
913
cd tilebench
10-
python -m pip install -e ".[dev,test]"
14+
15+
uv sync
1116
```
1217

1318
You can then run the tests with the following command:
1419

1520
```sh
16-
python -m pytest --cov tilebench --cov-report term-missing -s -vv
21+
uv run pytest --cov tilebench --cov-report term-missing -s -vv
1722
```
1823

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

2126
```bash
22-
$ pre-commit install
27+
uv run pre-commit install
28+
uv run pre-commit run --all-files
2329
```

Dockerfile

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

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

pyproject.toml

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "tilebench"
33
description = "Inspect HEAD/LIST/GET requests withing Rasterio"
4-
requires-python = ">=3.8"
4+
requires-python = ">=3.11"
55
license = {file = "LICENSE"}
66
authors = [
77
{name = "Vincent Sarago", email = "[email protected]"},
@@ -12,8 +12,6 @@ classifiers = [
1212
"License :: OSI Approved :: MIT License",
1313
"Programming Language :: Python :: 3",
1414
"Programming Language :: Python :: 3 :: Only",
15-
"Programming Language :: Python :: 3.9",
16-
"Programming Language :: Python :: 3.10",
1715
"Programming Language :: Python :: 3.11",
1816
"Programming Language :: Python :: 3.12",
1917
"Programming Language :: Python :: 3.13",
@@ -25,22 +23,23 @@ dependencies = [
2523
"jinja2>=3.0,<4.0.0",
2624
"loguru",
2725
"rasterio>=1.3.8",
28-
"rio-tiler>=7.0,<8.0",
26+
"rio-tiler>=7.0",
2927
"uvicorn[standard]",
3028
]
3129

32-
[project.optional-dependencies]
33-
test = [
30+
[dependency-groups]
31+
dev = [
3432
"pytest",
3533
"pytest-cov",
3634
"pytest-asyncio",
3735
"requests",
3836
"vsifile",
39-
]
40-
dev = [
4137
"pre-commit",
4238
"bump-my-version",
4339
]
40+
deploy = [
41+
"hatch",
42+
]
4443

4544
[project.urls]
4645
Homepage = 'https://github.com/developmentseed/tilebench'
@@ -65,25 +64,18 @@ substitutions = [
6564
{pattern = '@@', replacement = '@'},
6665
]
6766

67+
[build-system]
68+
requires = ["hatchling", "hatch-fancy-pypi-readme>=22.5.0"]
69+
build-backend = "hatchling.build"
70+
6871
[tool.hatch.version]
6972
path = "tilebench/__init__.py"
7073

7174
[tool.hatch.build.targets.sdist]
72-
exclude = [
73-
"/tests",
74-
"Dockerfile",
75-
".pytest_cache",
76-
".history",
77-
".github",
78-
".bumpversion.cfg",
79-
".flake8",
80-
".gitignore",
81-
".pre-commit-config.yaml",
82-
]
75+
only-include = ["tilebench/"]
8376

84-
[build-system]
85-
requires = ["hatchling", "hatch-fancy-pypi-readme>=22.5.0"]
86-
build-backend = "hatchling.build"
77+
[tool.hatch.build.targets.wheel]
78+
only-include = ["tilebench/"]
8779

8880
[tool.isort]
8981
profile = "black"

0 commit comments

Comments
 (0)