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

Projects
None yet
2 participants
@gtback
Contributor

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.

Pass in project directory when tasks module contains explicit namespace.
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.
@gtback

This comment has been minimized.

Contributor

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

This comment has been minimized.

Member

bitprophet commented May 5, 2015

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

2 checks passed

continuous-integration/appveyor AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@gtback gtback deleted the gtback:load-project-config branch May 20, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment