Skip to content

Commit 622c7b2

Browse files
committed
Depend on rfc3339-validator for format, even for non-nonGPL.
It passes all the new upstream (non-ASCII date/time) tests, whilst strict-rfc3339 does not, plus it's maintained. More props to @naimetti.
1 parent d0b71d1 commit 622c7b2

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

docs/validate.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ Checker Notes
360360
========================= ====================
361361
``color`` requires webcolors_
362362
``date``
363-
``date-time`` requires strict-rfc3339_ or rfc3339-validator_
363+
``date-time`` requires rfc3339-validator_
364364
``email``
365365
``hostname``
366366
``idn-hostname`` requires idna_
@@ -371,7 +371,7 @@ Checker Notes
371371
``json-pointer`` requires jsonpointer_
372372
``regex``
373373
``relative-json-pointer`` requires jsonpointer_
374-
``time`` requires strict-rfc3339_ or rfc3339-validator_
374+
``time`` requires rfc3339-validator_
375375
``uri`` requires rfc3987_ or rfc3986-validator_
376376
``uri-reference`` requires rfc3987_ or rfc3986-validator_
377377
========================= ====================
@@ -381,7 +381,6 @@ Checker Notes
381381
.. _jsonpointer: https://pypi.org/pypi/jsonpointer/
382382
.. _rfc3987: https://pypi.org/pypi/rfc3987/
383383
.. _rfc5322: https://tools.ietf.org/html/rfc5322#section-3.4.1
384-
.. _strict-rfc3339: https://pypi.org/pypi/strict-rfc3339/
385384
.. _webcolors: https://pypi.org/pypi/webcolors/
386385
.. _rfc3339-validator: https://pypi.org/project/rfc3339-validator/
387386
.. _rfc3986-validator: https://pypi.org/project/rfc3986-validator/

jsonschema/_format.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -325,16 +325,11 @@ def is_uri_reference(instance):
325325
return True
326326
return rfc3987.parse(instance, rule="URI_reference")
327327

328-
329328
try:
330-
from strict_rfc3339 import validate_rfc3339
329+
from rfc3339_validator import validate_rfc3339
331330
except ImportError:
332-
try:
333-
from rfc3339_validator import validate_rfc3339
334-
except ImportError:
335-
validate_rfc3339 = None
336-
337-
if validate_rfc3339:
331+
pass
332+
else:
338333
@_checks_drafts(name="date-time")
339334
def is_datetime(instance):
340335
if not isinstance(instance, str):

setup.cfg

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,21 @@ install_requires =
3333
format =
3434
fqdn
3535
idna
36+
isoduration
3637
jsonpointer>1.13
38+
rfc3339-validator
3739
rfc3987
38-
strict-rfc3339
39-
webcolors
4040
uri_template
41-
isoduration
41+
webcolors
4242
format_nongpl =
4343
fqdn
4444
idna
45+
isoduration
4546
jsonpointer>1.13
46-
webcolors
47-
rfc3986-validator>0.1.0
4847
rfc3339-validator
48+
rfc3986-validator>0.1.0
4949
uri_template
50-
isoduration
50+
webcolors
5151

5252
[options.entry_points]
5353
console_scripts =

0 commit comments

Comments
 (0)