From 7ddfe2f554d9e12ac3296c11ad29af8bde135383 Mon Sep 17 00:00:00 2001 From: Kamil Páral Date: Feb 05 2020 11:02:43 +0000 Subject: requirements: fix invalid bodhi import Also work around a bodhi pypi bug. Fixes: https://pagure.io/fedora-qa/blockerbugs/issue/105 --- diff --git a/blockerbugs/util/update_sync.py b/blockerbugs/util/update_sync.py index e61f2a8..246e4d4 100644 --- a/blockerbugs/util/update_sync.py +++ b/blockerbugs/util/update_sync.py @@ -22,7 +22,8 @@ from datetime import datetime import logging -from fedora.client import bodhi, ServerError +from fedora.client import ServerError +from bodhi.client.bindings import BodhiClient, BodhiClientException from blockerbugs import app from blockerbugs.models.update import Update @@ -38,7 +39,7 @@ class UpdateSync(object): self.bodhi_interface = bodhi_interface() else: # disable saving session on disk by cache_session=False - self.bodhi_interface = bodhi.BodhiClient(base_url=bodhi_baseurl, cache_session=False) + self.bodhi_interface = BodhiClient(base_url=bodhi_baseurl, cache_session=False) self.log = logging.getLogger('update_sync') def extract_information(self, update): @@ -120,7 +121,7 @@ class UpdateSync(object): ) try: result = self.bodhi_interface.query(**queries_data) - except bodhi.BodhiClientException as e: + except BodhiClientException as e: # ignore invalid release error so it doesn't blow up when # bug trackers for a release not present in bodhi are added if 'Invalid releases' in str(e): diff --git a/docs/source/development.rst b/docs/source/development.rst index 4704fc4..afaec2e 100644 --- a/docs/source/development.rst +++ b/docs/source/development.rst @@ -28,7 +28,7 @@ Create a Virtualenv Create a new virtualenv in the base of the source tree:: - virtualenv env_blockerbugs + virtualenv --system-site-packages env_blockerbugs In order to install python packages into the virtualenv or use the packages inside the virtualenv, it must be activated:: @@ -44,6 +44,13 @@ virtualenv (ie. activate the virtualenv first):: pip install -r requirements.txt +Install bodhi-client in the system until `https://github.com/fedora-infra/bodhi/issues/3919`_ +is fixed:: + + sudo dnf install python3-bodhi-client + +**FIXME: Remove this and ``--system-site-packages`` once the bug is fixed.** + Configuring dev environment =========================== diff --git a/requirements.txt b/requirements.txt index 6d3a06d..d5337a5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ alembic >= 1.1.0 +# bodhi-client >= 5.0.0 # uncomment once this is fixed: https://github.com/fedora-infra/bodhi/issues/3919 Flask-Admin >= 1.5.2 Flask-SQLAlchemy == 2.4.0 Flask-WTF >= 0.14.2