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

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

Comment (by Aymeric Augustin):

 Thanks Carlton.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.7fdd4e85cb17b96eb36a3adfd02e8110%40djangoproject.com.


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

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

 * status:  assigned => closed


Comment:

 OK, sorry, having looked again at this, I just can't see that the extra
 code in `django.setup()` merits the change.

 TBH in 10+ years of using Django I've never seen an actual issue here.
 Maybe `py.test` runs into them, but it seems to me that it would be easy
 enough to put required locking code outside of the `setup()` in whatever
 bootstrap script is in play.

 As it is, `setup()` is simple and straight-forward. With the proposed
 changes it's anything but. Given that, and the lack of consensus as
 whether, and even why, we should address this, I'm going to say `wontfix`.
 On assessment I think addressing this is putting the cart before the
 horse.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.37f532a8307d04c35543d7cdbdc373c1%40djangoproject.com.


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

2019-08-17 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:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by pascal chambon):

 * needs_better_patch:  1 => 0
 * 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.dec6a8bfd62febdc0e0e2333f55b158f%40djangoproject.com.


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.