Re: App-loading reloaded

2014-01-13 Thread Aymeric Augustin
This happens whenever a test app is renamed or removed. It's related to how runtests.py performs discovery. -- Aymeric. 2014/1/13 Michael Manfre > Git clean -fdx > > I had the same problem the other day. > On Jan 13, 2014 7:51 AM, "Josh Smeaton" wrote: > >> Hey Aymeric, >> >> I've just merge

Re: App-loading reloaded

2014-01-13 Thread Josh Smeaton
Perfect, that did the trick, thanks - Josh On Tuesday, 14 January 2014 00:25:38 UTC+11, Michael Manfre wrote: > > Git clean -fdx > > I had the same problem the other day. > On Jan 13, 2014 7:51 AM, "Josh Smeaton" > > wrote: > >> Hey Aymeric, >> >> I've just merged master back into a branch I'm w

Re: App-loading reloaded

2014-01-13 Thread Michael Manfre
Git clean -fdx I had the same problem the other day. On Jan 13, 2014 7:51 AM, "Josh Smeaton" wrote: > Hey Aymeric, > > I've just merged master back into a branch I'm working on, and I'm seeing > the following error when trying to run the django test suite: > > (django)smeatonj ~/Development/repo

Re: App-loading reloaded

2014-01-13 Thread Josh Smeaton
Hey Aymeric, I've just merged master back into a branch I'm working on, and I'm seeing the following error when trying to run the django test suite: (django)smeatonj ~/Development/repos/django/tests $ PYTHONPATH=..:$PYTHONPATH ./runtests.py Testing against Django installed in '/Users/smeatonj/

Re: App-loading reloaded

2014-01-01 Thread Aymeric Augustin
On 23 déc. 2013, at 22:50, Aymeric Augustin wrote: > With reference to my original list, I’ve reached goals 1, 2, 6 and 7, with > the caveat that I still have to write documentation. As you may have noticed, I’ve added a few more features during the past week, as well as lots of cleanup. Her

Re: App-loading reloaded

2013-12-31 Thread Jannis Leidel
On 23.12.2013, at 22:50, Aymeric Augustin wrote: > The time frame I had allocated to this project expires tomorrow. With > reference to my original list, I’ve reached goals 1, 2, 6 and 7, with the > caveat that I still have to write documentation. > > I ran out of time before looking serious

Re: App-loading reloaded - running code at startup

2013-12-31 Thread Marc Tamlyn
I'd also suggest that the ORM is only disallowed until such as time as the models are set up - we require Queryset creation at module level in forms for example. Obviously your models.py should not import your forms.py, but that's another issue. On 31 December 2013 10:31, Anssi Kääriäinen wrote:

Re: App-loading reloaded - running code at startup

2013-12-31 Thread Anssi Kääriäinen
On 12/31/2013 12:13 PM, Aymeric Augustin wrote: On 31 déc. 2013, at 10:40, Anssi Kääriäinen wrote: Another solution is to prevent generation of QuerySets before models are fully loaded. I think Django does that since I removed the re-entracy hack in Apps.populate(). get_models() now raises

Re: App-loading reloaded - running code at startup

2013-12-31 Thread Aymeric Augustin
On 31 déc. 2013, at 10:46, Anssi Kääriäinen wrote: > A question: what happens if you have multiple name = "django.contrib.auth" > AppConfigs in your project? https://code.djangoproject.com/ticket/21679 :-) -- Aymeric. -- You received this message because you are subscribed to the Google Gro

Re: App-loading reloaded - running code at startup

2013-12-31 Thread Aymeric Augustin
On 31 déc. 2013, at 10:40, Anssi Kääriäinen wrote: > Another solution is to prevent generation of QuerySets before models are > fully loaded. I think Django does that since I removed the re-entracy hack in Apps.populate(). get_models() now raises an exception until all models are fully loaded,

Re: App-loading reloaded - running code at startup

2013-12-31 Thread Anssi Kääriäinen
On 12/30/2013 11:05 PM, Aymeric Augustin wrote: On 30 déc. 2013, at 21:59, Marc Tamlyn > wrote: On another note, if you're going to muck about with a model in an existing app (perhaps for a very good reason like Permission) the best way of doing that (IMO) would b

Re: App-loading reloaded - running code at startup

