Re: [Django] #30479: Autoreloader with StatReloader doesn't track changes in manage.py.

2019-05-28 Thread Django
#30479: Autoreloader with StatReloader doesn't track changes in manage.py.
-+--
 Reporter:  Keryn Knight |Owner:  Tom Forbes
 Type:  Bug  |   Status:  closed
Component:  Utilities|  Version:  2.2
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:  autoreload   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by Mariusz Felisiak ):

 In [changeset:"5bf2c87ece216b00a55a6ec0d6c824c9edabf188" 5bf2c87e]:
 {{{
 #!CommitTicketReference repository=""
 revision="5bf2c87ece216b00a55a6ec0d6c824c9edabf188"
 [2.2.x] Fixed #30479 -- Fixed detecting changes in manage.py by
 autoreloader when using StatReloader.

 Regression in c8720e7696ca41f3262d5369365cc1bd72a216ca.

 Backport of b2790f74d4f38c8b297b7c1cef6875d2378f6fa6 from master
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.189af95717870805d2116914d3f26d7f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30479: Autoreloader with StatReloader doesn't track changes in manage.py.

2019-05-28 Thread Django
#30479: Autoreloader with StatReloader doesn't track changes in manage.py.
-+--
 Reporter:  Keryn Knight |Owner:  Tom Forbes
 Type:  Bug  |   Status:  closed
Component:  Utilities|  Version:  2.2
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:  autoreload   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Changes (by Mariusz Felisiak ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"b2790f74d4f38c8b297b7c1cef6875d2378f6fa6" b2790f74]:
 {{{
 #!CommitTicketReference repository=""
 revision="b2790f74d4f38c8b297b7c1cef6875d2378f6fa6"
 Fixed #30479 -- Fixed detecting changes in manage.py by autoreloader when
 using StatReloader.

 Regression in c8720e7696ca41f3262d5369365cc1bd72a216ca.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.3c7cbfb44d1a7ba8853090819a685448%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30479: Autoreloader with StatReloader doesn't track changes in manage.py.

2019-05-27 Thread Django
#30479: Autoreloader with StatReloader doesn't track changes in manage.py.
-+--
 Reporter:  Keryn Knight |Owner:  Tom Forbes
 Type:  Bug  |   Status:  assigned
Component:  Utilities|  Version:  2.2
 Severity:  Release blocker  |   Resolution:
 Keywords:  autoreload   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by Tom Forbes):

 Patch: https://github.com/django/django/pull/11422

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.c040ccaa6bf03fff8d69e7e45b6da480%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30479: Autoreloader with StatReloader doesn't track changes in manage.py.

2019-05-27 Thread Django
#30479: Autoreloader with StatReloader doesn't track changes in manage.py.
-+--
 Reporter:  Keryn Knight |Owner:  Tom Forbes
 Type:  Bug  |   Status:  assigned
Component:  Utilities|  Version:  2.2
 Severity:  Release blocker  |   Resolution:
 Keywords:  autoreload   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Changes (by Tom Forbes):

 * has_patch:  0 => 1


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.5c35d4fe8eae97583cdd671ac15065f2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30479: Autoreloader with StatReloader doesn't track changes in manage.py.

2019-05-23 Thread Django
#30479: Autoreloader with StatReloader doesn't track changes in manage.py.
-+--
 Reporter:  Keryn Knight |Owner:  Tom Forbes
 Type:  Bug  |   Status:  assigned
Component:  Utilities|  Version:  2.2
 Severity:  Release blocker  |   Resolution:
 Keywords:  autoreload   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by felixxm):

 np, Tom, thanks for info.

 Keryn, it looks that you've already made most of the work. Would you like
 to prepare a patch?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.1386c006d1ca364c417fff4628bdf778%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30479: Autoreloader with StatReloader doesn't track changes in manage.py.

2019-05-23 Thread Django
#30479: Autoreloader with StatReloader doesn't track changes in manage.py.
-+--
 Reporter:  Keryn Knight |Owner:  Tom Forbes
 Type:  Bug  |   Status:  assigned
Component:  Utilities|  Version:  2.2
 Severity:  Release blocker  |   Resolution:
 Keywords:  autoreload   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by Tom Forbes):

 I'm sorry for assigning it to myself Mariusz, I intended to work on it on
 Tuesday but work overtook me and now I am travelling for a wedding this
 weekend. So I doubt it I'm afraid.

 It seems Keryn's debugging is a great help, it should be somewhat simple
 to add special case handling for `__main__`, while `__spec__` is `None` we
 can still get the filename and watch on that.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.6f7edbc405d0ce7ef255e9d367440c65%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30479: Autoreloader with StatReloader doesn't track changes in manage.py.

2019-05-23 Thread Django
#30479: Autoreloader with StatReloader doesn't track changes in manage.py.
-+--
 Reporter:  Keryn Knight |Owner:  Tom Forbes
 Type:  Bug  |   Status:  assigned
Component:  Utilities|  Version:  2.2
 Severity:  Release blocker  |   Resolution:
 Keywords:  autoreload   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by felixxm):

 Tom, will you have time to work on this in the next few days?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.209f0ff2f923c66e8dcba48db2cc3c0d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30479: Autoreloader with StatReloader doesn't track changes in manage.py.

2019-05-17 Thread Django
#30479: Autoreloader with StatReloader doesn't track changes in manage.py.
-+--
 Reporter:  Keryn Knight |Owner:  Tom Forbes
 Type:  Bug  |   Status:  assigned
Component:  Utilities|  Version:  2.2
 Severity:  Release blocker  |   Resolution:
 Keywords:  autoreload   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by Keryn Knight):

 Done a touch of debugging:
 - `iter_modules_and_files` is where it gets lost.
 Specifically, it ends up in there twice:

 {{{
 (,
  ,
  ,
  ...,)
 }}}

 But `getattr(module, "__spec__", None) is None` is `True` so it continues
 onwards. I thought I managed to get one of them to have a `__spec__` attr
 but no `has_location`, but I can't seem to get that again (stepping around
 with pdb)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.a4d914c6810119c52ce229e83e5f455a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30479: Autoreloader with StatReloader doesn't track changes in manage.py.

