88 - ' *'
99 pull_request :
1010env :
11- LATEST_PY_VERSION : ' 3.13 '
11+ LATEST_PY_VERSION : ' 3.14 '
1212
1313jobs :
1414 tests :
1515 runs-on : ubuntu-latest
1616 strategy :
1717 matrix :
18- python-version :
19- - ' 3.11'
20- - ' 3.12'
21- - ' 3.13'
22- # - '3.14.0-alpha.2' wait for pyproj and rasterio wheels to support 3.14
18+ python-version : ['3.11', '3.12', '3.13', '3.14']
2319
2420 steps :
2521 - uses : actions/checkout@v5
26- - name : Set up Python ${{ matrix.python-version }}
27- uses : actions/setup-python@v5
22+
23+ - name : Install uv
24+ uses : astral-sh/setup-uv@v7
2825 with :
26+ version : " 0.9.*"
27+ enable-cache : true
2928 python-version : ${{ matrix.python-version }}
3029
3130 - name : Install dependencies
3231 run : |
33- python -m pip install --upgrade pip
34- python -m pip install .["test"]
32+ uv sync
3533
36- - name : run pre-commit
34+ - name : Run pre-commit
3735 if : ${{ matrix.python-version == env.LATEST_PY_VERSION }}
3836 run : |
39- python -m pip install pre-commit
40- pre-commit run --all-files
37+ uv run pre-commit run --all-files
4138
4239 - name : Run tests
4340 run : python -m pytest --cov morecantile --cov-report term-missing --cov-report xml
@@ -51,24 +48,50 @@ jobs:
5148 fail_ci_if_error : false
5249 token : ${{ secrets.CODECOV_TOKEN }}
5350
51+ # We need two set of tests because rasterio wheels are not availble for python 3.14 yet
52+ tests-rasterio :
53+ runs-on : ubuntu-latest
54+ strategy :
55+ matrix :
56+ python-version : ['3.11', '3.12', '3.13']
57+
58+ steps :
59+ - uses : actions/checkout@v5
60+
61+ - name : Install uv
62+ uses : astral-sh/setup-uv@v7
63+ with :
64+ version : " 0.9.*"
65+ enable-cache : true
66+ python-version : ${{ matrix.python-version }}
67+
68+ - name : Install dependencies
69+ run : |
70+ uv sync --extra rasterio
71+
72+ - name : Run tests
73+ run : python -m pytest --cov morecantile --cov-report term-missing --cov-report xml
74+
5475 benchmark :
55- needs : [tests]
76+ needs : [tests, tests-rasterio ]
5677 runs-on : ubuntu-latest
5778 steps :
5879 - uses : actions/checkout@v5
59- - name : Set up Python
60- uses : actions/setup-python@v5
80+
81+ - name : Install uv
82+ uses : astral-sh/setup-uv@v7
6183 with :
62- python-version : ' 3.13'
84+ version : " 0.9.*"
85+ enable-cache : true
86+ python-version : ${{ env.LATEST_PY_VERSION }}
6387
6488 - name : Install dependencies
6589 run : |
66- python -m pip install --upgrade pip
67- python -m pip install -e ".[benchmark]"
90+ uv sync --group benchmark
6891
6992 - name : Run Benchmark
7093 run : |
71- python -m pytest tests/benchmarks.py --benchmark-only --benchmark-columns 'min, max, mean, median' --benchmark-sort 'min' --benchmark-json output.json
94+ uv run pytest tests/benchmarks.py --benchmark-only --benchmark-columns 'min, max, mean, median' --benchmark-sort 'min' --benchmark-json output.json
7295
7396 - name : Store and Compare benchmark result
7497 uses : benchmark-action/github-action-benchmark@v1
@@ -87,21 +110,22 @@ jobs:
87110 benchmark-data-dir-path : dev/benchmarks
88111
89112 publish :
90- needs : [tests]
113+ needs : [tests, tests-rasterio ]
91114 runs-on : ubuntu-latest
92115 if : startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
93116 steps :
94117 - uses : actions/checkout@v5
95- - name : Set up Python
96- uses : actions/setup-python@v5
118+
119+ - name : Install uv
120+ uses : astral-sh/setup-uv@v7
97121 with :
122+ version : " 0.9.*"
123+ enable-cache : true
98124 python-version : ${{ env.LATEST_PY_VERSION }}
99125
100126 - name : Install dependencies
101127 run : |
102- python -m pip install --upgrade pip
103- python -m pip install flit
104- python -m pip install .
128+ uv sync --group deploy
105129
106130 - name : Set tag version
107131 id : tag
@@ -112,11 +136,13 @@ jobs:
112136 - name : Set module version
113137 id : module
114138 run : |
115- echo version=$(python -c'import morecantile; print(morecantile.__version__)') >> $GITHUB_OUTPUT
139+ echo " version=$(uv run hatch --quiet version)" >> $GITHUB_OUTPUT
116140
117141 - name : Build and publish
118142 if : ${{ steps.tag.outputs.version }} == ${{ steps.module.outputs.version}}
119143 env :
120- FLIT_USERNAME : ${{ secrets.PYPI_USERNAME }}
121- FLIT_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
122- run : flit publish
144+ HATCH_INDEX_USER : ${{ secrets.PYPI_USERNAME }}
145+ HATCH_INDEX_AUTH : ${{ secrets.PYPI_PASSWORD }}
146+ run : |
147+ uv run hatch build
148+ uv run hatch publish
0 commit comments