Code

Opened 2 years ago

Closed 2 years ago

Last modified 2 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 2 years ago.

Download all attachments as: .zip

Change History (8)

Changed 2 years ago by cberner

comment:1 Changed 2 years ago by cberner

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to cberner
  • Patch needs improvement unset
  • Status changed from new to assigned

comment:2 Changed 2 years ago by cberner

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

comment:3 Changed 2 years ago by charettes

  • Component changed from Uncategorized to Core (Management commands)
  • Has patch set
  • Needs tests set
  • Type changed from Uncategorized to Bug
  • Version changed from 1.4 to master

FWIW the patch can be found here.

comment:4 Changed 2 years ago by cberner

  • Needs tests unset

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

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

comment:5 Changed 2 years ago by ptone

  • Patch needs improvement set
  • Triage Stage changed from Unreviewed to Accepted

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 2 years ago by jezdez

  • Resolution set to duplicate
  • Status changed from assigned to closed

Duplicate of #18603 which has a more complete patch.

comment:7 Changed 2 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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.