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

Can't set collection_name on env_var or local configuration #599

Open
pedroceles opened this issue Nov 6, 2018 · 8 comments
Open

Can't set collection_name on env_var or local configuration #599

pedroceles opened this issue Nov 6, 2018 · 8 comments

Comments

@pedroceles
Copy link

From what I've seen in the codebase Invoke will only run certain configuration after tasks are loaded. This makes it inconvenient to have a project where invoke tasks live in other module than tasks.

That is because to find the tasks module I have to run inv -c [COLLECTION_NAME] [task_name]. When I simply want to run inv [task_name].

I could of course have a ~/.invoke.yaml that looks like this:

tasks:
  collection_name: "my_custom_tasks_module"

However this is impractical, since I'm working on a codebase where many people contribute, which the tasks module is already taken and I don't want to tell everyone to copy an invoke.yaml config file to their home directory. I'd like to make an invoke.yaml in my repo that would make invoke work customly "out of the box". In my opinion, Invoke should look for configuration files (invoke.(json|yml|yaml)) automatically and recursively in the parent directories before tasks are loaded.

I would be glad to try to hack something like that if it sounds good and no similar workarounds exists.

@dperetti
Copy link

dperetti commented Apr 8, 2019

So much this!!
And this tasks.py default name is so annoying. 😩

@CapedHero
Copy link

Moreover, tasks.py is ambiguous and may result in a conflict with other libraries that force using tasks.py...

@voidpp
Copy link

voidpp commented Jan 22, 2020

However this is impractical

You put it mildly, this is a very annoying bug...

@florisla
Copy link
Contributor

florisla commented Jan 22, 2020

I would not call this a bug since it's a deliberate design decision. Your code base is not compatible with the assumptions that invoke makes.

This is already configurable using the -c argument. If that is not convenient, configure your shell to map myinvoke to invoke -c mytasks.

@voidpp
Copy link

voidpp commented Jan 24, 2020

Well, since english is not my primary language maybe I misunderstand something but the documentation write this:

Both the sought collection name and the search root can be specified via configuration file options or as runtime CLI flags

If it is in the documentation and it's not working it's a bug...

@florisla
Copy link
Contributor

Sorry, wasn't aware of that!

@jmcgill298
Copy link

Are there plans to resolve this issue?

@miso-belica
Copy link

miso-belica commented Mar 21, 2020

Some more interesting thoughts about the issue can be found in #471 and #537

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

7 participants