-
Notifications
You must be signed in to change notification settings - Fork 365
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
Trouble loading the project-level configuration file #234
Comments
Weird. Works for me. Can you add your |
I put the I currently use no |
Thank you: your example works in any case, I came up with. And sorry, the missing s in my gist's But I assure you, the example gist works for me — but only if I include the invoke.yaml trough the What seems to be the problem is, that I'm using a namespace in my |
You're right, when using a |
Wacky times, thanks a lot for reporting and kicking this around! I will try to reproduce this on my end soon, I don't personally use project-level conf files yet (though I do use explicit namespaces everywhere) so I haven't had a chance for it to bite me. But it sounds totally plausible and hopefully there's a simple, silly answer. |
I've been digging around and think I solved this one. PR coming shortly. |
When a `tasks.py` module contains an explict Collection (named either `ns` or `namespace`), the parent directory (used to find the project-specific configuration file (e.g. `invoke.yaml`) is not passed in to the Collection created from the factory method `Collection.from_module`. This caused the file to not be found except when explicitly specified with the -f flag. Compare to the similar Collection() invocation about 12 lines below this change. Fix pyinvoke#234.
@brutus: Can you see if the change I made in 34e6a7a solves the problem for you, in case @bitprophet doesn't have a chance to reproduce this bug? |
@gtback: Just did a quick check and it worked. Thx! Will fiddle some more and get back to you if anything bails. |
I'm using Invoke 0.10.1 in an virtual environment. I have an
invoke.yaml
file next to mytasks.py
file, but it is ignored. Values from~/.invoke.yaml
are loaded though. If i use-f
it works too.The
tasks.py
imports some tasks from other modules, but the root namespace is created and configured in thetasks.py
file. I tried using a package for the tasks instead but to no avail.Any hints?
And btw: if I use a package, do the
invoke.yaml
file needs to be in the package (next to__init__.py
) or in the parent folder (tried both, none worked)?The text was updated successfully, but these errors were encountered: