src/oold/validation/formats.py is 233 lines implementing 18 format assertions by hand. jsonschema[format-nongpl] supplies 19, covering all 18, with identical behaviour on the cases that matter here.
Measured
Same seven inputs through both, across iri, iri-reference, uri, uri-reference - identical in every cell, including the compact-IRI case that motivated the hand-written versions:
ex:alice iri=True iri-reference=True uri=True uri-reference=True
schema:Person iri=True iri-reference=True uri=True uri-reference=True
urn:uuid:1234... iri=True iri-reference=True uri=True uri-reference=True
alice iri=False iri-reference=True uri=False uri-reference=True
../Thing.schema.json iri=False iri-reference=True uri=False uri-reference=True
http://exa mple.org iri=False iri-reference=False uri=False uri-reference=False
The non-ASCII behaviour asserted by test_iri_allows_non_ascii_but_uri_does_not also matches: iri-reference=True, uri=False.
Coverage: all 18 of this package's formats appear in format-nongpl's 19.
Licence constraint
Use jsonschema[format-nongpl], not jsonschema[format]. The latter pulls in rfc3987, which is GNU GPLv3+; this package is Apache-2.0. rfc3987 is correct on every case tested, but its licence rules it out.
Cost
format-nongpl installs 20 transitive packages. That is the main argument for keeping the hand-written module.
Work
- Swap
OOLD_FORMAT_CHECKER onto the library checkers, keeping the module as the seam so callers do not change
- Gate on
tests/test_validation/test_formats.py in full, not the sample above, plus OOLD_SCHEMA_DIR=../oold-schema uv run pytest -m parity
- If any format diverges, keep that one hand-written and document which and why
Raised from review of #114 (#114 (comment)).
src/oold/validation/formats.pyis 233 lines implementing 18formatassertions by hand.jsonschema[format-nongpl]supplies 19, covering all 18, with identical behaviour on the cases that matter here.Measured
Same seven inputs through both, across
iri,iri-reference,uri,uri-reference- identical in every cell, including the compact-IRI case that motivated the hand-written versions:The non-ASCII behaviour asserted by
test_iri_allows_non_ascii_but_uri_does_notalso matches:iri-reference=True,uri=False.Coverage: all 18 of this package's formats appear in
format-nongpl's 19.Licence constraint
Use
jsonschema[format-nongpl], notjsonschema[format]. The latter pulls inrfc3987, which is GNU GPLv3+; this package is Apache-2.0.rfc3987is correct on every case tested, but its licence rules it out.Cost
format-nongplinstalls 20 transitive packages. That is the main argument for keeping the hand-written module.Work
OOLD_FORMAT_CHECKERonto the library checkers, keeping the module as the seam so callers do not changetests/test_validation/test_formats.pyin full, not the sample above, plusOOLD_SCHEMA_DIR=../oold-schema uv run pytest -m parityRaised from review of #114 (#114 (comment)).