Closed ykshatroff closed 4 years ago
It seems like removing this line
__all__ = click.__all__ + ['pass_verbosity']
Solve the problem
With the following latest packages, I am gettingAttributeError: module 'click' has no attribute '__all__'
How I can resolve this issue?
django v2.2.11 python v3.7.5 click v7.1.1 django-click v2.1.0
@pkfec Unfortunately, it is not easy.
I suggest that for the time being, while this issue is not fixed by a new release, you fork this repository and install the package directly from your git. (Please refer to the respective docs for pip
or pipenv
or whatever package manager you're using, as to how exactly to do it.)
All you need to change is to delete this line: https://github.com/GaretJax/django-click/blob/master/djclick/__init__.py#L16
But a new release is blocked by failing tests and a bunch of pretty old unsupported dependencies.
@ykshatroff won't removing all kill autocompletion in completion-capable editors? I know after some time you learn click options/arguments by heart, but even so, some inner things like pass_context require some "Go to definition" :blush:
@D3f0
Well first, what is more important: autocompletion in editors or a working library? :)
Second, if the dependency doesn't provide us with their __all__
where are we supposed to take it from? I don't feel like we should build our own __all__
for click
.
And finally, in any case, it must have been removed for a reason - which, I suppose, is that __all__
is no longer a thing for autocompletion in modern editors - it's quite error-prone, not DRY, and I suppose in 2020 any editor that truly supports python is able to take a list of symbols from the module itself.
When installing a version of
click
later than 7.0, the djclick import fails with an error:The
click
module does not define__all__
as of 7.1 and later.