2013-12-31 Thread Anssi Kääriäinen
On 12/31/2013 10:54 AM, Aymeric Augustin wrote: On 31 déc. 2013, at 05:41, Daniel Lindsley wrote: On Problem #1, IMO, I'd prefer to see something akin to an ``AppConfig.setup`` (before anything is imported or built) & an ``AppConfig.complete`` (after all classes have been setup for the

Re: App-loading reloaded - running code at startup

2013-12-31 Thread Anssi Kääriäinen
On 12/31/2013 10:41 AM, Aymeric Augustin wrote: On 31 déc. 2013, at 04:28, Russell Keith-Magee mailto:russ...@keith-magee.com>> wrote: On Mon, Dec 30, 2013 at 8:29 PM, Aymeric Augustin > wrote: Logically, this would get called when the app cache

Re: App-loading reloaded - running code at startup

2013-12-31 Thread Anssi Kääriäinen
On 12/30/2013 10:10 PM, Anssi Kääriäinen wrote: First, a big +1 for improved app-loading sequence. Problem 2: my vote for solution 2.b. This seems to be the most reliable way. Quick throwaway scripts will need two more lines of boilerplate code but that is easily worth the added reliability.

Re: App-loading reloaded - running code at startup

2013-12-31 Thread Aymeric Augustin
On 31 déc. 2013, at 05:41, Daniel Lindsley wrote: > On Problem #1, IMO, I'd prefer to see something akin to an > ``AppConfig.setup`` (before anything is imported or built) & an > ``AppConfig.complete`` (after all classes have been setup for the app). I > think this would make it clearer as

Re: App-loading reloaded - running code at startup

2013-12-31 Thread Aymeric Augustin
On 31 déc. 2013, at 04:28, Russell Keith-Magee wrote: > On Mon, Dec 30, 2013 at 8:29 PM, Aymeric Augustin > wrote: > > Logically, this would get called when the app cache is fully populated. > Running user code while the app cache isn’t ready will backfire. > > But at this point it’s too lat

Re: App-loading reloaded - running code at startup

2013-12-30 Thread Andreas Pelme
Aymeric, Your work is amazing and has improved Django so much. Your work on timezone support, the transaction overhaul and now this app changes makes my and a lot of other peoples experience with Django so much better. Thank you! 2013/12/30 Aymeric Augustin > ## Solution 2.a — Require users to

Re: App-loading reloaded - running code at startup

2013-12-30 Thread Daniel Lindsley
Aymeric, As with the others, I'd like to echo my thanks! Having spent a lot of time with the old AppCache, I think these are solid improvements. Just a couple thoughts/questions from me. On Problem #1, IMO, I'd prefer to see something akin to an ``AppConfig.setup`` (before anything i

Re: App-loading reloaded - running code at startup

2013-12-30 Thread Russell Keith-Magee
Hi Aymeric, First off - a *huge* thanks for all the work your doing on app reloading. I can't begin to express how much gratitude I have for the work you're doing here. On Mon, Dec 30, 2013 at 8:29 PM, Aymeric Augustin < aymeric.augus...@polytechnique.org> wrote: > Hello, > > There’ve been lots

Re: App-loading reloaded - running code at startup

2013-12-30 Thread Marc Tamlyn
Heh, I forgot that contribute to class isn't documented. On second thoughts, let's not document this unless we actually have a good API for it. On 30 Dec 2013 21:05, "Aymeric Augustin" wrote: > On 30 déc. 2013, at 21:59, Marc Tamlyn wrote: > > On another note, if you're going to muck about with

Re: App-loading reloaded - running code at startup

2013-12-30 Thread Aymeric Augustin
On 30 déc. 2013, at 21:59, Marc Tamlyn wrote: > On another note, if you're going to muck about with a model in an existing > app (perhaps for a very good reason like Permission) the best way of doing > that (IMO) would be to create a subclassed AppConfig, get the relevant model > from Apps in t

Re: App-loading reloaded - running code at startup

2013-12-30 Thread Aymeric Augustin
On 30 déc. 2013, at 21:51, Marc Tamlyn wrote: > doing away with the magical "I created a Model subclass and my app registry > hot populated" issues. > This is ModelBase.__new__, another scary beast I haven’t attacked yet :) -- Aymeric. -- You received this message because you are subscribed

Re: App-loading reloaded - running code at startup

