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

Bots: Add support for running packaged bots via entrypoints #517

Closed
wants to merge 2 commits into from

Conversation

neiljp
Copy link
Contributor

@neiljp neiljp commented Jul 27, 2019

The entrypoints approach seems like it may make it easier to produce third-party bots, and could potentially be extended to be the default way in which zulip_bots accesses built-in bots?

A test is included for the new approach, as well as:

  • removal of python 3.4 support and addition of 3.7 to travis (branch failed due to an existing bot requiring lxml with 2.7 or >=3.5)
  • addition of ImportError as an alternative to ModuleNotFoundError, which is only introduced in python 3.6
  • changes to improve indication to the user, where the bot module is being sourced

Added dependency upon supporting small 'entrypoints' package.

Add test case.
@neiljp
Copy link
Contributor Author

neiljp commented Jul 27, 2019

If this is a reasonable approach then we can add support for a 'sample' package, which I've done locally but not included so far.

@timabbott
Copy link
Member

I merged the first 2 commits.

@neiljp neiljp force-pushed the 2019-07-bot-entrypoints branch from 1df9b05 to 9386c58 Compare July 31, 2019 19:27
@neiljp
Copy link
Contributor Author

neiljp commented Jul 31, 2019

Just adjusted the last commit to take into account 'editable' bot packages, which don't have a version - at least according to entrypoints - so just show the bot module_name details.

@timabbott
Copy link
Member

Closing, since we've now merged #708.

@timabbott timabbott closed this Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants