#428 Reland "update to new bodhi library"
Merged 4 years ago by frantisekz. Opened 5 years ago by frantisekz.

@@ -42,6 +42,8 @@ 

    createrepo_c           \

    gcc                    \

    git                    \

+   python2-bodhi-client   \

+   python3-bodhi-client   \

    python3-doit           \

    python2-hawkey         \

    python3-hawkey         \

file modified
+4 -4
@@ -23,8 +23,8 @@ 

  Requires:       ansible

  Requires:       createrepo_c

  Requires:       dnf

+ Requires:       python2-bodhi-client

  Requires:       python2-configparser

- Requires:       python2-fedora

  Requires:       python2-hawkey

  Requires:       python2-jinja2

  Requires:       python2-koji
@@ -39,9 +39,9 @@ 

  # used by 'synchronize' task in ansible

  Requires:       rsync

  

+ BuildRequires:  python2-bodhi-client

  BuildRequires:  python2-configparser

  BuildRequires:  python2-devel

- BuildRequires:  python2-fedora

  BuildRequires:  python2-hawkey

  BuildRequires:  python2-koji

  BuildRequires:  python2-mock
@@ -78,7 +78,7 @@ 

  Requires:       ansible

  Requires:       createrepo_c

  Requires:       dnf

- Requires:       python3-fedora

+ Requires:       python3-bodhi-client

  Requires:       python3-hawkey

  Requires:       python3-jinja2

  Requires:       python3-koji
@@ -98,8 +98,8 @@ 

  Requires:       python3-pyyaml

  %endif

  

+ BuildRequires:  python3-bodhi-client

  BuildRequires:  python3-devel

- BuildRequires:  python3-fedora

  BuildRequires:  python3-hawkey

  BuildRequires:  python3-koji

  BuildRequires:  python3-mock

@@ -6,7 +6,7 @@ 

  '''Utility functions for dealing with Bodhi'''

  

  from __future__ import absolute_import

- import fedora.client

+ import bodhi.client.bindings

  

  from libtaskotron import config

  from libtaskotron import exceptions as exc
@@ -20,7 +20,7 @@ 

  class BodhiUtils(object):

      '''Helper Bodhi methods.

  

-     :ivar fedora.client.Bodhi2Client client: Bodhi2 client instance

+     :ivar bodhi.client.bindings.BodhiClient client: Bodhi client instance

      '''

  

      #: How many requests to make in a single call. The maximum page limit is
@@ -38,7 +38,7 @@ 

          self.config = config.get_config()

  

          if not client:

-             self.client = fedora.client.bodhi.Bodhi2Client(staging=self.config.bodhi_staging)

+             self.client = bodhi.client.bindings.BodhiClient(staging=self.config.bodhi_staging)

              log.debug('Created Bodhi client to: %s', self.client.base_url)

              # automatically retry failed requests (HTTP 5xx and similar)

              self.client.retries = 10

file modified
+2 -1
@@ -9,7 +9,8 @@ 

  

  # libtaskotron

  ansible >= 2.3

- python-fedora >= 0.8.0

+ # bodhi-client is currently not installable from pip: https://github.com/fedora-infra/bodhi/issues/2401

Documentation! You get a :cookie: !

+ # bodhi-client >= 3.10

  configparser >= 3.5.0b2

  Jinja2 >= 2.8

  munch >= 2.0.2

file modified
+3 -3
@@ -9,7 +9,7 @@ 

  import mock

  from munch import Munch

  

- import fedora.client.bodhi

+ import bodhi.client.bindings

  

  from libtaskotron.ext.fedora import bodhi_utils

  from libtaskotron import exceptions as exc
@@ -32,8 +32,8 @@ 

          stg_url = bu_stg.client.base_url

  

          assert prod_url != stg_url

-         assert prod_url == fedora.client.bodhi.BODHI2_BASE_URL

-         assert stg_url == fedora.client.bodhi.BODHI2_STG_BASE_URL

+         assert prod_url == bodhi.client.bindings.BASE_URL

+         assert stg_url == bodhi.client.bindings.STG_BASE_URL

  

  

  class TestGetUpdate():

This reverts commit 85c9537.

We now have python3-bodhi-client in F28 [0]

[0] https://src.fedoraproject.org/rpms/bodhi/pull-request/6

It builds fine, but unfortunately it breaks dev environment, because it can't be installed from pypi:
https://github.com/fedora-infra/bodhi/issues/2401#issuecomment-454456129

We need to wait until that's fixed.

rebased onto 1242f7e

5 years ago

rebased onto f227135

4 years ago

I've rebased this one.

@kparal One of the way forward would be to drop bodhi-client from requirements and let it be in dev env through site-packages. WDYT?

I don't have a strong opinion here. No task is currently using our bodhi directive, so we can easily wait until Bodhi devs make pypi work properly. OTOH I'm not opposed to making it a RPM requirement instead of Pypi requirement and resolve this. If you think we should do the latter, please update the PR, including a documentation change in Taskotron Development Guide (squash into a single commit). Also please note that dropping Fedora 28 support should not be part of this PR. Thanks.

rebased onto 73a793e

4 years ago

rebased onto e5be061

4 years ago

Everything should be addressed now :)

Sorting isn't your forte, is it? :-D

configparser is now part of the standard Python3 library. Was something broken without this extra package?

Documentation! You get a :cookie: !

rebased onto 421cfde

4 years ago

Yeah, but since unsorted stuff triggers you it helps with keeping you awake while reading through the docs ;)

configparser is not needed, I ran the testsuite without that installed on F29 and F30.

The last weird warning that appears while running the tests is this:

/usr/lib/python3.7/site-packages/fedora/client/bodhi.py:48
  /usr/lib/python3.7/site-packages/fedora/client/bodhi.py:48: DeprecationWarning: fedora.client.bodhi has been deprecated. Please use bodhi.client.bindings instead.
    DeprecationWarning)

I have no idea where that comes from.

The warning is there because bodhi.client.bindings imports fedora.client.bodhi itself. Hahaha :D

LGTM. Please include

Merges: https://pagure.io/taskotron/libtaskotron/pull-request/428

inside the git commit message.

rebased onto 297f36c

4 years ago

Commit 297f36c fixes this pull-request

Pull-Request has been merged by frantisekz

4 years ago

Pull-Request has been merged by frantisekz

4 years ago