2013-12-30 Thread Marc Tamlyn
On another note, if you're going to muck about with a model in an existing app (perhaps for a very good reason like Permission) the best way of doing that (IMO) would be to create a subclassed AppConfig, get the relevant model from Apps in the setup() method and modify it directly there (add fields

Re: App-loading reloaded - running code at startup

2013-12-30 Thread Marc Tamlyn
I would suggest that Anssi's issues with model loading ordering are helped best by having `django.setup()` and doing away with the magical "I created a Model subclass and my app registry hot populated" issues. The proposed solution 2a seems best to me. It has never been clear how Django initialised

Re: App-loading reloaded - running code at startup

2013-12-30 Thread Aymeric Augustin
On 30 déc. 2013, at 21:10, Anssi Kääriäinen wrote: > I have a question about problem 1: Are model imports going to be allowed from > app modules? I believe allowing this will cause problems later on. While it doesn’t seem especially useful and hardly a good practice, it’s currently possible. I

Re: App-loading reloaded - running code at startup

2013-12-30 Thread Anssi Kääriäinen
First, a big +1 for improved app-loading sequence. Problem 2: my vote for solution 2.b. This seems to be the most reliable way. Quick throwaway scripts will need two more lines of boilerplate code but that is easily worth the added reliability. I have a question about problem 1: Are model impor

Re: App-loading reloaded - running code at startup

2013-12-30 Thread Aymeric Augustin
On 30 déc. 2013, at 17:37, Ryan Hiebert wrote: > It's probably obvious to others, but where would that `django.setup()` be? import django django.setup() Since setup() couples django.apps and django.conf, putting it into the django package seemed appropriate. -- Aymeric. -- You received thi

Re: App-loading reloaded - running code at startup

2013-12-30 Thread Bas Peschier
Op maandag 30 december 2013 17:16:21 UTC+1 schreef Aymeric Augustin: > > On 30 déc. 2013, at 13:29, Aymeric Augustin > > > wrote: > > [...] > > The real question — is requiring django.setup() acceptable? Explicit is > better than implicit, after all… > > As far as I can see only people who l

Re: App-loading reloaded - running code at startup

2013-12-30 Thread Ryan Hiebert
On Mon, Dec 30, 2013 at 10:16 AM, Aymeric Augustin wrote: > The real question — is requiring django.setup() acceptable? Explicit is > better than implicit, after all… It's probably obvious to others, but where would that `django.setup()` be? -- You received this message because you are subscr

Re: App-loading reloaded - running code at startup

2013-12-30 Thread Aymeric Augustin
On 30 déc. 2013, at 13:29, Aymeric Augustin wrote: > ## Solution 2.a — Require users to call django.setup() before they use the > ORM. setup() would configure the settings and populate the app registry. > (…) > I’m currently working on this and I’ll add a commit to the pull request > (which I’

App-loading reloaded - running code at startup

2013-12-30 Thread Aymeric Augustin
Hello, There’ve been lots of brainstorming on this topic. It is now tracked in this ticket: https://code.djangoproject.com/ticket/21676. I’ve also sent a pull request: https://github.com/django/django/pull/2128. There’s a consensus on the general idea: - AppConfigs are a good place for startup

Re: App-loading reloaded

2013-12-27 Thread Aymeric Augustin
Hello, Here’s an final update on the remaining items in my TODO list. If there’s anything you want to discuss, please start a new thread, as this one is just an long monologue designed to keep a public record of what I’ve been doing. On 26 déc. 2013, at 22:47, Aymeric Augustin wrote: > I sti

Re: App-loading reloaded

2013-12-26 Thread Aymeric Augustin
Hello, All the “Must do” and "Further work” items are either done or filed as Trac tickets. I still have to work on the “Cleanup” items. Details follow, mostly for future reference. > ** Must do ** > > * Fix the test suite. There are still a few failures, apparently caused by > leaking app

Re: App-loading reloaded

2013-12-26 Thread Luc Saffre
On 26/12/13 11:47, Aymeric Augustin wrote: > On 26 déc. 2013, at 00:22, Luc Saffre wrote: > >> But your implementation is more beautiful than mine, and I'm looking >> forward to retire my djangosite project as soon as possible. > > I wouldn’t say “beautiful” as much as “minimal”. Django’s core m

Re: App-loading reloaded

