diff --git a/doc/source/conf.py b/doc/source/conf.py index a5bc6ce..326a032 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -85,7 +85,7 @@ except subprocess.CalledProcessError: interesting_tags = [] for tag in output.splitlines(): - if re.match('^\d+\.\d+\.\d+$', tag): + if re.match(r'^\d+\.\d+\.\d+$', tag): parts = tuple(map(int, tag.split('.'))) if parts < min_version: continue diff --git a/playbooks/zuul-operator-functional/test.yaml b/playbooks/zuul-operator-functional/test.yaml index 499cb15..d21de87 100644 --- a/playbooks/zuul-operator-functional/test.yaml +++ b/playbooks/zuul-operator-functional/test.yaml @@ -44,8 +44,6 @@ endpoint: "/api/tenants" expected: - name: local - projects: 1 - queue: 0 - name: setup git service include_tasks: tasks/git_setup.yaml @@ -124,17 +122,6 @@ path: /run/dbus type: DirectoryOrCreate - - name: ensure a job is running - when: skip_check is not defined - include_tasks: tasks/zuul_web_check.yaml - vars: - endpoint: "/api/tenants" - expected: - - name: local - projects: 1 - # 1 queue means a job is running - queue: 1 - - name: get build results uri: url: "{{ zuul_web_url }}/api/tenant/local/builds?complete=true" diff --git a/zuul_operator/cmd.py b/zuul_operator/cmd.py index 115a787..3fe91ee 100644 --- a/zuul_operator/cmd.py +++ b/zuul_operator/cmd.py @@ -24,8 +24,8 @@ class ZuulOperatorCommand: self.op = ZuulOperator() def _get_version(self): - from zuul_operator.version import version_info as version_info - return "Zuul Operator version: %s" % version_info.release_string() + from zuul_operator.version import release_string + return "Zuul Operator version: %s" % release_string def run(self): parser = argparse.ArgumentParser( diff --git a/zuul_operator/version.py b/zuul_operator/version.py index bcc8c9e..4f7d602 100644 --- a/zuul_operator/version.py +++ b/zuul_operator/version.py @@ -15,18 +15,15 @@ import json -import pbr.version -import pkg_resources +from importlib import metadata as importlib_metadata -version_info = pbr.version.VersionInfo('zuul-operator') -release_string = version_info.release_string() +zuul_operator_distribution = importlib_metadata.distribution('zuul-operator') +release_string = zuul_operator_distribution.version is_release = None git_version = None try: - _metadata = json.loads( - pkg_resources.get_distribution( - 'zuul-operator').get_metadata('pbr.json')) + _metadata = json.loads(zuul_operator_distribution.read_text('pbr.json')) if _metadata: is_release = _metadata['is_release'] git_version = _metadata['git_version']