Commit Graph

93 Commits

Author SHA1 Message Date
Nikita Sobolev
0bb1182c42 Fix CI (#1108)
* Fix CI

* Fix CI

* Fix CI

* Fix CI

* APply black

* APply black

* Fix mypy

* Fix mypy errors in django-stubs

* Fix format

* Fix plugin

* Do not patch builtins by default

* Fix mypy

* Only run mypy on 3.10 for now

* Only run mypy on 3.10 for now

* WHAT THE HELL

* Enable strict mode in mypy

* Enable strict mode in mypy

* Fix tests

* Fix tests

* Debug

* Debug

* Fix tests

* Fix tests

* Add TYPE_CHECKING debug

* Caching maybe?

* Caching maybe?

* Try explicit `${{ matrix.python-version }}`

* Remove debug

* Fix typing

* Finally
2022-08-26 13:22:55 +03:00
sobolevn
f4378112bb Release django-stubs and django-stubs-ext 2022-06-17 17:02:26 +03:00
Anders Kaseorg
24a3b22c60 Move mypy version upper bound to a [compatible-mypy] extra (#979)
* Move mypy version upper bound to a [compatible-mypy] extra

Due to a bug in mypy 0.940 (#870), we made two changes in #871:

• pinned mypy==0.931 in requirements.txt (for running our tests);
• bounded mypy<0.940 in setup.py (for downstream users).

After the mypy bug was quickly fixed upstream in 0.941, our setup.py
bound has been repeatedly raised but not removed (#886, #939, #973).
The only changes in those commits have been to the precise wording of
error messages expected in our tests.  Those wording changes don’t
impact compatibility for downstream users, so it should be safe to go
back to allowing them to upgrade mypy independently.

Since mypy doesn’t yet guarantee backwards compatibility in the plugin
API (although in practice it has rarely been an issue), add a
django-stubs[compatible-mypy] extra for users who prefer a known-good
version of mypy even if it’s a little out of date.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>

* Update setup.py

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-06-05 00:08:00 +03:00
Damian Zaremba
2351051ef1 Upgrade mypy support to 0.960 (#973)
- Updates test_model_field_classes_from_existing_locations to account
  for the behaviour change in https://github.com/python/mypy/pull/12663
- Bumps the version of django-stubs for a new release
2022-05-26 01:20:44 +03:00
Maksim Kurnikov
4a90ad9edc bump version to 1.11.0 (#961) 2022-05-24 11:22:43 +02:00
Damian Zaremba
2ef7ff3309 Bump mypy 0.950 (#939)
* Bump mypy to 0.95x

* Remove the * for inferred types

There was an upstream change (https://github.com/python/mypy/pull/12459)
to remove * from inferred types in the reveal_type output.

As we are asserting the * to exist, all the test cases are now failing
on the 0.950 release. Removing the expected * to mirror the upstream
behaviour change should resolve the test failures.
2022-04-29 14:44:33 +03:00
Nikita Sobolev
2dad9228eb Switch to setuptools (#911) 2022-04-06 13:02:56 +03:00
sobolevn
4e3f9d6f06 Version 0.10.1 release 2022-03-28 16:09:09 +03:00
henribru
aa5f114575 Remove Python 3.6 trove classifier (#887) 2022-03-26 14:40:24 +03:00
Nikita Sobolev
3c58270a78 Version 1.10.0 release (#886)
* Version 1.10.0 release

* Fixes CI

* Fixes CI
2022-03-26 09:22:13 +03:00
Himanshu Balasamanta
f9f6c827c1 Fixes #870 (#871)
* Fixes #870

Signed-off-by: Himanshu-Balasamanta <himanshubb.eee18@itbhu.ac.in>

* Updated mypy version in setup.py to == 0.931

* Update setup.py

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-03-14 21:17:53 +03:00
sobolevn
5bbe353e92 Add FUNDING.yml and drop python3.6 2022-01-17 15:00:27 +03:00
Aleksander Vognild Burkow
27e5908762 Update project to use mypy 931 (#819) 2022-01-17 14:58:16 +03:00
Gergely Kalmár
c65e2c48db Add typing to mypy plugin (#804) 2022-01-05 16:21:14 +03:00
Nikita Sobolev
02a39f722d Replace toml with tomli (#787)
* Replace `toml` with `tomli`

* Replace `toml` with `tomli`
2021-12-16 22:19:34 +03:00
sobolevn
d6ccecdd73 Version 1.9.0 release 2021-09-04 11:33:39 +03:00
sobolevn
321284ac62 Version 1.9.0 release 2021-09-04 11:31:11 +03:00
Nikita Sobolev
552f2ffc0c Adds more rules to mypy config, related #662 (#663)
* Adds more rules to mypy config, related #662

* Removes plugin.ini for mypy settings

* Fixes build
2021-07-04 15:41:51 +03:00
Cesar Canassa
397e3f3dac Adds support for pyproject.toml files (#639)
* Adds support for pyproject.toml files

Since mypy 0.900 the pyproject.toml files are supported.

This PR adds a support for it. It searchs for a `tool.django-stubs` section. This is an example configuration:

```
[tool.django-stubs]
django_settings_module = "config.settings.local"
```

Fixes #638

* Added TOML tests

* Use textwrap.dedent instead of trying to manually replace spaces
2021-06-15 01:50:31 +03:00
Maarten ter Huurne
8c387e85fe Allow Collection for 'fields' and 'exclude' of form model helpers (#637) (#640)
* Allow Collection for 'fields' and 'exclude' of form model helpers (#637)

There are several functions and classes in `django.forms.models` that
take a `fields` or `exclude` argument. Previously, `Sequence` was used
to annotate these, but the code of Django (I checked version 3.2.4)
doesn't require `__getitem__()` to be implemented, so requiring
`Collection` instead is sufficient.

The practical advantage of requiring `Collection` is that a set, such
as the key set of a dictionary, can be passed without first having to
convert it to a list or tuple.

* Pin mypy to below version 0.900

* Remove Callable for 'fields' and 'exclude' of form model helpers

I cannot find any support for callables for these two arguments in
the code or in the documentation.

* Update setup.py

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2021-06-12 01:21:42 +03:00
Cesar Canassa
77f9926ce1 fix tests for mypy 0.900 (#641) 2021-06-12 01:05:46 +03:00
sobolevn
488d17b65c django-stubs-ext@0.2.0 2021-04-14 12:59:57 +03:00
sobolevn
3cca71a58f Version 1.8.0 release 2021-04-12 13:12:19 +03:00
proxy
0c41d0c6e9 create monkeypatching function for adding get_item dunder (#526)
* run black

* create monkeypatching function for adding get_item dunder

* whoops i forgot the test

* change the name in INSTALLED_APPS to make test pass

* turn the whole thing into a proper package

* move django_stubs_ext to requirements.txt

* also install requirements.txt

* attempt to fix pre-commit

* numerous small code review fixes

* fix dependency issues

* small dependency fixes

* configure proper license file location

* add the rest of the monkeypatching

* use strict mypy

* update contributing with a note monkeypatching generics

* copy release script from parent package
2020-11-11 10:04:13 +03:00
Na'aman Hirschfeld
44151c485d updated package setup (#485)
* updated package setup

* updated to use python 3.9

* fixed test runner

* fixed typecheck tests

* fixed discrepencies

* added override to runner

* updated travis

* updated pre-commit hooks

* updated dep
2020-10-29 11:59:48 +03:00
sobolevn
cb1fa08a82 Version 1.7.0 released 2020-10-28 11:41:15 +03:00
Nikita Sobolev
40c8bfa510 Update migration.pyi (#501)
* Update migration.pyi

* Fixes tests

* Fixes tests

* Fixes tests
2020-10-26 11:43:47 +03:00
sobolevn
645ee97e78 Release 1.6.0 2020-10-01 10:57:05 +03:00
Kacper
b1d619edb2 Bumped required Mypy version to newest in requirements (#414)
* pytest-mypy-plugins package newer version

* Revert "pytest-mypy-plugins package newer version"

This reverts commit 871347a86577a5dad867bc751689bbc06d2bcae0.

* update tests ignores for django

* Revert "update tests ignores for django"

This reverts commit 93fc66e311af62cf8cf5b79a72ab723bf3cf060a.

* changed required mypy version to the newest

Co-authored-by: Kacper Szmigiel <szmigielkacper@gmai.com>
2020-07-06 10:34:17 +03:00
Nikita Sobolev
3d2534ea8d Closes #392 2020-06-08 10:55:30 +03:00
Kacper
4c5723d368 WIP Issue 388 (#390)
* updated mypy dependency

* update readme

* readme update v2

* pytest-mypy-plugins newer version

* updated pytest_mypy_plugins name

* update ignored errors for typechecking django test suite

Co-authored-by: Kacper Szmigiel <szmigielkacper@gmai.com>
2020-06-06 11:35:51 +03:00
Ville Skyttä
6f5a39625e Add release notes project URL (#365)
Background info at https://github.com/pypa/warehouse/pull/7882
2020-05-05 18:38:11 +03:00
Maxim Kurnikov
1af3a12f2c bump to 1.5.0 2020-03-15 00:59:58 +03:00
Marti Raudsepp
7af89ee6a6 Update to mypy 0.770 (#341) 2020-03-13 16:45:45 +03:00
Maxim Kurnikov
998b659749 bump to 1.4.0 2019-12-18 00:03:29 +03:00
Maxim Kurnikov
d666ecd36f update dev deps, mypy to 0.760 2019-12-17 23:50:50 +03:00
Maxim Kurnikov
3c3dfcbc9f bump to 1.3.3 2019-12-17 19:20:27 +03:00
Maxim Kurnikov
f7e1cfc6c7 bump to 1.3.2 2019-12-13 23:55:08 +03:00
Maxim Kurnikov
0cba3f9fd6 bump to 1.3.1 2019-12-12 08:03:47 +03:00
Maxim Kurnikov
540e28f4c6 bump version to 1.3.0 2019-12-06 23:37:19 +03:00
Konstantin Alekseev
cbc7159995 Support mypy 0.750 2019-11-30 13:39:28 +03:00
Maksim Kurnikov
287c64d6fb Pin to 0.740 and fix CI (#225)
* update django sources

* pin mypy version, update to 0.740

* fix tests typechecking

* fix lint
2019-11-12 05:17:36 +03:00
Maxim Kurnikov
db9ff6aaf6 Fix crash if model from same app referenced in RelatedField cannot be resolved (#199)
* do not crash if model from same app refd in ForeignKey cannot be resolved

* bump to 1.2.0
2019-10-05 20:00:51 +03:00
Maxim Kurnikov
be3fc259d5 fix compatibility with 0.730 (#189) 2019-09-28 05:23:55 +03:00
Maxim Kurnikov
de4fa92441 bump to 1.1.0 2019-08-24 18:40:57 +03:00
Maxim Kurnikov
dddcb20fe4 bump version to 1.0.2 2019-07-26 22:22:22 +03:00
Maxim Kurnikov
6b21a0476d Remove psycopg2 from dependencies (#117)
* remove psycopg2 from direct dependencies, only add it in tests

* bump to 1.0.1

* fix mypy
2019-07-26 18:39:42 +03:00
Maxim Kurnikov
6466c57c69 update setup.py 2019-07-25 17:28:39 +03:00
Maxim Kurnikov
64049b60b0 add missing psycopg2 dependency 2019-07-24 22:54:12 +03:00
Maxim Kurnikov
b6a5ccabdf move configuration to [mypy.plugins.django-stubs] inside mypy config file 2019-07-24 22:32:52 +03:00