Skip to content

Conversation

@gtback
Copy link
Contributor

@gtback gtback commented May 5, 2015

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 #234.

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.
@gtback
Copy link
Contributor Author

gtback commented May 5, 2015

I'm happy to add a test for this, but I'm not sure the best place to, since it relies on having both tasks.py and invoke.yaml in the same directory. Trying to solve this is what led me down the path to #240, but I don't think there's a good unit test for this problem. An integration test, perhaps?

@bitprophet
Copy link
Member

Naw, there was actually a regular semi-unit test (the ones in the CLI module are in a gray area between unit and integration) that can be copied to work perfectly for this, just needed a new fixture & a tweak to select it; see 3356f62

@bitprophet bitprophet merged commit 34e6a7a into pyinvoke:master May 5, 2015
@gtback gtback deleted the load-project-config branch May 20, 2015 04:53
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

Successfully merging this pull request may close these issues.

Trouble loading the project-level configuration file

2 participants