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

PR: Command Plugins #100

Merged
merged 11 commits into from
Jul 15, 2017
Merged

PR: Command Plugins #100

merged 11 commits into from
Jul 15, 2017

Conversation

fpliger
Copy link
Contributor

@fpliger fpliger commented Jul 7, 2017

This partially implements #89 (at lease for packaged command plugins).

This is a second pass on #94, trimming everything related to "drop in" plugins and just keeping a clean PR for plugins registered using entry_points.

@fpliger
Copy link
Contributor Author

fpliger commented Jul 10, 2017

This is not ideal but opens the door for quite a few scenarios...

@fpliger
Copy link
Contributor Author

fpliger commented Jul 13, 2017

@havocp would you have some bandwidth to review this PR?

return entry_point_plugins


class ArgsTrasformerTemplate(_ArgsTransformer):
Copy link
Contributor

Choose a reason for hiding this comment

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

would it make sense to have separate files for "stuff plugins would import" and "stuff code that uses plugins would import" ? The second should potentially be in internal/ . Here specifically wondering if get_plugins() is internal and the two Template classes are public API for use by plugin implementations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeap... That's actually a good separation. Will do in this PR

@@ -850,6 +851,11 @@ def _update_commands(self, problems, project_file, requirements):
first_command_name = None
commands = dict()
commands_section = project_file.get_value('commands', None)

plugins = plugins_api.get_plugins('command_run')
all_known_command_attributes_extented = all_known_command_attributes + \
Copy link
Contributor

Choose a reason for hiding this comment

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

s/extented/extended/

@@ -408,6 +408,8 @@ def description(self):
description = self._attributes.get('windows', None)
if description is None:
description = self._attributes.get('conda_app_entry', None)
if description is None:
description = getattr(self, 'command', None)
Copy link
Contributor

Choose a reason for hiding this comment

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

I originally wrote "why not self.command " but now I'm looking through the class and don't see a command attribute; is somewhere else monkeypatching this in? Maybe there should be a real setter/getter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mmm... in the plugins case self.command is really just a class attr. Is it a name issue (glad to change it in that case) or there was something else?

Overall I'd really like to merge this PR this morning.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't mind the name it was just confusing to me that there's no trace of this attr in the base class. Maybe set it to None in the base? Or make it an instance attr None by default?

Copy link
Contributor

Choose a reason for hiding this comment

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

Basically I'd try to have some way this is documented in the base class, if the base class is going to refer to it.

(merge when you want/need to!)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Basically I'd try to have some way this is documented in the base class, if the base class is going to refer to it.

Oh yup.. that's definitely a miss. Makes sense.

(merge when you want/need to!)

👍 will do as soon as I address the comments and CI is happy :) tnx!

@fpliger
Copy link
Contributor Author

fpliger commented Jul 14, 2017

Cool. If there are not objections will be merging this soon...

@fpliger fpliger merged commit 168585e into master Jul 15, 2017
@havocp havocp deleted the command-plugins-rd2 branch July 15, 2017 12:27
@havocp
Copy link
Contributor

havocp commented Jul 15, 2017

yay!

@goanpeca goanpeca added this to the v0.8.1 milestone Oct 3, 2017
@goanpeca goanpeca changed the title Command Plugins PR: Command Plugins Oct 4, 2017
@fpliger fpliger mentioned this pull request Oct 10, 2017
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.

None yet

3 participants