Re: [Django] #28752: Prevent django.setup() from running multiple times

2019-06-13 Thread Django
#28752: Prevent django.setup() from running multiple times
-+-
 Reporter:  pascal chambon   |Owner:  pascal
 Type:   |  chambon
  Cleanup/optimization   |   Status:  assigned
Component:  Core (Other) |  Version:  1.11
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by pascal chambon):

 * status:  new => assigned
 * owner:  nobody => pascal chambon


Comment:

 OK a few tweaks and bugfixes later, this PR seems now ready to me  B-)  ->
 https://github.com/django/django/pull/11440

-- 
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/063.a2df3e5ad9083721b6278cf60c665b74%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28752: Prevent django.setup() from running multiple times

2019-06-10 Thread Django
#28752: Prevent django.setup() from running multiple times
--+
 Reporter:  pascal chambon|Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  Core (Other)  |  Version:  1.11
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+

Comment (by pascal chambon):

 The latest version protects setup with a threading lock, so that
 idempotence gets enforced even in multithreaded lazy-loading contexts.

-- 
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/063.e8bd65363a1a97499131b802b7bd5748%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28752: Prevent django.setup() from running multiple times

2019-06-03 Thread Django
#28752: Prevent django.setup() from running multiple times
--+
 Reporter:  pascal chambon|Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  Core (Other)  |  Version:  1.11
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+

Comment (by pascal chambon):

 OK let's handle 1 feature at a time  :)

 Here is the PR only for idempotence (and django.is_ready flag) :
 https://github.com/django/django/pull/11440

 One of the CI checks failed for obscure reasons (package django not
 found), any easy way to restart it ?

-- 
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/063.ac784c35a676c8481f622409c6fe86df%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28752: Prevent django.setup() from running multiple times

2019-06-03 Thread Django
#28752: Prevent django.setup() from running multiple times
--+
 Reporter:  pascal chambon|Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  Core (Other)  |  Version:  1.11
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Carlton Gibson):

 * needs_better_patch:  0 => 1


Comment:

 Looking at the PR, there are two things going on there:

 1. Making `setup()` ''idempotent''. Let's handle that part here.
 2. Allowing specifying custom logic. Let's handle that on #30536.

 (The one looks less controversial than the other...)

 Pascal, if you could split the PR into two, targeting the one as `Fixed
 #28752 -- ...` that would be great.

-- 
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/063.a399c13c4b3804797fb4eb8397b7213a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28752: Prevent django.setup() from running multiple times

2019-06-03 Thread Django
#28752: Prevent django.setup() from running multiple times
--+
 Reporter:  pascal chambon|Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  Core (Other)  |  Version:  1.11
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by Carlton Gibson):

 Let's keep the discussion from #30536 here. (It's ≈the same ticket AFAICS,
 and the history here is informative.)

 [https://github.com/django/django/pull/11435 PR there is here].

 One additional element added there is to make the the `setup()` code
 ''pluggable''. (i.e. whilst we make `setup()` exit if run multiple times,
 allow user code to be run before/after as well.) A setting is proposed for
 this. ''MUST it be a setting…?''

-- 
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/063.307296b0b80c926d0c32c17e77b1cd12%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28752: Prevent django.setup() from running multiple times

2019-06-01 Thread Django
#28752: Prevent django.setup() from running multiple times
--+
 Reporter:  pascal chambon|Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  Core (Other)  |  Version:  1.11
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by pascal chambon):

 Thanks for reminding me of this ticket, my latest struggles with pytest-
 django made me think a more global solution to the problem of django setup
 and complex environments, and this ticket is for me now superseded by
 https://code.djangoproject.com/ticket/30536 - hoping that the new setting
 I introduce will be OK too.

-- 
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/063.e3201b02745aa1ad23340f02845d5b17%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28752: Prevent django.setup() from running multiple times

2019-05-30 Thread Django
#28752: Prevent django.setup() from running multiple times
--+
 Reporter:  pascal chambon|Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  Core (Other)  |  Version:  1.11
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by Daniel Hahler):

 This would be nice to have indeed.

 Pascal, do you plan to provide a patch for this?

 btw: the following can be used as a workaround (also used by pytest-
 django):
 {{{
 import django.apps

 if not django.apps.apps.ready:
 django.setup()
 }}}

-- 
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/063.aa7d38b0cb9868b346a9fa8fee8bda18%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28752: Prevent django.setup() from running multiple times (was: django.setup() should not be runnable multiple times)

2017-12-27 Thread Django
#28752: Prevent django.setup() from running multiple times
--+
 Reporter:  pascal chambon|Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  Core (Other)  |  Version:  1.11
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Tim Graham):

 * type:  Bug => Cleanup/optimization
 * stage:  Unreviewed => Accepted


Comment:

 I'm not completely sure if a change is feasible but I guess we could
 evaluate 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/063.86c8be4bc2817c3027b7fe7995f5883e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.