Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#18685 closed Bug (duplicate)

Managements commands in multiple submodules in the same virtual package don't work

Reported by: cberner Owned by: cberner
Component: Core (Management commands) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

If you have commands in two packages, mypackage.A and mypackage.B which are installed from separate egg-link files (develop mode of setuptools), only the commands in the first package will be available at the django command line.

I've attached an example which shows the problem. To try it out, do the following:
1) run "python setup.py develop" in project-A/ and project-B/
2) run "python manage.py command_A" and "python manage.py command_B" in project-C/

Expected: both commands work
Actual: only command_A works

Attachments (1)

django-commands-develop.tar.gz (5.1 KB) - added by cberner 4 years ago.

Download all attachments as: .zip

Change History (8)

Changed 4 years ago by cberner

comment:1 Changed 4 years ago by cberner

Owner: changed from nobody to cberner
Status: newassigned

comment:2 Changed 4 years ago by cberner

Fixed this in my Github fork: git@…:cberner/django.git commit: be5eb957c2dfeea2ce64888359791d3554ce6607

comment:3 Changed 4 years ago by Simon Charette

Component: UncategorizedCore (Management commands)
Has patch: set
Needs tests: set
Type: UncategorizedBug
Version: 1.4master

FWIW the patch can be found here.

comment:4 Changed 4 years ago by cberner

Needs tests: unset

Added a regression test. Let me know if there's anything else that's needed!

Last edited 4 years ago by cberner (previous) (diff)

comment:5 Changed 4 years ago by Preston Holmes

Patch needs improvement: set
Triage Stage: UnreviewedAccepted

I've verified the attached bug demonstration - the fix looks good as pkgutil is more informed about package imports

however testing this is hard - I did some experiments with creating a test local site-packages-like folder with the .egg-link files with relative paths, but didn't work on my first try.

Current tests not working as implemented

link to patch above is stale as it was to a single commit - pull request is here https://github.com/django/django/pull/240/files

comment:6 Changed 4 years ago by Jannis Leidel

Resolution: duplicate
Status: assignedclosed

Duplicate of #18603 which has a more complete patch.

comment:7 Changed 4 years ago by bhuztez

This is a duplicate of #14087.

for namespace package, you can try my patch: https://github.com/django/django/pull/178

Note: See TracTickets for help on using tickets.
Back to Top