Skip to content

Commit dadc020

Browse files
committed
Fix links broken by pyright removing their transform spec
1 parent bef2f52 commit dadc020

File tree

4 files changed

+3
-16
lines changed

4 files changed

+3
-16
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ See https://github.com/python-attrs/attrs/blob/main/.github/CONTRIBUTING.md#chan
285285
See the [new docs on comparison](https://www.attrs.org/en/stable/comparison.html) for more details.
286286
[#787](https://github.com/python-attrs/attrs/issues/787)
287287

288-
- Added **provisional** support for static typing in `pyright` via the [dataclass_transforms specification](https://github.com/microsoft/pyright/blob/main/specs/dataclass_transforms.md).
288+
- Added **provisional** support for static typing in `pyright` via [PEP 681](https://peps.python.org/pep-0681/).
289289
Both the `pyright` specification and `attrs` implementation may change in future versions of both projects.
290290

291291
Your constructive feedback is welcome in both [attrs#795](https://github.com/python-attrs/attrs/issues/795) and [pyright#1782](https://github.com/microsoft/pyright/discussions/1782).

docs/conf.py

-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
r"https://github.com/.*/(issues|pull)/\d+",
2121
# Rate limits and the latest tag is missing anyways on release.
2222
"https://github.com/python-attrs/attrs/tree/.*",
23-
# It never finds the anchor even though it's there.
24-
"https://github.com/microsoft/pyright/blob/main/specs/"
25-
"dataclass_transforms.md#attrs",
2623
]
2724

2825
# In nitpick mode (-n), still ignore any of the following "broken" references

docs/extending.md

+1-8
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ You can only use this trick to tell *Mypy* that a class is actually an *attrs* c
9494

9595
### Pyright
9696

97-
Generic decorator wrapping is supported in [*Pyright*](https://github.com/microsoft/pyright) via their [`dataclass_transform`] specification.
97+
Generic decorator wrapping is supported in [*Pyright*](https://github.com/microsoft/pyright) via `dataclass_transform` / {pep}`689`.
9898

9999
For a custom wrapping of the form:
100100

@@ -118,11 +118,6 @@ def __dataclass_transform__(
118118
def custom_define(f): ...
119119
```
120120

121-
:::{warning}
122-
`dataclass_transform` is supported **provisionally** as of `pyright` 1.1.135.
123-
124-
Both the *Pyright* [`dataclass_transform`] specification and *attrs* implementation may change in future versions.
125-
:::
126121

127122
## Types
128123

@@ -332,5 +327,3 @@ It has the signature
332327
>>> json.dumps(data)
333328
'{"dt": "2020-05-04T13:37:00"}'
334329
```
335-
336-
[`dataclass_transform`]: https://github.com/microsoft/pyright/blob/main/specs/dataclass_transforms.md

docs/types.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class SomeClass:
7373

7474
## Pyright
7575

76-
*attrs* provides support for [*Pyright*] though the [`dataclass_transform`] specification.
76+
*attrs* provides support for [*Pyright*] through the `dataclass_transform` / {pep}`681` specification.
7777
This provides static type inference for a subset of *attrs* equivalent to standard-library {mod}`dataclasses`,
7878
and requires explicit type annotations using the {func}`attrs.define` or `@attr.s(auto_attribs=True)` API.
7979

@@ -94,13 +94,10 @@ The *Pyright* inferred types are a tiny subset of those supported by *Mypy*, inc
9494

9595
- The `attrs.frozen` decorator is not typed with frozen attributes, which are properly typed via `attrs.define(frozen=True)`.
9696

97-
A [full list](https://github.com/microsoft/pyright/blob/main/specs/dataclass_transforms.md#attrs) of limitations and incompatibilities can be found in *Pyright*'s repository.
98-
9997
Your constructive feedback is welcome in both [attrs#795](https://github.com/python-attrs/attrs/issues/795) and [pyright#1782](https://github.com/microsoft/pyright/discussions/1782).
10098
Generally speaking, the decision on improving *attrs* support in *Pyright* is entirely Microsoft's prerogative, though.
10199
:::
102100

103-
[`dataclass_transform`]: https://github.com/microsoft/pyright/blob/main/specs/dataclass_transforms.md
104101
[*Mypy*]: http://mypy-lang.org
105102
[*Pyright*]: https://github.com/microsoft/pyright
106103
[*pytype*]: https://google.github.io/pytype/

0 commit comments

Comments
 (0)