Bug 1278605 - [RFE] support installing beaker-client through pip
Summary: [RFE] support installing beaker-client through pip
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: command line
Version: 21
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: 24.0
Assignee: Dan Callaghan
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-05 23:36 UTC by Dan Callaghan
Modified: 2017-02-21 18:50 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-21 18:50:51 UTC
Embargoed:


Attachments (Terms of Use)

Description Dan Callaghan 2015-11-05 23:36:27 UTC
This is desirable because it makes the client usable on non-RPM-based platforms.

I think these are the missing pieces which need to be done:

* make Client/setup.py not try to create empty /etc/beaker

* declare dependencies in setup.py, instead of just at the RPM level

* ideally remove Client's dependency on Common to avoid messing around with that extra package (there should be little to nothing in Common which is really needed by Client)

* put Client on PyPI as "beaker-client" so you can install using "pip install beaker-client"

Comment 1 Dan Callaghan 2015-11-05 23:37:33 UTC
(In reply to Dan Callaghan from comment #0)
> This is desirable because it makes the client usable on non-RPM-based
> platforms.

... and also in virtualenvs (even on RPM-based platforms) which is also useful for some people.

Comment 4 Dan Callaghan 2016-11-02 01:33:50 UTC
(In reply to Dan Callaghan from comment #0)
> * ideally remove Client's dependency on Common to avoid messing around with
> that extra package (there should be little to nothing in Common which is
> really needed by Client)

This is not too easy, since client relies heavily on HubProxy (so does the LC code). But it should be no problem to just upload beaker-common to PyPI as well.

Comment 5 Dan Callaghan 2016-11-02 01:42:47 UTC
(In reply to Dan Callaghan from comment #0)
> * make Client/setup.py not try to create empty /etc/beaker

Can't remember why I wrote this... It doesn't seem to cause any harm as is.

I do notice that inside a virtualenv pip does not install package_data to the proper absolute path (because it can't, I guess) so the bash completion script ends up in ./lib/python2.7/site-packages/usr/share/bash-completion/completions/bkr which is useless, but not particularly harmful.

Comment 6 Dan Callaghan 2016-11-02 02:07:27 UTC
With this patch:

http://gerrit.beaker-project.org/5390

I can upload beaker-common and beaker-client to PyPI (tested using TestPyPI) and then successfully run `pip install beaker-client` inside a virtualenv. However the bkr client fails with:

ImportError: No module named libxml2

since it wants to import libxml2-python and libxslt-python bindings. Those aren't available from PyPI so they aren't declared as requirements in setup.py, they have to be installed from the native libxml2 package. (This is the eternal problem with Python-level packaging and why I don't think anyone should bother with it.)

Comment 7 Dan Callaghan 2016-11-02 02:09:46 UTC
(In reply to Dan Callaghan from comment #6)
> However the bkr client fails with:
> 
> ImportError: No module named libxml2

The way to avoid this seems to be to create the virtual env using `virtualenv --system-site-packages` and then ensure that libxml2-python and libxslt-python system packages are installed.

Comment 8 Dan Callaghan 2016-11-07 07:21:18 UTC
I have used the above patch to upload beaker-common and beaker-client version 23.2 (and today also 23.3) to PyPI.

Steps to verify:
1. virtualenv --system-site-packages asdf
2. cd asdf
3. source bin/activate
4. pip install beaker-client
5. bkr whoami

Comment 10 Dan Callaghan 2017-02-21 18:50:51 UTC
Beaker 24.0 has been released.


Note You need to log in before you can comment on or make changes to this bug.