Opened 2 years ago

Last modified 2 days ago

#34479 new Cleanup/optimization

Support "watchfiles" in the autoreloader

Reported by: Tom Forbes Owned by:
Component: Utilities Version: 4.2
Severity: Normal Keywords:
Cc: Ülgen Sarıkavak, Evstifeev Roman, şuayip üzülmez, Adam Johnson Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As per https://forum.djangoproject.com/t/the-future-of-the-watchman-autoreloader/19973, I believe we should drop support for the pywatchman autoreloader backend and switch to watchfiles. The current pywatchman implementation is broken.

This should make it a bit easier to test, and the implementation seems like it will be simpler than our watchman implementation.

Change History (15)

comment:1 by David Sanders, 2 years ago

Triage Stage: UnreviewedAccepted
Type: New featureCleanup/optimization

Cool 👍 Looks like a fair bit of support from the community to improve it, just need to determine what the improvement is?

Are you going to assign yourself Tom?

comment:2 by David Sanders, 2 years ago

Owner: nobody removed
Status: assignednew

comment:3 by Anvansh Singh, 2 years ago

Seems like Tom already has a PR for it (https://github.com/django/django/pull/16747). But I don't think much work has been done on it in the past month. Anyways, I would like to work on this one if Tom isn't already working on it.

comment:4 by Ülgen Sarıkavak, 19 months ago

Cc: Ülgen Sarıkavak added

comment:5 by Mariusz Felisiak, 19 months ago

Ülgen, Can I ask why you added yourself to CC in hundreds of tickets in the last way days? You can use a django-updates mailing list or follow the timeline to track updates on all tickets.

in reply to:  5 ; comment:6 by Ülgen Sarıkavak, 19 months ago

Replying to Mariusz Felisiak:

Ülgen, Can I ask why you added yourself to CC in hundreds of tickets in the last way days? You can use a django-updates mailing list or follow the timeline to track updates on all tickets.

Hey Maurizs. I was checking issues before the next sessions of Djangonaut Space and GSoC. According to my notes, it shouldn't be more than 50 issues so far, and I did go over almost 600 issues to select a small portion of them that interests me and the people I work with. I believe this is a proper use of the CC feature, but if it is creating notifications for all those other people and there is no way to deactivate it on my end, I'll be more careful about it. Thanks for the comment and the direction.

Last edited 19 months ago by Ülgen Sarıkavak (previous) (diff)

in reply to:  6 comment:7 by Mariusz Felisiak, 19 months ago

Replying to Ülgen Sarıkavak:

According to my notes, it shouldn't be more than 50 issues so far,

120 :) I think it's more than enough for GSoC and Djangonaut space. Crossing fingers that they will be fixed by you.

comment:8 by Ülgen Sarıkavak, 19 months ago

Got it, thanks again. I'll do my best, at least for a couple of them :)

Last edited 19 months ago by Ülgen Sarıkavak (previous) (diff)

comment:9 by Ahmed Ibrahim, 13 months ago

What's the status here?

comment:10 by Ahmed Ibrahim, 12 months ago

News? and where can I build consensus? the mailing list is read only

comment:11 by Evstifeev Roman, 11 months ago

Cc: Evstifeev Roman added

comment:12 by şuayip üzülmez, 11 months ago

Cc: şuayip üzülmez added

comment:13 by Adam Johnson, 2 days ago

Cc: Adam Johnson added

I've just rounded out some issues in django-watchfiles, so I now consider it pretty stable: https://adamj.eu/tech/2025/09/22/introducing-django-watchfiles/ .

This can serve as a base for merging the feature into Django core.

It's worth noting that correct support of globbing currently relies on Python 3.13+, through pathlib.Path.full_match(). I didn't deem it feasible to backport that function for old Pythons. Since Django's current in-development version, 6.1, targets Python 3.12+, that will need figuring out - perhaps making the watchfiles reloader only work on Python 3.13+ ?

comment:14 by Ülgen Sarıkavak, 2 days ago

If we wanted to add watchfiles mention to the docs (https://docs.djangoproject.com/en/5.2/ref/django-admin/#runserver), would it be in the scope of this issue?

comment:15 by Adam Johnson, 2 days ago

We generally don't mention third-party packages in the docs, to avoid implying they're of the same quality and because such references can easily go outdated.

Note: See TracTickets for help on using tickets.
Back to Top