django-stubs icon indicating copy to clipboard operation
django-stubs copied to clipboard

Django Google Summer of Code 2024

Open adamchainz opened this issue 1 year ago • 11 comments

Like last year (#1337), Django is doing GSoC again and django-stubs is on the list of potential projects.

It actually remained there because it was just copied from last year’s wiki page, with two projects that I think are now irrelevant:

  1. Mypy strict-mode support - the stubs should be mostly(?) strict-mode compatible since #1556.
  2. Merging django-types back in - somewhat covered by supporting other checkers in #1628, and hard to merge further due to continued drift.

So I just deleted those projects from the wiki page and added a generic one, Expand django-stubs coverage, which would cover any proposal for clearing some of the entries from the stubtest TODO files.

Other maintainers and regular contributors, do you think this is okay? Would you be willing to mentor, and do you have any other possible projects?

adamchainz avatar Mar 15 '24 20:03 adamchainz

@adamchainz thank you very much for creating this issue (I was the one who got interested in those project ideas from last year). I was wondering how you produced the allowlist_todo.txt and allowlist_todo_django50.txt files.

nebiyuelias1 avatar Mar 17 '24 12:03 nebiyuelias1

They are produced by the stubtest tool. Read the relevant part of the contributing guide and try run it yourself locally.

adamchainz avatar Mar 17 '24 13:03 adamchainz

I won't participate in GSoC ever again: https://developers.google.com/open-source/gsoc/faq?hl=en#are_participants_from_ukraine_russia_or_belarus_allowed_to_participate_in_gsoc_2024

But, I have no problem with other contributors / maintainers participating :)

sobolevn avatar Mar 17 '24 20:03 sobolevn

Can anyone please explain to me why the stubtest reports a lot of errors when I run it locally whereas the github action seems to be showing green(all went well I suppose)? I was also wondering why the the number of errors decreases when I remove an entry from the allowlist_todo.txt file? I was expecting the opposite.

nebiyuelias1 avatar Mar 18 '24 13:03 nebiyuelias1

It depends on how you install your stub package (see https://github.com/typeddjango/django-stubs/blob/f92821a3f55f95854a1b1802d5077ced9b5d205d/.github/workflows/test.yml#L34) and how you set your MYPYPATH (see https://github.com/typeddjango/django-stubs/blob/f92821a3f55f95854a1b1802d5077ced9b5d205d/scripts/stubtest.sh#L7)

Does it help? Feel free to send a PR with fixes to CONTRIBUTING.md :)

sobolevn avatar Mar 18 '24 14:03 sobolevn

@sobolevn After creating a git ignored venv, I used the same command as in django-stubs/.github/workflows/test.yml to install the requirements. I'm not sure what's the correct value for MYPYPATH env variable (I didn't modify it). Could it be because of my python version? I'm using 3.10.

nebiyuelias1 avatar Mar 18 '24 14:03 nebiyuelias1

You're probably experiencing a common stubtest issue with caching. Try deleting .mypy_cache between stubtest runs.

btw: this issue isn't a good place for discussing such specific problems -- but we don't really have a good place. Maybe we should reconsider opening GitHub Discussions for the project.

intgr avatar Mar 18 '24 15:03 intgr

Oh so sorry, for spamming and abusing this issue! It's just because I'm new to this repo.

nebiyuelias1 avatar Mar 18 '24 15:03 nebiyuelias1

What are your thoughts on putting pyright compatiblity in there as one of the main goals?

jorenham avatar Mar 21 '24 11:03 jorenham

@jorenham this is a good project, yes! You would need to find some other mentor among django-stubs maintainers, though :)

sobolevn avatar Mar 21 '24 12:03 sobolevn

This also relates to https://github.com/sbdchd/django-types/issues/207, I'll try to find some time working on this in the next couple weeks. I'll be attending DjangoCon Europe in June as well, maybe I'll find some time to work on it there

Viicos avatar Mar 21 '24 13:03 Viicos