You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+9-12Lines changed: 9 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@ This project is open source and community driven. As such we encourage code cont
7
7
3. Improve plugin code and extend its capabilities
8
8
4. Write tests
9
9
5. Update dependencies
10
+
6. Fix and remove things from our `stubtest/allowlist_todo.txt`
10
11
11
12
## Tutorials
12
13
@@ -76,23 +77,19 @@ If you get some unexpected results or want to be sure that tests run is not affe
76
77
rm -r .mypy_cache
77
78
```
78
79
80
+
### Testing stubs with `stubtest`
79
81
80
-
### Generating Stubs using Stubgen
82
+
Run `bash ./scripts/stubtest.sh` to test that stubs and sources are in-line.
81
83
82
-
The stubs are based on auto-generated code created by Mypy's stubgen tool (see: [the stubgen docs](https://mypy.readthedocs.io/en/stable/stubgen.html)).
83
-
To make life easier we have a helper script that auto generates these stubs. To use it you can run:
84
+
We have two special files to allow errors:
85
+
1.`scripts/stubtest/allowlist.txt` where we store things that we really don't care about: hacks, django internal utility modules, things that are handled by our plugin, things that are not representable by type system, etc
86
+
2.`scripts/stubtest/allowlist_generate.txt` where we store all errors there are right now. Basically, this is a TODO list: we need to work through this list and fix things (or move entries to real `allowlist.txt`). In the end, ideally we can remove this file
**Important**: right now we only run `stubtest` on Python 3.11 (because it is the latest released version at the moment), any other versions might generate different outputs. Any work to create per-version allowlists is welcome.
94
92
95
-
The output for this is a gitignored folder called "stubgen" in the repo's root.
0 commit comments