8000 Depend on python-rtmbot 0.4.0 by bboe · Pull Request #24 · Netflix/hubcommander · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Depend on python-rtmbot 0.4.0 #24

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

Merged
merged 5 commits into from
Mar 13, 2017
Merged

Depend on python-rtmbot 0.4.0 #24

merged 5 commits into from
Mar 13, 2017

Conversation

bboe
Copy link
Member
@bboe bboe commented Feb 25, 2017

Resolves #1

I didn't test the basic_install.sh script changes because they didn't actually work in the first place.

The documentation should specify that a rtmbot.conf needs to be created that looks something like:

DEBUG: True
SLACK_TOKEN: "token"
ACTIVE_PLUGINS:
    - plugins.hubcommander.HubCommander

@bboe bboe changed the title Depend on pytohn-rtmbot 0.4.0 Depend on python-rtmbot 0.4.0 Feb 25, 2017
@mikegrima
Copy link
Contributor

I will start testing this out soon.

@mikegrima mikegrima self-assigned this Feb 25, 2017
@mikegrima
Copy link
Contributor

Docker is throwing a python: can't open file 'rtmbot.py': [Errno 2] No such file or directory. This was moved in 0.4.0.

@mikegrima
Copy link
Contributor

@bboe : I'll send over a patch file soon with the fixes.

@bboe
Copy link
Member Author
bboe commented Feb 27, 2017

@mikegrima I'm curious why docker is trying to access that directly (I haven't looked at the code). In theory shouldn't it be able to use the version installed on the path by the rtmbot installation?

To add, with version 0.4.0, there is a release on pip, so pip install rtmbot should suffice, or pip install rtmbot==0.4.0 to lock it to that version. My next pull request after this one is to get the setup.py for this package to properly pull in rtmbot so the setup script is not actually necessary.

@@ -8,7 +8,7 @@
"""
import json

import bot_components
from .. import bot_components
Copy link
Contributor
@mikegrima mikegrima Feb 27, 2017

Choose a reason for hiding this comment

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

@bboe I'm having an utter NIGHTMARE with the relative imports. Getting things working with the Duo plugin and the Travis plugin is causing a bunch of havoc.

For example, the following stacktrace results:

  File "/hubcommander/plugins/hubcommander.py", line 11, in <module>
    from .auth_plugins.enabled_plugins import AUTH_PLUGINS
  File "/hubcommander/plugins/auth_plugins/enabled_plugins.py", line 6, in <module>
    from auth_plugins.duo.plugin import DuoPlugin
  File "/venv/lib/python3.5/site-packages/auth_plugins/duo/plugin.py", line 14, in <module>
    from bot_components.slack_comm import send_info, send_error, send_success
  File "/venv/lib/python3.5/site-packages/bot_components/slack_comm.py", line 11, in <module>
    from .. import bot_components
ValueError: attempted relative import beyond top-level package

Copy link
Member Author
@bboe bboe Feb 27, 2017

Choose a reason for hiding this comment

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

I think some of this might have to do with the semi-strange way these are installed as their own packages by the basic_install.sh script rather than being all part of one package.

I skipped the pip install for the package directory and instead relied on them being in the plugins directory for rtmbot in which case the entire directory is treated as a single package.

To make things simpler going forward, I propose this entire project be treated a single package so that it can just be pip install and then given the proper configuration externally. In the current form this installation process doesn't play nicely with python's method for installing packages and makes it considerably more difficult to get up and running for someone new to the project. Thoughts?

I am more than happy to help this setup be realized.

Copy link
Contributor

Choose a reason for hiding this comment

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

@bboe : What do you suggest as a solution to this problem?

I'm running the testing inside of the docker image.

Copy link
Member Author
@bboe bboe Feb 27, 2017

Choose a reason for hiding this comment

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

I'm not up to speed on the docker side of things, though I would imagine if this project worked like many other python packages, then there should be no need to set up any directory and only providing an rtmbot.conf that specifies loading the botcommander plugin. Assuming botcommander is properly installed, via pip install botcommand, for example, then rtmbot will be able to load it.

This, of course, would require a different means for loading in changes to the module as the source files for the package shouldn't be modified. I have some ideas to handle that too (i.e., loading optional modules out of the current working directory).

Copy link
Contributor
@mikegrima mikegrima Feb 27, 2017

Choose a reason for hiding this comment

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

@bboe : Are you on Gitter? We can discuss this better there.

Are you referring to having a hubcommander directory within plugins? I would like to have the imports set up such that they are hubcommander.path.to.whatever

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll try to whip together an prototype of what you mean so you can take a look.

Copy link
Contributor
@mikegrima mikegrima Feb 27, 2017

Choose a reason for hiding this comment

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

@bboe : I think I am on the right path now. Making some good progress.

Need to have a plugins/hubcommander directory, and need to have the imports everywhere be along the lines of: plugins.hubcommander.path.to.whatever <-- this is how I prefer the imports to be.

And also also modify the rtmbot.conf file as well.

@mikegrima
Copy link
Contributor

I'm going to merge this in and add follow-up issues to add the remaining things.

@mikegrima mikegrima merged commit 496dbb8 into Netflix:develop Mar 13, 2017
@bboe bboe deleted the rtmbot04 branch March 13, 2017 04:47
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.

2 participants
0