Skip to content

Commit 9a7d6df

Browse files
authored
v4.5a (alpha version) (#483)
* bump h3lib to unreleased a9c0a2e (cellsToMultiPolygon) * initial changes * move around dependencies * update CI * ci separation * h3.pc.in * clean up .gitignore * changelog * better changelog * add cellsToMultiPolygon to h3-py in separate release * sdist exclude and coverage for version test * warn that changing some justfile rules will affect CI * try to silence some CI warnings * one more warning
1 parent 4d0c332 commit 9a7d6df

File tree

12 files changed

+181
-173
lines changed

12 files changed

+181
-173
lines changed

.github/workflows/build_docs.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,14 @@ jobs:
1818
with:
1919
submodules: recursive
2020

21-
- uses: actions/setup-python@v6.2.0
21+
- uses: astral-sh/setup-uv@v7
2222
with:
23-
python-version: 3.11
23+
python-version: '3.11'
2424

25-
- name: Install dependencies
26-
run: |
27-
pip install --upgrade pip setuptools wheel
28-
pip install .[all]
25+
- uses: extractions/setup-just@v2
2926

3027
- name: Build the book
31-
run: jupyter-book build docs/ --warningiserror --keep-going --all
28+
run: just docs
3229

3330
- name: Upload artifacts
3431
uses: actions/upload-artifact@v6.0.0

.github/workflows/lint_and_coverage.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,20 @@ jobs:
1616
with:
1717
submodules: recursive
1818

19-
- uses: actions/setup-python@v6.2.0
19+
- uses: astral-sh/setup-uv@v7
2020
with:
21-
python-version: 3.11
21+
python-version: '3.11'
2222

23-
- name: Install from source
24-
run: pip install .[test]
23+
- uses: extractions/setup-just@v2
2524

26-
- name: Run Linting
27-
uses: astral-sh/ruff-action@v3
25+
- name: Lint
26+
run: just lint
2827

29-
- name: Coverage Requirement - Library
30-
run: |
31-
pytest tests/test_lib --cov=h3 --cov=tests/test_lib --cov-fail-under=100
28+
- name: Install
29+
run: uv sync
30+
31+
- name: Coverage - Library
32+
run: just ci-test
3233

3334
- name: Coverage - Cython
34-
run: |
35-
pip install cython
36-
cythonize tests/test_cython/cython_example.pyx
37-
pytest tests/test_cython --cov=tests/test_cython
35+
run: just ci-test-cython

.github/workflows/tests.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,19 @@ jobs:
1414
strategy:
1515
matrix:
1616
os: [macos-latest, windows-latest, ubuntu-22.04]
17-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
17+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
1818

1919
steps:
2020
- uses: actions/checkout@v6.0.2
2121
with:
2222
submodules: recursive
2323

24-
- uses: actions/setup-python@v6.2.0
24+
- uses: astral-sh/setup-uv@v7
2525
with:
2626
python-version: '${{ matrix.python-version }}'
2727

28+
- uses: extractions/setup-just@v2
29+
2830
## Start Windows stuff
2931
- uses: ilammy/msvc-dev-cmd@v1.13.0
3032
if: startsWith(matrix.os, 'windows')
@@ -36,13 +38,11 @@ jobs:
3638
echo "CXX=cl.exe" >> $GITHUB_ENV
3739
## End Windows stuff
3840

39-
- name: Install from source
40-
run: |
41-
pip install --upgrade pip setuptools wheel
42-
pip install .[test]
41+
- name: Install
42+
run: uv sync
4343

4444
- name: Tests
45-
run: |
46-
pip install cython
47-
cythonize tests/test_cython/cython_example.pyx
48-
pytest
45+
run: just ci-test
46+
47+
- name: Cython Tests
48+
run: just ci-test-cython

.github/workflows/wheels.yml

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,25 @@ jobs:
2727
with:
2828
submodules: recursive
2929

30-
- name: Setup Python
31-
uses: actions/setup-python@v6.2.0
30+
- uses: astral-sh/setup-uv@v7
3231
with:
33-
python-version: 3.11
32+
python-version: '3.11'
33+
3434

3535
- name: Make sdist
36-
run: |
37-
python --version
38-
pipx --version
39-
pipx run build --sdist
36+
run: uv build --sdist
4037

38+
# Test the sdist, NOT the local checkout.
39+
# Use a fresh venv + uv pip install (not uv sync, which would build from source).
4140
- name: Install from sdist
4241
run: |
43-
pip install --upgrade pip setuptools wheel
42+
uv venv
4443
cp dist/h3-*.tar.gz h3.tar.gz
45-
pip install h3.tar.gz[test]
44+
uv pip install h3.tar.gz[numpy] pytest pytest-cov
4645
4746
- name: Test sdist
48-
run: pytest
47+
# run pytest directly from the venv to avoid `uv run` syncing from the local checkout
48+
run: .venv/bin/pytest
4949

5050
- name: Upload artifacts to GitHub
5151
uses: actions/upload-artifact@v6.0.0
@@ -85,12 +85,6 @@ jobs:
8585
build: 'cp*-manylinux_x86_64'
8686
name: Linux Intel glibc 64-bit
8787

88-
- os: ubuntu-22.04
89-
build: 'cp38-musllinux_x86_64'
90-
name: Linux Intel musl 64-bit 3.8
91-
- os: ubuntu-22.04
92-
build: 'cp39-musllinux_x86_64'
93-
name: Linux Intel musl 64-bit 3.9
9488
- os: ubuntu-22.04
9589
build: 'cp310-musllinux_x86_64'
9690
name: Linux Intel musl 64-bit 3.10
@@ -107,12 +101,6 @@ jobs:
107101
build: 'cp314-musllinux_x86_64'
108102
name: Linux Intel musl 64-bit 3.14
109103

110-
- os: ubuntu-22.04
111-
build: 'cp38-manylinux_aarch64'
112-
name: Linux Aarch64 3.8
113-
- os: ubuntu-22.04
114-
build: 'cp39-manylinux_aarch64'
115-
name: Linux Aarch64 3.9
116104
- os: ubuntu-22.04
117105
build: 'cp310-manylinux_aarch64'
118106
name: Linux Aarch64 3.10
@@ -134,7 +122,9 @@ jobs:
134122
with:
135123
submodules: recursive
136124

137-
- name: Set MSVC for Windows-x64
125+
- uses: astral-sh/setup-uv@v7
126+
127+
- name: Set MSVC for Windows-x64
138128
uses: microsoft/setup-msbuild@v2
139129
if: matrix.os == 'windows-latest'
140130
with:
@@ -161,14 +151,14 @@ jobs:
161151

162152
- uses: pypa/cibuildwheel@v3.3.1
163153
env:
154+
CIBW_BUILD_FRONTEND: 'build[uv]'
164155
CIBW_TEST_REQUIRES: pytest pytest-cov numpy
165156
CIBW_TEST_COMMAND: pytest {project}/tests
166157
CIBW_ARCHS_LINUX: auto aarch64
167158
CIBW_BUILD: ${{ matrix.build }}
168159

169160
- name: Check with Twine
170-
run: |
171-
pipx run twine check wheelhouse/*
161+
run: uvx twine check wheelhouse/*
172162

173163
- name: Upload artifacts to GitHub
174164
uses: actions/upload-artifact@v6.0.0
@@ -193,15 +183,19 @@ jobs:
193183
needs: [merge]
194184
runs-on: ubuntu-latest
195185
steps:
186+
- uses: astral-sh/setup-uv@v7
187+
with:
188+
enable-cache: false
189+
ignore-empty-workdir: true
190+
196191
- name: Download merged artifacts
197192
uses: actions/download-artifact@v7.0.0
198193
with:
199194
name: wheels_and_sdist
200195
path: dist
201196

202197
- name: Check all wheels and sdist with Twine
203-
run: |
204-
pipx run twine check dist/*
198+
run: uvx twine check dist/*
205199

206200
to_pypi:
207201
needs: [check_merged]

.gitignore

Lines changed: 32 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,57 @@
1-
h3c/
1+
# Byte-compiled / optimized
22
*.py[cod]
3-
.cache/
4-
h3/out/
5-
.ruff_cache/
6-
_build/
3+
__pycache__/
4+
5+
# C extensions
6+
*.so
77

88
# Generated C code from Cython test
99
tests/**/*.c
1010
# Cython HTML annotations
1111
*.html
1212

13-
# C extensions
14-
*.so
15-
16-
# Packages
17-
*.egg
13+
# Build artifacts
14+
build/
15+
dist/
1816
*.egg-info
19-
dist
20-
build
21-
eggs
22-
parts
23-
bin
24-
var
25-
sdist
26-
develop-eggs
27-
.installed.cfg
2817

29-
# Installer logs
30-
pip-log.txt
31-
32-
# Unit test / coverage reports
18+
# Coverage
3319
.coverage
3420
coverage.xml
3521
coverage.lcov
36-
.tox
37-
nosetests.xml
38-
.noseids
39-
.pytest_cache
22+
htmlcov/
4023

41-
# Mr Developer
42-
.mr.developer.cfg
43-
.project
44-
.pydevproject
24+
# Test
25+
.pytest_cache/
4526

46-
*.csv
47-
build/
48-
env/
49-
env_docs/
27+
# Tools
28+
.ruff_cache/
29+
.cache/
30+
31+
# Docs
32+
_build/
5033
docs/_build/
51-
htmlcov/
5234

53-
# vim/emacs backup files
35+
# Environment
36+
.venv/
37+
uv.lock
38+
39+
# OS
40+
.DS_Store
41+
42+
# Editor backup files
5443
*~
5544
\#*\#
5645
.\#*
5746
.*.sw*
5847

59-
#DB snapshots
60-
db_snapshots/
61-
62-
#OSX
63-
.DS_Store
64-
65-
node_modules/
66-
bower_components/
67-
.sass-cache/
48+
# IDE
6849
.idea/
69-
.unison.*
7050

51+
# IPython / Jupyter
7152
.ipynb_checkpoints/
72-
_skbuild/
7353

74-
# might want to remove this later when distributing
75-
MANIFEST
54+
# Legacy build dirs
55+
_skbuild/
56+
h3c/
57+
h3/out/

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ avoid adding features or APIs which do not map onto the
1616

1717
## Unreleased
1818

19+
## [4.5.0a1] - 2026-02-25
20+
21+
- Update `h3lib` with draft v4.5 changes
22+
- Drop Python 3.8 and 3.9 (EOL); minimum is now Python 3.10
23+
- Document Python 3.14 support
24+
- Migrate build tooling from Makefile/pip to justfile/uv, including CI
25+
1926
## [4.4.2] - 2026-01-29
2027

2128
- Check for error from `cellsToLinkedMultiPolygon` (#477)

dev_notes.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,20 @@
22

33
## Install for development
44

5+
This repo uses [`just`](https://github.com/casey/just) for running common development commands.
6+
7+
To get started:
8+
59
- `git clone git@github.com:uber/h3-py.git`
610
- `cd h3-py`
7-
- `make init`
8-
- `make test`
9-
- `make lint`
11+
- `just lint`
12+
- `just test`
13+
- `just test-cython`
14+
15+
To build and view docs:
16+
17+
- `just docs`
18+
- `just view`
1019

1120

1221
## Docstrings

0 commit comments

Comments
 (0)