Skip to content

Commit d9d61ec

Browse files
CommanderStormautofix-ci[bot]pre-commit-ci[bot]
authored
ci(rust): fix release names and artefacts, likely (#973)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 0953227 commit d9d61ec

8 files changed

Lines changed: 32 additions & 29 deletions

File tree

.github/workflows/python-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
branches:
99
- main
1010
tags:
11-
- 'rust-mlt-pyo3-v*'
11+
- 'python-mlt-v*'
1212
pull_request:
1313
paths:
1414
- 'justfile'

qgis/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A QGIS plugin to open **MapLibre Tile (MLT)** files, powered by the Rust
1212
└────────┬────────────┘
1313
│ import
1414
┌────────▼────────────┐
15-
mlt_pyo3 │ Rust → Python bridge (PyO3 + maturin)
15+
mlt │ Rust → Python bridge (PyO3 + maturin)
1616
│ (rust/mlt-pyo3) │
1717
└────────┬────────────┘
1818
│ depends on
@@ -33,7 +33,7 @@ A QGIS plugin to open **MapLibre Tile (MLT)** files, powered by the Rust
3333

3434
### Step 1: Find QGIS's Python interpreter
3535

36-
The `mlt_pyo3` native module must be built for the same Python that QGIS uses.
36+
The `mlt` native module must be built for the same Python that QGIS uses.
3737

3838
```bash
3939
# Linux (system Python, usually the same one QGIS links to)
@@ -56,7 +56,7 @@ maturin build --release --interpreter /usr/bin/python3
5656

5757
# Install into user site-packages (visible to QGIS)
5858
/usr/bin/python3 -m pip install --user --break-system-packages \
59-
../../rust/target/wheels/mlt_pyo3-*.whl
59+
../../rust/target/wheels/mlt-*.whl
6060

6161
# Option B: if QGIS uses a virtualenv / conda, activate it first
6262
# conda activate qgis-env # or: source /path/to/venv/bin/activate
@@ -66,7 +66,7 @@ maturin build --release --interpreter /usr/bin/python3
6666
Verify:
6767

6868
```bash
69-
/usr/bin/python3 -c "import mlt_pyo3; print(mlt_pyo3.list_layers(open('../../test/synthetic/0x01/polygon.mlt','rb').read()))"
69+
/usr/bin/python3 -c "import mlt; print(mlt.list_layers(open('../../test/synthetic/0x01/polygon.mlt','rb').read()))"
7070
# Expected: ['layer1']
7171
```
7272

@@ -133,31 +133,31 @@ geo-referencing (useful for inspecting raw tile data).
133133
## Python API (standalone, without QGIS)
134134

135135
```python
136-
import mlt_pyo3
136+
import mlt
137137

138138
data = open("tile.mlt", "rb").read()
139139

140140
# Structured decode with geo-referencing
141-
layers = mlt_pyo3.decode_mlt(data, z=14, x=8297, y=10749, tms=True)
141+
layers = mlt.decode_mlt(data, z=14, x=8297, y=10749, tms=True)
142142
for layer in layers:
143143
print(f"Layer: {layer.name}, extent: {layer.extent}")
144144
for feat in layer.features[:3]:
145145
print(f" id={feat.id}, type={feat.geometry_type}")
146146
print(f" wkb={len(feat.wkb)} bytes, props={dict(feat.properties)}")
147147

148148
# Raw tile-local coordinates (no z/x/y needed)
149-
layers = mlt_pyo3.decode_mlt(data)
149+
layers = mlt.decode_mlt(data)
150150

151151
# GeoJSON string output (tile-local coords)
152-
geojson_str = mlt_pyo3.decode_mlt_to_geojson(data)
152+
geojson_str = mlt.decode_mlt_to_geojson(data)
153153

154154
# Fast layer listing (no full decode)
155-
names = mlt_pyo3.list_layers(data)
155+
names = mlt.list_layers(data)
156156
```
157157

158158
## Troubleshooting
159159

160-
**"mlt_pyo3 module not found"** — the native module isn't installed for QGIS's
160+
**"mlt module not found"** — the native module isn't installed for QGIS's
161161
Python. Re-run Step 2 using the correct interpreter.
162162

163163
**Features appear in the ocean** — toggle the TMS checkbox, or verify z/x/y

qgis/mlt_plugin/loader.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Loads MLT files into QGIS memory layers using mlt_pyo3."""
1+
"""Loads MLT files into QGIS memory layers using mlt."""
22

33
from collections import defaultdict
44
from pathlib import Path
@@ -18,9 +18,9 @@
1818
from qgis.PyQt.QtCore import QVariant
1919

2020
try:
21-
import mlt_pyo3
21+
import mlt
2222
except ImportError:
23-
mlt_pyo3 = None
23+
mlt = None
2424

2525
PLUGIN_NAME = "MLT Provider"
2626

@@ -52,11 +52,11 @@ def _canonical_geom_type(geom_type_str: str) -> str:
5252
}
5353

5454

55-
def _ensure_mlt_pyo3():
56-
if mlt_pyo3 is None:
55+
def _ensure_mlt():
56+
if mlt is None:
5757
raise ImportError(
58-
"mlt_pyo3 module not found. "
59-
"Install it with: pip install mlt-pyo3 "
58+
"mlt module not found. "
59+
"Install it with: pip install mlt "
6060
"(or build from rust/mlt-pyo3 with maturin)"
6161
)
6262

@@ -118,8 +118,8 @@ def _make_qgs_features(features, vl, field_names) -> List[QgsFeature]:
118118
def _decode_file(file_path, zxy=None, tms=True):
119119
data = Path(file_path).read_bytes()
120120
if zxy is not None:
121-
return mlt_pyo3.decode_mlt(data, z=zxy[0], x=zxy[1], y=zxy[2], tms=tms)
122-
return mlt_pyo3.decode_mlt(data)
121+
return mlt.decode_mlt(data, z=zxy[0], x=zxy[1], y=zxy[2], tms=tms)
122+
return mlt.decode_mlt(data)
123123

124124

125125
def _create_and_populate_layer(
@@ -170,7 +170,7 @@ def load_mlt_file(
170170
tms: bool = True,
171171
) -> List[QgsVectorLayer]:
172172
"""Read a single MLT file and add its layers to the QGIS project."""
173-
_ensure_mlt_pyo3()
173+
_ensure_mlt()
174174

175175
mlt_layers = _decode_file(file_path, zxy=zxy, tms=tms)
176176
stem = Path(file_path).stem
@@ -207,7 +207,7 @@ def load_mlt_files_merged(
207207
Files not in the dict (or if None) use raw tile coords.
208208
tms: TMS y-axis convention (default True).
209209
"""
210-
_ensure_mlt_pyo3()
210+
_ensure_mlt()
211211

212212
# Key: (layer_name, geom_type_str) -> list of mlt features
213213
buckets: Dict[Tuple[str, str], list] = defaultdict(list)
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ git_release_name = "rust-{{ package }}-v{{ version }}"
77
git_release_body = """
88
{{ changelog }}
99
{% if remote.contributors %}
10+
1011
### Contributors
1112
{% for contributor in remote.contributors %}
1213
* @{{ contributor.username }}
@@ -17,7 +18,7 @@ git_tag_enable = true
1718
git_tag_name = "rust-{{ package }}-v{{ version }}"
1819
pr_branch_prefix = "release-plz-"
1920
pr_labels = ["release"]
20-
pr_name = "chore(rust): release{% if package %} {{ package }}{% endif %}{% if version %} v{{ version }}{% endif %}"
21+
pr_name = "chore(rust): release{% if package %} {{ package }}{% endif %}{% if version %} v{{ version }}{% endif %}"
2122
publish_allow_dirty = false
2223
publish_no_verify = true # we have already thoroughly verified that all aspects of our project work in CI before this step
2324
semver_check = true
@@ -32,6 +33,8 @@ name = "mlt-core"
3233

3334
[[package]]
3435
name = "mlt-pyo3"
36+
git_tag_name = "python-mlt-v{{ version }}"
37+
git_release_name = "python-mlt-v{{ version }}"
3538

3639
[[package]]
3740
name = "mlt-synthetics"

rust/mlt-pyo3/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ requires = ["maturin>=1.7,<2.0"]
33
build-backend = "maturin"
44

55
[project]
6-
name = "mlt-pyo3"
7-
version = "0.1.2"
6+
name = "mlt"
7+
version = "0.1.3"
88
description = "Python bindings for MapLibre Tile (MLT) format"
99
requires-python = ">=3.10"
1010
license = { text = "MIT OR Apache-2.0" }
@@ -29,4 +29,4 @@ classifiers = [
2929

3030
[tool.maturin]
3131
manifest-path = "Cargo.toml"
32-
module-name = "mlt_pyo3"
32+
module-name = "mlt"

rust/mlt-pyo3/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ fn list_layers(
320320
}
321321

322322
#[pymodule]
323-
fn mlt_pyo3(m: &Bound<'_, PyModule>) -> PyResult<()> {
323+
fn mlt(m: &Bound<'_, PyModule>) -> PyResult<()> {
324324
m.add_function(wrap_pyfunction!(decode_mlt, m)?)?;
325325
m.add_function(wrap_pyfunction!(decode_mlt_to_geojson, m)?)?;
326326
m.add_function(wrap_pyfunction!(list_layers, m)?)?;

rust/mod.just

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ lint: clippy test-fmt
161161
msrv: (just 'cargo-install' 'cargo-msrv')
162162
cargo msrv find --write-msrv --ignore-lockfile --component rustfmt -- {{just}} rust::ci-test-msrv
163163

164-
# Build mlt-pyo3 and launch a Python interpreter with mlt_pyo3 pre-imported
164+
# Build mlt-pyo3 and launch a Python interpreter with mlt pre-imported
165165
[working-directory: 'mlt-pyo3']
166166
py: (just 'cargo-install' 'maturin')
167167
#!/usr/bin/env bash
@@ -172,7 +172,7 @@ py: (just 'cargo-install' 'maturin')
172172
fi
173173
source .venv/bin/activate
174174
maturin develop
175-
python3 -i -c "import mlt_pyo3; print('mlt_pyo3 ready — try: mlt_pyo3.decode_mlt(data)')"
175+
python3 -i -c "import mlt; print('mlt ready — try: mlt.decode_mlt(data)')"
176176
177177
py-publish:
178178
docker run --rm -v $(pwd):/io ghcr.io/pyo3/maturin build --release

0 commit comments

Comments
 (0)