Skip to content

Commit 37bb302

Browse files
authored
Check links in docs (#897)
1 parent 1910584 commit 37bb302

File tree

13 files changed

+49
-292
lines changed

13 files changed

+49
-292
lines changed

.github/workflows/docs.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ jobs:
2626
make html
2727
popd
2828
29+
- name: Check links
30+
uses: lycheeverse/lychee-action@v2
31+
with:
32+
lycheeVersion: v0.21.0
33+
fail: true
34+
failIfEmpty: true
35+
args: README.md docs/build
36+
2937
- name: Deploy
3038
uses: peaceiris/actions-gh-pages@v3
3139
if: github.ref == 'refs/heads/main'

docs/source/_static/edgedb.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/source/changelog.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ Version 0.7.0 (2022-06-20)
424424
- Adds ``order`` and ``eq`` configuration options for `Struct` types, mirroring
425425
the ``dataclasses`` options of the same name. Order comparisons for Struct
426426
types are very performant, roughly `10x to 70x faster
427-
<https://jcristharif.com/msgspec/benchmarks.html#benchmark-structs>`__ than
427+
<https://jcristharif.com/msgspec/benchmarks.html#structs>`__ than
428428
alternative libraries (:pr:`122`).
429429
- Speedup `Struct` decoding for both JSON and MessagePack, on average 20%
430430
faster (:pr:`119`).
@@ -443,7 +443,7 @@ Version 0.7.0 (2022-06-20)
443443
Version 0.6.0 (2022-04-06)
444444
--------------------------
445445

446-
- Add a new `msgspec.Raw <https://jcristharif.com/msgspec/usage.html#raw>`__
446+
- Add a new `msgspec.Raw <https://jcristharif.com/msgspec/api.html#msgspec.Raw>`__
447447
type for delayed decoding of message fields / serializing already encoded
448448
fields (:pr:`92`).
449449
- Add ``omit_defaults`` option to ``Struct`` types (`docs
@@ -452,15 +452,15 @@ Version 0.6.0 (2022-04-06)
452452
from serialized message. This improves both encode and decode performance
453453
(:pr:`94`).
454454
- Add ``rename`` option to ``Struct`` types (`docs
455-
<https://jcristharif.com/msgspec/structs.html#renaming-field-names>`__) for
455+
<https://jcristharif.com/msgspec/structs.html#renaming-fields>`__) for
456456
altering the field names used for encoding. A major use of this is supporting
457457
``camelCase`` JSON field names, while letting Python code use the more
458458
standard ``snake_case`` field names (:pr:`98`).
459459
- Improve performance of ``nogc=True`` structs (`docs
460460
<https://jcristharif.com/msgspec/structs.html#disabling-garbage-collection-advanced>`__).
461461
GC is now avoided in more cases, and ``nogc=True`` structs use 16 fewer bytes
462462
per instance. Also added a `benchmark
463-
<https://jcristharif.com/msgspec/benchmarks.html#benchmark-garbage-collection>`__
463+
<https://jcristharif.com/msgspec/benchmarks.html#garbage-collection>`__
464464
for how ``msgspec`` can interact with application GC usage (:pr:`93`).
465465
- Cache creation of `tagged union
466466
<https://jcristharif.com/msgspec/structs.html#tagged-unions>`__ lookup

docs/source/examples/edgedb.rst

Lines changed: 0 additions & 224 deletions
This file was deleted.

docs/source/examples/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ Here we provide a few examples using ``msgspec`` to accomplish various tasks.
1010
asyncio-kv.rst
1111
conda-repodata.rst
1212
pyproject-toml.rst
13-
edgedb.rst

docs/source/structs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ generating `Struct` types to match an existing API.
816816

817817
.. code-block:: python
818818
819-
# https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#podspec-v1-core
819+
# https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#PodSpec
820820
# An explicit mapping from python name -> JSON field name
821821
v1podspec_names = {
822822
...

docs/source/supported-types.rst

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -712,25 +712,22 @@ already using them elsewhere, or if you have downstream code that requires a
712712
File "<stdin>", line 1, in <module>
713713
msgspec.ValidationError: Expected `int`, got `str` - at `$[1]`
714714
715-
Other types that duck-type as ``NamedTuple`` (for example
716-
`edgedb NamedTuples <https://www.edgedb.com/docs/clients/python/api/types#named-tuples>`__)
717-
are also supported.
715+
Other types that duck-type as ``NamedTuple`` are also supported, such as
716+
`os.stat_result`.
718717

719718
.. code-block:: python
720719
721-
>>> import edgedb
720+
>>> import os
722721
723-
>>> client = edgedb.create_client()
722+
>>> import sys
724723
725-
>>> alice = client.query_single(
726-
... "SELECT (name := 'Alice', dob := <cal::local_date>'1984-03-01')"
727-
... )
724+
>>> result = os.stat(sys.executable)
728725
729-
>>> alice
730-
(name := 'Alice', dob := datetime.date(1984, 3, 1))
726+
>>> result
727+
os.stat_result(st_mode=33261, st_ino=5396073, st_dev=105, st_nlink=1, st_uid=0, st_gid=0, st_size=18440, st_atime=1760547094, st_mtime=1760547094, st_ctime=1760907672)
731728
732-
>>> msgspec.json.encode(alice)
733-
b'["Alice","1984-03-01"]'
729+
>>> msgspec.json.encode(result)
730+
b'[33261,5396073,105,1,0,0,18440,1760547094,1760547094,1760907672]'
734731
735732
``dict``
736733
--------
@@ -847,29 +844,28 @@ additional features.
847844
File "<stdin>", line 1, in <module>
848845
msgspec.ValidationError: Expected `int`, got `str` - at `$.age`
849846
850-
Other types that duck-type as ``dataclasses`` (for example
851-
`edgedb Objects <https://www.edgedb.com/docs/clients/python/api/types#objects>`__ or
852-
`pydantic dataclasses <https://docs.pydantic.dev/latest/usage/dataclasses/>`__)
853-
are also supported.
847+
Other types that duck-type as ``dataclasses`` are also supported, such as
848+
`pydantic dataclasses <https://docs.pydantic.dev/latest/usage/dataclasses/>`__.
854849

855850
.. code-block:: python
856851
857-
>>> import edgedb
852+
>>> from datetime import datetime
858853
859-
>>> client = edgedb.create_client()
854+
>>> from pydantic.dataclasses import dataclass
860855
861-
>>> alice = client.query_single(
862-
... "SELECT User {name, dob} FILTER .name = <str>$name LIMIT 1",
863-
... name="Alice"
864-
... )
856+
>>> @dataclass
857+
... class User:
858+
... id: int
859+
... name: str = 'John Doe'
860+
... signup_ts: datetime | None = None
865861
866-
>>> alice
867-
Object{name := 'Alice', dob := datetime.date(1984, 3, 1)}
862+
>>> user = User(id='42', signup_ts='2032-06-21T12:00')
868863
869-
>>> msgspec.json.encode(alice)
870-
b'{"id":"a6b951cc-2d00-11ee-91aa-b3f17e9898ce","name":"Alice","dob":"1984-03-01"}'
864+
>>> user
865+
User(id=42, name='John Doe', signup_ts=datetime.datetime(2032, 6, 21, 12, 0))
871866
872-
For a more complete example using EdgeDB, see :doc:`examples/edgedb`.
867+
>>> msgspec.json.encode(user)
868+
b'{"id":42,"name":"John Doe","signup_ts":"2032-06-21T12:00:00"}'
873869
874870
``attrs``
875871
---------

examples/edgedb/dbschema/default.esdl

Lines changed: 0 additions & 10 deletions
This file was deleted.

examples/edgedb/dbschema/migrations/00001.edgeql

Lines changed: 0 additions & 11 deletions
This file was deleted.

examples/edgedb/edgedb.toml

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)