Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add types for prosemirror.model #233

Merged
merged 41 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
ad48c5b
Add typing for prosemirror.utils and add JSON alias
sciyoshi Jun 14, 2023
2d7411c
Add typing for prosemirror.model.comparedeep
sciyoshi Jun 15, 2023
927409b
Typing for prosemirror.model.content
sciyoshi Jun 15, 2023
7380bae
Typing for prosemirror.model.diff
sciyoshi Jun 15, 2023
f9a7e30
Typing for schema + fixes uncovered
sciyoshi Jun 15, 2023
a1160cf
Typing for prosemirror.model.fragment
sciyoshi Jun 15, 2023
6426a80
Add typings for node
sciyoshi Jun 16, 2023
690f7d5
Finish typing for node
sciyoshi Jun 16, 2023
662170e
Typing for prosemirror.model.replace
sciyoshi Jun 16, 2023
54614bc
Typing for prosemirror.model.mark
sciyoshi Jun 16, 2023
63caf86
typing for to_dom
sciyoshi Jun 16, 2023
aa20294
Fix strict issues
sciyoshi Jun 16, 2023
4fbf213
Fix typing in tests
sciyoshi Jun 16, 2023
455624a
Additional typing fixes
sciyoshi Jun 16, 2023
fcdb113
A few typing and mypyc fixes, remove dataclass
sciyoshi Jun 16, 2023
5101e22
Address comments
sciyoshi Jun 16, 2023
e4d3a9d
Fix on python 3.8
sciyoshi Jun 16, 2023
5f5ce01
Fix attribute computation
sciyoshi Jun 17, 2023
c61cf39
Mutable JSON
sciyoshi Jun 21, 2023
0f3b18e
Upgrading to mypy 1.7.0. Making mypy strict for all modules.
ernesto-at-fellow Nov 13, 2023
f1bda00
Removing mutable json types. Creating new immutable instances instead…
ernesto-at-fellow Nov 13, 2023
47ab753
Using the built-in types for type annotations instead of the ones fro…
ernesto-at-fellow Nov 13, 2023
4c08bf4
Adding types to the transform module. Creating the Mappable abstract …
ernesto-at-fellow Nov 13, 2023
2830ca9
Remove leftover debugging comment.
ernesto-at-fellow Nov 13, 2023
5c41951
Using generic types for most uses of Schema, just like in the origina…
ernesto-at-fellow Nov 14, 2023
7c2a85a
Adding missing import of Attrs.
ernesto-at-fellow Nov 14, 2023
e919932
Reverting changes to Mark.to_json that broke tests.
ernesto-at-fellow Nov 14, 2023
1ca91b9
Restoring attr step.
ernesto-at-fellow Nov 14, 2023
ef9feb6
Fixing regression on Transform.replace_range.
ernesto-at-fellow Nov 14, 2023
3edecdf
Add py.typed
sciyoshi Nov 15, 2023
5f51e6a
Merge remote-tracking branch 'origin/main' into typing-2
sciyoshi Nov 15, 2023
e45c7eb
Typing fixes after merging main
sciyoshi Nov 15, 2023
81f8232
Fix tests + typing in transform replace_range
sciyoshi Nov 15, 2023
1539783
Updating some type annotations to match the original repos.
ernesto-at-fellow Nov 15, 2023
caa206d
Reverting the type annotation syntax to be valid for Python 3.9.
ernesto-at-fellow Nov 16, 2023
0e6c2e3
Removing the mypy check from "tests" since there seems to be no way t…
ernesto-at-fellow Nov 16, 2023
f467c25
Minor changes to types are reviewing the original TS repos.
ernesto-at-fellow Nov 16, 2023
be372f1
More minor fixes related to type annotations syntax and Python 3.9.
ernesto-at-fellow Nov 16, 2023
f1fad36
Making type annotations compatible with Python 3.8.
ernesto-at-fellow Nov 16, 2023
d12715e
Using Callable from Typing for Python 3.8 compatibility reasons.
ernesto-at-fellow Nov 16, 2023
b061e0e
Minor version bump due to the mypy related changes.
ernesto-at-fellow Nov 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
- run: poetry install --no-interaction
- run: poetry run black --check prosemirror tests
- run: poetry run ruff prosemirror tests
- run: poetry run mypy prosemirror tests
- run: poetry run mypy prosemirror
59 changes: 30 additions & 29 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion prosemirror/model/comparedeep.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
def compare_deep(a, b):
from prosemirror.utils import JSON


def compare_deep(a: JSON, b: JSON) -> bool:
return a == b
Loading