Skip to content

fix(deps): require ucumvert 0.3.3 - #149

Merged
chuckwondo merged 3 commits into
mainfrom
fix/require-ucumvert-0.3.3
Nov 16, 2026
Merged

chuckwondo merged 3 commits into
mainfrom
fix/require-ucumvert-0.3.3

Conversation

@chuckwondo

Copy link
Copy Markdown
Contributor

import titiler_covjson fails under pint 0.26.2 with any ucumvert release before 0.3.3, because pint 0.26.2 rejects the i.U. alias in ucumvert's unit definitions (dalito/ucumvert#82). ucumvert does not cap pint, so our ucumvert>=0.3.0 floor allows that pairing on Python 3.12 and later, where pint 0.26.2 installs. CI on main misses it because uv.lock pins pint 0.25.3 and the floor job runs on Python 3.11.

This raises the ucumvert floor to 0.3.3, the first release that supports pint 0.26 (dalito/ucumvert#84), in place of the pint bound that PR #142 proposed. The lock also moves pint to 0.26.2 on Python 3.12 and later, so the 3.12 and 3.13 test legs run that pairing. Python 3.11 keeps pint 0.25.3, because pint 0.26.2 requires Python 3.12.

$ uv run -q --isolated --python 3.13 --with ucumvert==0.3.2 --with pint==0.26.2 python -c "import titiler_covjson" 2>&1 | grep ^pint
pint.delegates.txt_defparser.common.DefinitionSyntaxError: Cannot define 'international_unit' (<class 'pint.delegates.txt_defparser.plain.UnitDefinition'>): the alias i.U. is not a valid unit alias (must be a single name without whitespace or operators)
$ uv run -q --isolated --python 3.13 --with ucumvert==0.3.3 --with pint==0.26.2 python -c "import titiler_covjson; print(\"imported\")"
imported

The new floor also fixes a 500 when a band's units tag is a bare UCUM annotation such as {count}. _create_parameter passes the tag to create_unit, which raises AttributeError on ucumvert 0.3.2, while 0.3.3 converts the annotation to unity (dalito/ucumvert#86).

$ uv run -q --isolated --python 3.11 --with ucumvert==0.3.2 python -c "from titiler_covjson.helpers import create_unit; print(create_unit(\"{count}\"))" 2>&1 | tail -1
AttributeError: 'Token' object has no attribute 'units'
$ uv run -q --isolated --python 3.11 --with ucumvert==0.3.3 python -c "from titiler_covjson.helpers import create_unit; print(create_unit(\"{count}\"))"
id=None label={'en': 'dimensionless'} symbol=Symbol(value='{count}', type='http://www.opengis.net/def/uom/UCUM/')

The ucumvert lock change is the same as PR #148's.

ucumvert releases before 0.3.3 fail to load their unit registry under
pint 0.26.2. The lock moves pint to 0.26.2 on Python 3.12 and later,
so CI tests that pairing.
@chuckwondo chuckwondo added bug Something isn't working dependencies Pull requests that update a dependency file labels Nov 16, 2026
@chuckwondo
chuckwondo merged commit 7385d75 into main Nov 16, 2026
13 checks passed
@chuckwondo
chuckwondo deleted the fix/require-ucumvert-0.3.3 branch November 16, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants