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

Allow subcollections to be defaults of parent collections #197

Merged
merged 1 commit into from Dec 30, 2020

Conversation

tyewang
Copy link

@tyewang tyewang commented Dec 8, 2014

Hi,

I thought it would be a nice for subcollections to be defaults of their parent collection. Given that running a task and running the default task of a subcollection is basically the same (i.e. invoke foo), it makes sense that subcollections can be defaults if tasks can be defaults.

For example, if I have a collection named "tests" with a default task of "run_unit_tests", I might want the default of the top level namespace to be the default of "tests". With this PR, we can do:

tests_collection = Collection('tests')
tests_collection.add_task(Task(run_unit_tests), default=True)

namespace = Collection()
namespace.add_collection(tests_collection, default=True)

That way, I can simply type invoke and run my unit tests.

@tyewang tyewang mentioned this pull request Dec 8, 2014
@bitprophet
Copy link
Member

I had to reread your description & glance at the diff to realize that this wasn't duplicating existing functionality. Kind of bizarre that nobody brought this up before, but it makes perfect sense. Thanks!

@tyewang
Copy link
Author

tyewang commented Dec 11, 2014

Sure, glad to help!

@tyewang
Copy link
Author

tyewang commented Dec 11, 2014

@bitprophet It says the build failed, but it looks like it passes for Python 3.2. I'm guessing the failures for the other Pythons are unrelated to me. Is there anything I need to do, or are these known issues?

@bitprophet
Copy link
Member

Nope that's a known build fail related to an almost-merged branch, sorry. Definitely not your fault. (3.2 works because the part that fails - doc building - is skipped on 3.2 due to dependency issues.)

@tyewang
Copy link
Author

tyewang commented Feb 12, 2015

Hi @bitprophet, is there anything more I need to do to get this PR merged? What else is it waiting on?

@bitprophet
Copy link
Member

Hey @tyewang, sorry for the delay, just been a super busy end/start of year for me :(

This is in the release milestone and I'm picking dev up again very shortly, so this'll get merged pretty soon (you don't need to do anything, I just need to re-test it on my end and make a changelog entry). Thanks for your patience!

@bitprophet bitprophet modified the milestones: 0.10, 0.11 May 5, 2015
raise ValueError("This collection has no default task.")
if isinstance(self.default, Collection):
return self._task_with_merged_config(self.default.name, '', ours)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • E501 line too long (81 > 79 characters)

@tyewang
Copy link
Author

tyewang commented Sep 9, 2015

Hey @bitprophet, any update on this PR? It's been 9 months since this has been opened, and it doesn't look like this made it into the 0.11 release. What's up with that?

@bitprophet
Copy link
Member

0.11 turned out to just be "a bunch of random stuff that was in master" and I forgot to rename the actual milestone entry; just did. Re: timing, all I can say is sorry, it's volunteer work/time and I have too many projects. I do plan to dig into real release work (as in, merging the stuff in the milestone) in the near future, have been putting time into my own feature dev trying to get an upstream project 2.0 out the door.

@tyewang
Copy link
Author

tyewang commented Sep 10, 2015

Np, thanks for the update! I just wanted to make sure this PR didn't get forgotten about.

@bitprophet
Copy link
Member

Totes, it's in the milestone, so it won't get forgotten, even if the milestone takes a while to get some love. Sorry for confusing you with the surprise 0.11 release!

@bitprophet bitprophet modified the milestones: 0.12, 0.13 Dec 22, 2015
@tyewang
Copy link
Author

tyewang commented Feb 21, 2016

@bitprophet any update?

@bitprophet bitprophet modified the milestones: 0.13, 0.14 Jun 11, 2016
@bitprophet bitprophet removed this from the 0.13 milestone Jun 11, 2016
@tyewang
Copy link
Author

tyewang commented Jul 11, 2017

Hi @bitprophet, any update on this and #246? It's been 13 months since the last update. Anything I can do to help?

@bitprophet bitprophet modified the milestones: 0.21, Next bugfix Jul 12, 2018
bitprophet added a commit that referenced this pull request Dec 30, 2020
- Formatting/blacken
- Modern pytest style asserts and 'raises' use
@bitprophet bitprophet merged commit ca2fd9b into pyinvoke:master Dec 30, 2020
@bitprophet
Copy link
Member

It's in! Will go out in 1.5. Gonna see how easily I can fold #246 in too...that one's more dicey (looking for easy wins right now). See there for any updates.

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

Successfully merging this pull request may close these issues.

None yet

3 participants