`auto_dash_names` setting not working when using `Collection` with modules in `__init__`

Abierto
#1,008 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
cli

Línea de trabajo

Reproduce the issue with invoke.yaml, tasks/init.py, tasks/module_a.py, and tasks/module_b.py, then run invoke --list. Trace how the Collection built in tasks/init.py applies auto_dash_names to imported modules. Done means the setting is respected and the listed task names match the configured underscore style.

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

Descripción

We've found that auto_dash_names setting is not taking effect when setting up a collection from a module in the __init__.py file

Output
invoke --list             
Available tasks:

  module_a.a-task
  module_b.b-task

The only issue I could find was closed a while back, not sure if this is a symptom of that described in this comment? https://github.com/pyinvoke/invoke/issues/465#issuecomment-319767461

Repro

invoke.yaml:

tasks:
  auto_dash_names: false

tasks/__init__.py:

from invoke import Collection
from . import module_a, module_b
ns = Collection(module_a, module_b)

tasks/module_a.py:

from invoke import task

@task
def a_task(c):
    c.run('echo foo')

tasks/module_b.py:

from invoke import task

@task
def b_task(c):
    c.run('echo bar')
Versions

Python 3.12.2
Invoke 2.2.0

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.