"task" is not exported from module "invoke"

Abierto
#1,013 2 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
42/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python

Línea de trabajo

Start by inspecting the main init.py export surface and compare the proposed change with the discussion in issue 814. Verify that from invoke import task is recognized by Pylance without breaking the existing public imports; the issue is done when the warning is resolved and the package's exports remain correct.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

I am using vscode. I get a pylance warning:
"task" is not exported from module "invoke"

This is from this line:
from invoke import task

It all works, but is a little annoying.

I'm not sure the sophisticated way to do it in a library, but you could add a complete __all__= in your main __init__.py.

For instace:

# At bottom of __init__.py

__all__ = (
    "__version_info__",
    "__version__",
    "AmbiguousEnvVar",
    "Argument",
    "AuthFailure",
    "Call",
    "Collection",
    "CollectionNotFound",
    "CommandTimedOut",
    "Config",
    "Context",
    "Exit",
    "Executor",
    "FailingResponder",
    "Failure",
    "FilesystemLoader",
    "Local",
    "MockContext",
    "ParseError",
    "Parser",
    "ParserContext",
    "ParseResult",
    "PlatformError",
    "Program",
    "Promise",
    "pty_size",
    "Responder",
    "ResponseNotAccepted",
    "Result",
    "Runner",
    "run",
    "StreamWatcher",
    "SubprocessPipeError",
    "sudo",
    "task",
    "Task",
    "call",
    "ThreadException",
    "UncastableEnvVar",
    "UnexpectedExit",
    "UnknownFileType",
    "UnpicklableConfigMember",
    "WatcherError",
)

This is also covered in https://github.com/pyinvoke/invoke/issues/814, but I think the solution mentioned there is not ideal.

Lenguaje dominante
Python
Estrellas
4.8k
Forks
412
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pyinvoke/invoke

Todos los issues de pyinvoke/invoke

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.