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

Pass in project directory when tasks module contains explicit namespace. #243

Merged
merged 1 commit into from
May 5, 2015

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