2019-05-17 Thread Django
#30479: Autoreloader with StatReloader doesn't track changes in manage.py.
-+--
 Reporter:  Keryn Knight |Owner:  Tom Forbes
 Type:  Bug  |   Status:  assigned
Component:  Utilities|  Version:  2.2
 Severity:  Release blocker  |   Resolution:
 Keywords:  autoreload   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Changes (by Tom Forbes):

 * owner:  nobody => Tom Forbes
 * status:  new => assigned


Comment:

 Argh. I guess this is because `manage.py` isn't showing up in the
 `sys.modules`. I'm not sure I remember any specific manage.py handling in
 the old implementation, so I'm not sure how it used to work, but I should
 be able to fix this pretty easily.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.e6f247c45de71cd0d69b6a0dfebf83de%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30479: Autoreloader with StatReloader doesn't track changes in manage.py. (was: Auto-reloading with StatReloader may not track changes to the main entrypoint?)

2019-05-17 Thread Django
#30479: Autoreloader with StatReloader doesn't track changes in manage.py.
-+
 Reporter:  Keryn Knight |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Utilities|  Version:  2.2
 Severity:  Release blocker  |   Resolution:
 Keywords:  autoreload   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by felixxm):

 * cc: Tom Forbes (added)
 * component:  Core (Management commands) => Utilities
 * stage:  Unreviewed => Accepted
 * severity:  Normal => Release blocker


Old description:

> This is a bit convoluted, but here we go.
>
> Environment (OSX 10.11):
> {{{
> $ python -V
> Python 3.6.2
> $ pip -V
> pip 19.1.1
> $ pip install Django==2.2.1 django-microscope==0.1.1
> Requirement already satisfied: Django==2.2.1 in ./lib/python3.6/site-
> packages (2.2.1)
> Requirement already satisfied: django-microscope==0.1.1 in
> ./lib/python3.6/site-packages (0.1.1)
> Requirement already satisfied: sqlparse in ./lib/python3.6/site-packages
> (from Django==2.2.1) (0.3.0)
> Requirement already satisfied: pytz in ./lib/python3.6/site-packages
> (from Django==2.2.1) (2019.1)
> Requirement already satisfied: django-environ>=0.4.4 in ./lib/python3.6
> /site-packages (from django-microscope==0.1.1) (0.4.5)
> }}}
>
> 
>
> Create a file, `manage.py`:
> {{{
> # -*- coding: utf-8 -*-
> from __future__ import unicode_literals, absolute_import
> from microscope import run, routes
>

> @routes.path("")
> def index(request, *, x=None):
> return None
>

> application = run(
> DEBUG=True,
> INSTALLED_APPS=(),
> ROOT_URLCONF=routes,
> ALLOWED_HOSTS=["127.0.0.1"],
> LOGGING={
> "version": 1,
> "disable_existing_loggers": False,
> "handlers": {"console": {"class": "logging.StreamHandler"}},
> "loggers": {
> "django.utils.autoreload": {
> "handlers": ["console"],
> "level": "DEBUG",
> "propagate": True,
> }
> },
> },
> )
> }}}
>
> Then do:
> {{{
> $ python manage.py runserver 127.0.0.1:8080
> }}}
>
> and it should boot like normal. So far so good.
>
> 
>
> Steps to reproduce:
> - Edit `the manage.py` file. Just change the `ALLOWED_IPS` setting or
> whatever.
>
> Under 2.1.8 (and prior), this will trigger the auto-reloading mechanism.
> Under 2.2.1, it won't. As far as I can tell from the
> `django.utils.autoreload` log lines, it never sees the `manage.py`
> itself.

New description:

 This is a bit convoluted, but here we go.

 Environment (OSX 10.11):
 {{{
 $ python -V
 Python 3.6.2
 $ pip -V
 pip 19.1.1
 $ pip install Django==2.2.1
 }}}

 Steps to reproduce:
 - Run a server `python manage.py runserver`
 - Edit the `manage.py` file, e.g. add `print()`:
 {{{
 def main():
 print('sth')
 os.environ.setdefault('DJANGO_SETTINGS_MODULE',
 'ticket_30479.settings')
 ...
 }}}

 Under 2.1.8 (and prior), this will trigger the auto-reloading mechanism.
 Under 2.2.1, it won't. As far as I can tell from the
 `django.utils.autoreload` log lines, it never sees the `manage.py` itself.

--

Comment:

 Thanks for the report. I simplified scenario.

 Regression in c8720e7696ca41f3262d5369365cc1bd72a216ca.
 Reproduced at 8d010f39869f10782042163417298d1c5bb9.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.df5ccb91dcf0243eb0c1a77522a847a3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.