[Django] #21630: Simplify find_management_module

28 views
Skip to first unread message

Django

unread,
Dec 17, 2013, 11:14:13 AM12/17/13
to django-...@googlegroups.com
#21630: Simplify find_management_module
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Core | Keywords:
(Management commands) | Has patch: 0
Severity: Normal | Needs tests: 0
Triage Stage: | Easy pickings: 0
Unreviewed |
Needs documentation: 0 |
Patch needs improvement: 0 |
UI/UX: 0 |
-------------------------------------+-------------------------------------
There's a comment that says: "When using manage.py, the project module is
added to the path, loaded, then removed from the path."

I believe manage.py no longer does that since 1.4 (new project layout). As
a consequence the code could be simplified.

--
Ticket URL: <https://code.djangoproject.com/ticket/21630>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 18, 2013, 7:35:26 AM12/18/13
to django-...@googlegroups.com
#21630: Simplify find_management_module
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Core (Management | Resolution:
commands) | Triage Stage:
Severity: Normal | Unreviewed
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by ramiro):

Thought the same when trying to work on #15084 and reviewing that code.

But, shouldn't that code remain as is to stay compatible with existing
project that use old the layout? Or this isn't a supported scenario?

--
Ticket URL: <https://code.djangoproject.com/ticket/21630#comment:1>

Django

unread,
Dec 18, 2013, 8:27:43 AM12/18/13
to django-...@googlegroups.com
#21630: Simplify find_management_module
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Core (Management | Resolution:
commands) | Triage Stage:
Severity: Normal | Unreviewed
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by mjtamlyn):

I think we've had the new layout long enough - other things which tried to
do clever stuff around this have been removed from what I remember. +1 to
removing this.

--
Ticket URL: <https://code.djangoproject.com/ticket/21630#comment:2>

Django

unread,
Dec 21, 2013, 5:15:23 AM12/21/13
to django-...@googlegroups.com
#21630: Simplify find_management_module
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Core (Management | Resolution:
commands) | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by timo):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/21630#comment:3>

Django

unread,
Feb 15, 2014, 2:40:09 PM2/15/14
to django-...@googlegroups.com
#21630: Simplify find_management_module
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Core (Management | Resolution:
commands) | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0

Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by claudep):

* has_patch: 0 => 1


Comment:

Is this too much simplification?

--
Ticket URL: <https://code.djangoproject.com/ticket/21630#comment:4>

Django

unread,
May 27, 2014, 3:34:51 PM5/27/14
to django-...@googlegroups.com
#21630: Simplify find_management_module
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: aaugustin
Type: | Status: assigned
Cleanup/optimization | Version: master

Component: Core (Management | Resolution:
commands) | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by aaugustin):

* status: new => assigned
* owner: nobody => aaugustin


--
Ticket URL: <https://code.djangoproject.com/ticket/21630#comment:5>

Django

unread,
May 27, 2014, 3:52:43 PM5/27/14
to django-...@googlegroups.com
#21630: Simplify find_management_module
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner:
Type: | Status: new
Cleanup/optimization | Version: master
Component: Core (Management | Resolution:
commands) | Triage Stage: Ready for
Severity: Normal | checkin
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0

Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by aaugustin):

* status: assigned => new
* owner: aaugustin =>
* stage: Accepted => Ready for checkin


Comment:

Yes, your approach seems correct to me. I'd rather remove this stuff and
see if someone has an edge case that breaks than leave it without knowing
why. The patch will require a small update to apply after 486532. I'll let
you push it!

--
Ticket URL: <https://code.djangoproject.com/ticket/21630#comment:6>

Django

unread,
May 27, 2014, 3:53:55 PM5/27/14
to django-...@googlegroups.com
#21630: Simplify find_management_module
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner:
Type: | Status: new
Cleanup/optimization | Version: master
Component: Core (Management | Resolution:
commands) | Triage Stage: Ready for
Severity: Normal | checkin
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by aaugustin):

Replying to [comment:1 ramiro]:


> But, shouldn't that code remain as is to stay compatible with existing
project that use old the layout? Or this isn't a supported scenario?

Because of the app-loading refactor, I don't think it'll be possible to
use the old layout with Django 1.7.

--
Ticket URL: <https://code.djangoproject.com/ticket/21630#comment:7>

Django

unread,
May 27, 2014, 4:23:42 PM5/27/14
to django-...@googlegroups.com
#21630: Simplify find_management_module
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: Claude
Type: | Paroz <claude@…>
Cleanup/optimization | Status: closed
Component: Core (Management | Version: master
commands) | Resolution: fixed
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz <claude@…>):

* owner: => Claude Paroz <claude@…>
* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"fe53bc524b9c7cbc814868acde94226d0ba2bc84"]:
{{{
#!CommitTicketReference repository=""
revision="fe53bc524b9c7cbc814868acde94226d0ba2bc84"
Fixed #21630 -- Simplified management command discovery

Thanks Aymeric Augustin for the report end the review.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21630#comment:8>

Django

unread,
May 27, 2014, 4:24:48 PM5/27/14
to django-...@googlegroups.com
#21630: Simplify find_management_module
-------------------------------------+-------------------------------------

Reporter: aaugustin | Owner: Claude
Type: | Paroz <claude@…>
Cleanup/optimization | Status: closed
Component: Core (Management | Version: master
commands) | Resolution: fixed
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by claudep):

I'm not convinced this has to be backported to 1.7. If you think it
should, just speak!

--
Ticket URL: <https://code.djangoproject.com/ticket/21630#comment:9>

Django

unread,
May 28, 2014, 3:19:36 AM5/28/14
to django-...@googlegroups.com
#21630: Simplify find_management_module
-------------------------------------+-------------------------------------

Reporter: aaugustin | Owner: Claude
Type: | Paroz <claude@…>
Cleanup/optimization | Status: closed
Component: Core (Management | Version: master
commands) | Resolution: fixed
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by aaugustin):

Yes, I think it should be backported, because if it breaks something, that
will be seen as collateral damage of app loading.

--
Ticket URL: <https://code.djangoproject.com/ticket/21630#comment:10>

Django

unread,
May 28, 2014, 3:36:51 AM5/28/14
to django-...@googlegroups.com
#21630: Simplify find_management_module
-------------------------------------+-------------------------------------

Reporter: aaugustin | Owner: Claude
Type: | Paroz <claude@…>
Cleanup/optimization | Status: closed
Component: Core (Management | Version: master
commands) | Resolution: fixed
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Claude Paroz <claude@…>):

In [changeset:"91ef348bd6ac5d3051d428806b143c419af91aa8"]:
{{{
#!CommitTicketReference repository=""
revision="91ef348bd6ac5d3051d428806b143c419af91aa8"
[1.7.x] Fixed #21630 -- Simplified management command discovery

Thanks Aymeric Augustin for the report end the review.

Backport of fe53bc524 from master.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21630#comment:11>

Django

unread,
May 28, 2014, 5:23:28 AM5/28/14
to django-...@googlegroups.com
#21630: Simplify find_management_module
-------------------------------------+-------------------------------------

Reporter: aaugustin | Owner: Claude
Type: | Paroz <claude@…>
Cleanup/optimization | Status: closed
Component: Core (Management | Version: master
commands) | Resolution: fixed
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by aaugustin):

Thank you!

--
Ticket URL: <https://code.djangoproject.com/ticket/21630#comment:12>

Reply all
Reply to author
Forward
0 new messages