2013-12-26 Thread Aymeric Augustin
Hi Luc, On 26 déc. 2013, at 00:22, Luc Saffre wrote: > On 24/12/13 12:23, Aymeric Augustin wrote: > >> Of course I’m happy to provide feedback and supervision to >> contributors who’d like to tackle some of these items. Just get in >> touch before you start coding to avoid duplicate work. > >

Re: App-loading reloaded

2013-12-25 Thread Luc Saffre
On 24/12/13 12:23, Aymeric Augustin wrote: > > Of course I’m happy to provide feedback and supervision to > contributors who’d like to tackle some of these items. Just get in > touch before you start coding to avoid duplicate work. Hey Aymeric, thanks for your work! I am not a core developer, but

Re: App-loading reloaded

2013-12-24 Thread Aymeric Augustin
On 23 déc. 2013, at 23:31, Andrew Godwin wrote: > The big question is, of course, how feasible is it that this will all* land > by the alpha? It's January 20th - less than a month away - and while I'd like > to see this land in 1.7, if it misses that date it's out; the release is > already com

Re: App-loading reloaded

2013-12-23 Thread Andrew Godwin
Thanks for your work on this, Aymeric - the reduced scope has really done well, I think. Couple of comments (I agree that generally the list of work is accurate): - There's already a MIGRATION_MODULES setting which lets you set the path to a migration module by app label. We probably just need t

Re: App-loading reloaded

2013-12-23 Thread Aymeric Augustin
The time frame I had allocated to this project expires tomorrow. With reference to my original list, I’ve reached goals 1, 2, 6 and 7, with the caveat that I still have to write documentation. I ran out of time before looking seriously at goal 3, but it appears to be within reach at this point.

Re: App-loading reloaded - custom app names in the admin

2013-12-23 Thread Aymeric Augustin
After the merge, some Selenium tests (which I don’t run locally in general) failed on Jenkins. That’s a test isolation issue: an AppDirectoriesFinder instance kept a cache of an incomplete list of applications, preventing later tests from finding static files correctly. I wanted to review the m

Re: App-loading reloaded - custom app names in the admin

2013-12-22 Thread Aymeric Augustin
Merged: https://github.com/django/django/compare/7f2485b4d180...17c66e6fe77b -- Aymeric. On 22 déc. 2013, at 12:14, Aymeric Augustin wrote: > I’ve updated the pull request with these changes as well as a few minor > comments made by reviewers. > > https://github.com/django/django/pull/208

Re: App-loading reloaded - custom app names in the admin

2013-12-22 Thread Aymeric Augustin
I’ve updated the pull request with these changes as well as a few minor comments made by reviewers. https://github.com/django/django/pull/2089 I think it’s worth merging in that state. I still have a list of about 20 things to check, but none of them is likely to change anything fundamental. -

Re: App-loading reloaded - custom app names in the admin

2013-12-21 Thread Aymeric Augustin
Hello, Based on the feedback I received through several channels (GitHub, IRC, private email) I’m planning to make two API changes before merging this pull request. (1) Remove auto-discovery of AppConfig in application modules I implemented this shim to make it possible to take advantage of ap

App-loading reloaded - custom app names in the admin

2013-12-20 Thread Aymeric Augustin
Merge request I sent a pull request implementing my second goal: https://github.com/django/django/pull/2089. It allows customizing application names in the admin. A handful of core developers were kind enough to oversee my efforts. Their feedback on the design has been positive. However, as fa

Re: App-loading reloaded - apps without a models module

2013-12-17 Thread Aymeric Augustin
On 16 déc. 2013, at 12:02, Aymeric Augustin wrote: > I sent a pull request implementing my first goal: > https://github.com/django/django/pull/2076. Merged: https://github.com/django/django/compare/fe1389e911b0...4a56a93cc458 -- Aymeric. -- You received this message because you are subs

App-loading reloaded - apps without a models module

2013-12-16 Thread Aymeric Augustin
Merge request I sent a pull request implementing my first goal: https://github.com/django/django/pull/2076. It allows creating apps without a models module, and that’s it. As far as I can tell it’s fully backwards-compatible. It even includes deprecation paths for some private APIs for extra s

App-loading reloaded

2013-12-15 Thread Aymeric Augustin
**Warning: Wall of Text** (and there’s no tl;dr). History The reference ticket for the project known as app-loading is https://code.djangoproject.com/ticket/3591. Joseph Kocherhans attaches an initial patch when he files the ticket in February 2007. That patch changes INSTALLED_APPS to a list