Description of problem: When the Beaker RPM is installed and pkg_resources is imported before bkr, then "bkr.__version__" will always be reported as the installed version, even if imports of submodules are coming from a source checkout. How reproducible: Always Steps to Reproduce: 1. Install bkr from an RPM 2. Run Beaker with an appropriate PYTHONPATH setting 3. Import pkg_resources 4. Import bkr 5. Check bkr.__version__ Actual results: bkr.__version__ reports the installed version Expected results: bkr.__version__ reports the source checkout version Additional info: This is actually inherent in the way Python's namespace packages work - the only meaningful package level state allowed is the __path__ attribute that defines where submodules may be found. This is made more obvious in the innate namespace package support in Python 3.3, where the way you indicate a namespace package is not providing an __init__.py file *at all*. To resolve this issue for Beaker, the current "bkr.__version__" attribute should be moved to "bkr.common.__version__" instead, as retrieving the "bkr.common" sub module will correctly respect PYTHONPATH and report the version that is being used to satisfy submodule imports, rather than the version that was used to create the top level namespace package. The *only* code in the bkr level __init__.py should be the boilerplate to declare the namespace package. Until this is changed, in order to build the documentation correctly, it is currently necessary to uninstall any Beaker RPMs.
Note that, for backwards compatibility, the line in bkr/__init__.py that currently sets the version can be replaced with: from bkr.common import __version__ That way bkr.__version__ can still be used to access the version information, it just gets set indirectly in order to ensure that a system installation and a source checkout can share a common __init__ file for the namespace package without conflict.
On Gerrit: http://gerrit.beaker-project.org/#/c/1978/
Previous patch broke the RPM build.
New patch that properly treats bkr as a stateless namespace package: http://gerrit.beaker-project.org/#/c/1991/
More fixes from Dan to get local builds working on RHEL 6 when an RPM is also installed : http://gerrit.beaker-project.org/#/c/2000/
I believe this is finally sorted now...
[root@beaker-devel ~]# python Python 2.6.6 (r266:84292, Oct 12 2012, 14:23:48) [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import pkg_resources >>> from bkr.common import __version__ >>> bkr.common.__version__ Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'bkr' is not defined >>> import bkr >>> bkr.common.__version__ '0.12.1' >>> exit Use exit() or Ctrl-D (i.e. EOF) to exit >>> [root@beaker-devel ~]# rpm -qa | grep beaker beaker-server-0.12.1-1.git.177.5d4e6bf.el6.noarch beaker-server-redhat-0.1.14-1.el6eng.noarch beaker-0.12.1-1.git.177.5d4e6bf.el6.noarch
Beaker 0.13.1 has been released.