PBR

setup.py --help-commands fails in env without testrepository

Bug #1375048 reported by Akihiro Motoki
50
This bug affects 13 people
Affects Status Importance Assigned to Milestone
PBR
Status tracked in Kilo
Kilo
Fix Released
Undecided
Sachi King
Liberty
Fix Released
Undecided
Akihiro Motoki

Bug Description

In an environment where testrepository is not installed, python setup.py --help-commands fails due to import error of testrepository.

Does pbr require testrepository?

Horizon does not uses testrepository. The following is an example.

- clone horizon
- cd horizon
- virtualenv testenv
- source testenv/bin/activate
- pip install -e .
- python setup.py --help-commands

Akihiro Motoki (amotoki)
Changed in pbr:
assignee: nobody → Akihiro Motoki (amotoki)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to pbr (master)

Fix proposed to branch: master
Review: https://review.openstack.org/124652

Changed in pbr:
status: New → In Progress
Revision history for this message
Oleg Gashev (oleg-f) wrote :
Revision history for this message
Wes Turner (wes-turner) wrote :

Instead of installing testrepository everywhere,
this wraps ImportError in testr_command.py:

```python
try:
    from testrepository import commands
except ImportError as e:
    class commands(object):
        def __getattribute__(self, key):
            raise e
```

I haven't run the tests. This ImportError is causing other setup.py commands to fail.

Please, either:

* [(0)] add the testrepository dependency
* [(1)] delay the Import
* [(1)] wrap the ImportError

Revision history for this message
Wes Turner (wes-turner) wrote :

"other setup.py commands":

"python setup.py --help-commands" fails, for all packages, without one of the above (or a different) solutions.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to pbr (master)

Reviewed: https://review.openstack.org/124652
Committed: https://git.openstack.org/cgit/openstack-dev/pbr/commit/?id=946cf80b750f3735a5d3b0c2173f4eaa7fad4a81
Submitter: Jenkins
Branch: master

commit 946cf80b750f3735a5d3b0c2173f4eaa7fad4a81
Author: Akihiro Motoki <email address hidden>
Date: Mon Sep 29 07:36:19 2014 +0900

    Make setup.py --help-commands work without testrepository

    testr command is registered by pbr.hooks.commands if
    testrepository is installed, so there is no need to
    setup the entry point in setup.cfg.

    Change-Id: I95aae12d1ac810b6d1d09b71f2a0d87be5ccb6ab
    Closes-Bug: #1375048

Changed in pbr:
status: In Progress → Fix Committed
Changed in pbr:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to pbr (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/263928

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to pbr (stable/kilo)

Reviewed: https://review.openstack.org/263928
Committed: https://git.openstack.org/cgit/openstack-dev/pbr/commit/?id=6e472b4905411a39e993c81c382a27ca9c771ef5
Submitter: Jenkins
Branch: stable/kilo

commit 6e472b4905411a39e993c81c382a27ca9c771ef5
Author: Akihiro Motoki <email address hidden>
Date: Mon Sep 29 07:36:19 2014 +0900

    Make setup.py --help-commands work without testrepository

    testr command is registered by pbr.hooks.commands if
    testrepository is installed, so there is no need to
    setup the entry point in setup.cfg.

    (cherry-picked from 946cf80b750f3735a5d3b0c2173f4eaa7fad4a81)

    Change-Id: I95aae12d1ac810b6d1d09b71f2a0d87be5ccb6ab
    Closes-Bug: #1375048

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack-dev/pbr 0.11.1

This issue was fixed in the openstack-dev/pbr 0.11.1 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.