Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

django-click commands do not accept base_stealth_options #10

Open
DMR-coding opened this issue Aug 1, 2019 · 4 comments
Open

django-click commands do not accept base_stealth_options #10

DMR-coding opened this issue Aug 1, 2019 · 4 comments

Comments

@DMR-coding
Copy link

Django commands by default support the options skip_checks, stderr, and stdout. However, django-click commands do not. This incompatibility with the basic command contract causes problems particularly in testing.

@FlipperPA
Copy link
Collaborator

Howdy @DMR-coding - is there anywhere in the documentation where I can see more information on this? I don't see any details here:

https://docs.djangoproject.com/en/3.0/howto/custom-management-commands/

Or is this part of the API that isn't documented?

I see --skip-checks supported since Django 3.0 on certain commands, but not on custom commands. Thanks for the heads up!

@DMR-coding
Copy link
Author

DMR-coding commented Jun 25, 2020

I'm afraid it's been a long enough time since the initial writing that I don't remember where to find any documentation on the matter, if any, and some quick research didn't turn it up.

These are called "stealth options" in the code; they're defined here: https://github.com/django/django/blob/c60524c658f197f645b638f9bcc553103bfe2630/django/core/management/base.py#L235

(skip_checks is no longer one of the base_stealth_options as of 3.0)

@jayvdb
Copy link

jayvdb commented Aug 7, 2020

It seems the lack of stealth options "stdout" and "stderr" makes django-click incompatible with non-CLI runners which use these to capture the output from the command. e.g. django-executor, django-admintool-command , and probably django-chroniker but I havent tried that yet

@FlipperPA
Copy link
Collaborator

FlipperPA commented Aug 9, 2020

It looks like current versions of Django only support stdout and stderr as stealth options. Just noting here:
https://github.com/django/django/blob/master/django/core/management/base.py#L235

Do we just need to add them here? https://github.com/GaretJax/django-click/blob/master/djclick/adapter.py#L40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants