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
+59-41Lines changed: 59 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,6 @@ just install
39
39
`django-polymorphic` documentation is generated using [Sphinx](https://www.sphinx-doc.org) with the [furo](https://github.com/pradyunsg/furo) theme. Any new feature PRs must provide updated documentation for the features added. To build the docs run doc8 to check for formatting issues then run Sphinx:
40
40
41
41
```bash
42
-
just install-docs # install the doc dependencies
43
42
just docs # builds docs
44
43
just check-docs # lint the docs
45
44
just check-docs-links # check for broken links in the docs
@@ -73,6 +72,16 @@ To format source files you can run:
73
72
just format
74
73
```
75
74
75
+
### Type Checking
76
+
77
+
Both [mypy](https://www.mypy-lang.org) and [pyright](https://microsoft.github.io/pyright) are used to verify static typing. You can run them together or individually:
78
+
79
+
```bash
80
+
just check-types
81
+
just check-types-mypy
82
+
just check-types-pyright
83
+
```
84
+
76
85
## Running Tests
77
86
78
87
`django-polymorphic` is set up to use [pytest](https://docs.pytest.org) to run unit tests. All the tests are housed in `src/polymorphic/tests`. Before a PR is accepted, all tests must be passing and the code coverage must be at 100%. A small number of exempted error handling branches are acceptable.
@@ -127,44 +136,53 @@ just release x.x.x
127
136
## Just Recipes
128
137
129
138
```bash
130
-
build # build docs and package
131
-
build-docs # build the docs
132
-
build-docs-html # build html documentation
133
-
build-docs-pdf # build pdf documentation
134
-
check # run all static checks
135
-
check-docs # lint the documentation
136
-
check-docs-links # check the documentation links for broken links
137
-
check-format # check if the code needs formatting
138
-
check-lint # lint the code
139
-
check-package # run package checks
140
-
check-readme # check that the readme renders
141
-
check-types # run static type checking
142
-
clean # remove all non repository artifacts
143
-
clean-docs # remove doc build artifacts-
144
-
clean-env # remove the virtual environment
145
-
clean-git-ignored # remove all git ignored files
146
-
coverage # generate the test coverage report
147
-
debug-test *TESTS # debug a test - (break at test start/run in headed mode)
148
-
docs # build and open the documentation
149
-
docs-live # serve the documentation, with auto-reload
150
-
fetch-refs LIB
151
-
fix # fix formatting, linting issues and import sorting
152
-
format # format the code and sort imports
153
-
install *OPTS # update and install development dependencies
154
-
install-docs # install documentation dependencies
155
-
install-precommit # install git pre-commit hooks
156
-
install_uv # install the uv package manager
157
-
lint # sort the imports and fix linting issues
158
-
make-test-migrations # regenerate test migrations using the lowest version of Django
159
-
manage *COMMAND # run the django admin
160
-
open-docs # open the html documentation
161
-
precommit # run the pre-commit checks
162
-
release VERSION # issue a release for the given semver string (e.g. 2.1.0)
163
-
run +ARGS # run the command in the virtual environment
164
-
setup python="python"# setup the venv, pre-commit hooks and playwright dependencies
165
-
sort-imports # sort the python imports
166
-
test*TESTS # run tests
167
-
test-db DB_CLIENT="dev"*TESTS
168
-
test-lock +PACKAGES # lock to specific python and versions of given dependencies
169
-
validate_version VERSION # validate the given version string against the lib version
139
+
build # build docs and package
140
+
build-docs # build the docs
141
+
build-docs-html # build html documentation
142
+
build-docs-pdf # build pdf documentation
143
+
check # run all static checks
144
+
check-all # run all checks including doc link staleness (slow)
145
+
check-docs # lint the documentation
146
+
check-docs-links # check the documentation links for broken links
147
+
check-format # check if the code needs formatting
148
+
check-lint # lint the code
149
+
check-package # run package checks
150
+
check-readme # check that the readme renders
151
+
check-types # run all static type checking
152
+
check-types-isolated # run all static type checking in an isolated environment
153
+
check-types-mypy *RUN_ARGS # run static type checking with mypy
154
+
check-types-pyright *RUN_ARGS # run static type checking with pyright
155
+
clean # remove all non repository artifacts
156
+
clean-docs # remove doc build artifacts-
157
+
clean-env # remove the virtual environment
158
+
clean-git-ignored # remove all git ignored files
159
+
coverage # generate the test coverage report
160
+
debug-test *TESTS # debug an test
161
+
docs # build and open the documentation
162
+
docs-live # serve the documentation, with auto-reload
163
+
fetch-refs LIB # get the intersphinx references for the given library
164
+
fix # fix formatting, linting issues and import sorting
165
+
format # format the code and sort imports
166
+
install *OPTS # update and install development dependencies
0 commit comments