Compare commits

..

2 commits

Author SHA1 Message Date
Pavel Raiskup
8df1804932 fun with scl #2 - simplification
- We expect %python_sitelib is hacked by %scl_package_override
  macro
- we also rely on the fact that %scl_enable is defined
  %scl_package (or %scl_package_override)

Version: 0.11-7.git3459d
2016-07-26 19:29:42 +02:00
Pavel Raiskup
359c9122a3 try to package as SCL
There are still python2 issues, but it works as an example.

Version: 0.11-7.git3459d
2016-07-22 12:22:15 +02:00
8 changed files with 175 additions and 192 deletions

2
.gitignore vendored
View file

@ -1 +1 @@
/pybugz-*.tar.gz
/pybugz-0.11-git3459d.tar.gz

View file

@ -0,0 +1,58 @@
diff --git a/bugz/cli.py b/bugz/cli.py
index aa45d3b..12e2224 100644
--- a/bugz/cli.py
+++ b/bugz/cli.py
@@ -240,7 +240,10 @@ class PrettyBugz:
log_info(log_msg)
if not 'status' in params.keys():
- params['status'] = ['CONFIRMED', 'IN_PROGRESS', 'UNCONFIRMED']
+ params['status'] = ['CONFIRMED', 'IN_PROGRESS',
+ 'UNCONFIRMED', 'NEW', 'ASSIGNED', 'ON_DEV',
+ 'POST', 'MODIFIED', 'ON_QA', 'VERIFIED',
+ 'RELEASE_PENDING']
elif 'ALL' in params['status']:
del params['status']
diff --git a/bugzrc.example b/bugzrc.example
index f516bf0..e8e1234 100644
--- a/bugzrc.example
+++ b/bugzrc.example
@@ -59,3 +59,20 @@
#
# All parameters listed above can be used in the default section if you
# only use one bugzilla installation.
+
+[gentoo]
+base: https://bugs.gentoo.org/xmlrpc.cgi
+columns: 80
+encoding: utf-8
+# user: myname@my.project.com
+# password: secret2
+
+[redhat]
+base: https://bugzilla.redhat.com/xmlrpc.cgi
+columns: 80
+encoding: utf-8
+# user: myname@my.project.com
+# password: secret2
+
+[default]
+connection: redhat
diff --git a/man/bugz.1 b/man/bugz.1
index 5a88494..365ab7e 100644
--- a/man/bugz.1
+++ b/man/bugz.1
@@ -28,6 +28,12 @@ This man page is a stub; the bugz program has extensive built in help.
will show the help for the global options and
.B bugz [subcommand] -h
will show the help for a specific subcommand.
+.SH CONFIGURATION
+PyBugz is still configured just using the ~/.bugzrc file. For simple template
+look at the bugzrc.example
+.B (rpm -qd pybugz | grep example)
+- you may copy it directly into your home directory to make PyBugz work by
+default with Red Hat bugzilla.
.SH BUGS
.PP
The home page of this project is http://www.github.com/williamh/pybugz.

View file

@ -0,0 +1,62 @@
diff --git a/bin/bugz b/bin/bugz
index c7b6c46..1e09412 100755
--- a/bin/bugz
+++ b/bin/bugz
@@ -19,7 +19,7 @@ Classes
"""
import argparse
-import configparser
+from six.moves import configparser
import sys
from bugz.argparsers import make_parser
diff --git a/bugz/cli.py b/bugz/cli.py
index 94842f2..8f7a862 100644
--- a/bugz/cli.py
+++ b/bugz/cli.py
@@ -4,7 +4,7 @@ import re
import subprocess
import sys
import textwrap
-import xmlrpc.client
+from six.moves import xmlrpc_client
try:
import readline
diff --git a/bugz/configfile.py b/bugz/configfile.py
index 9d54946..f5d4ea5 100644
--- a/bugz/configfile.py
+++ b/bugz/configfile.py
@@ -1,4 +1,4 @@
-import configparser
+from six.moves import configparser
import glob
import os
import sys
diff --git a/bugz/connection.py b/bugz/connection.py
index bdf5734..934a523 100644
--- a/bugz/connection.py
+++ b/bugz/connection.py
@@ -1,8 +1,8 @@
import os
import sys
-import urllib.error
-import urllib.parse
-import xmlrpc.client
+from six.moves import urllib_error
+from six.moves import urllib_parse
+from six.moves import xmlrpc_client
from bugz.configfile import get_config_option
from bugz.errhandling import BugzError
diff --git a/bugz/tokens.py b/bugz/tokens.py
index b39e3b5..59d2ccd 100644
--- a/bugz/tokens.py
+++ b/bugz/tokens.py
@@ -1,4 +1,4 @@
-import configparser
+from six.moves import configparser
import os

View file

@ -1,52 +0,0 @@
From 0bd2517f92874c758ec30177c5df4ecdf222236b Mon Sep 17 00:00:00 2001
From: Pavel Raiskup <praiskup@redhat.com>
Date: Fri, 3 Dec 2021 13:41:53 +0100
Subject: [PATCH] Query limit to be configurable
Red Hat Bugzilla applied policy that anonymous queries can get at most
20 lines in the API output, and authenticated queries up to 1000.
So it is probably a good idea to "push" Red Hat maintainers to the
authentication (interactive=True) a little bit more and set some
reasonable default limit (limit=1000), otherwise the output will be very
limited (and there's a risk that user misses some bugs thinking that the
output is complete).
Both of those options can be changed in $HOME/.bugzrc.
Proposed:
https://github.com/williamh/pybugz/pull/111
---
bugz/settings.py | 5 +++++
pybugz.d/redhat.conf | 2 ++
2 files changed, 7 insertions(+)
diff --git a/bugz/settings.py b/bugz/settings.py
index c45481c..1666f38 100644
--- a/bugz/settings.py
+++ b/bugz/settings.py
@@ -123,6 +123,11 @@ class Settings:
else:
self.insecure = False
+ if not hasattr(self, 'limit'):
+ if config.has_option(self.connection, 'limit'):
+ self.limit = get_config_option(config.get, self.connection,
+ 'limit')
+
if getattr(self, 'encoding', None) is not None:
log_info('The encoding option is deprecated.')
diff --git a/pybugz.d/redhat.conf b/pybugz.d/redhat.conf
index 36712a5..ec9d293 100644
--- a/pybugz.d/redhat.conf
+++ b/pybugz.d/redhat.conf
@@ -1,3 +1,5 @@
[RedHat]
base = https://bugzilla.redhat.com/xmlrpc.cgi
search_statuses = NEW, ASSIGNED, MODIFIED, ON_DEV, POST
+interactive = True
+limit = 1000
--
2.33.1

View file

@ -1,8 +0,0 @@
diff --git a/pybugz.d/default.conf b/pybugz.d/default.conf
index cef06b8..32bdd41 100644
--- a/pybugz.d/default.conf
+++ b/pybugz.d/default.conf
@@ -1,2 +1,2 @@
[default]
-connection = Gentoo
+connection = RedHat

View file

@ -1,22 +1,22 @@
%global gitrev bb0ae
%{?scl:%scl_package pybugz}
%global gitrev 3459d
%global posttag git%{gitrev}
%global snapshot %{version}-%{posttag}
Name: pybugz
Name: %{?scl_prefix}pybugz
Summary: Command line interface for Bugzilla written in Python
Version: 0.13
Release: 20.%{posttag}%{?dist}
# Automatically converted from old format: GPLv2 - review is highly recommended.
License: GPL-2.0-only
Version: 0.11
Release: 7.%{posttag}%{?dist}
Group: Applications/Communications
License: GPLv2
URL: https://github.com/williamh/pybugz
BuildArch: noarch
Requires: python3
BuildRequires: python3-devel
BuildRequires: python3-setuptools
Requires: python2
Requires: python-six
BuildRequires: python2-devel
%{?scl:Requires:%scl_runtime}
Patch0: pybugz-0.13-gitbb0ae-rh-default.patch
Patch1: pybugz-0.13-gitbb0ae-limit-configurable.patch
%if ! 0%{?rhel}
# no bash-completion for RHEL
@ -30,7 +30,13 @@ BuildRequires: bash-completion pkgconfig
# There is possible to download upstream tarball generated by github, but it is
# quite old now. For HOWTO obtain correct tarball see the "prepare-tarball.sh"
# script (in dist-git).
Source0: %{name}-%{snapshot}.tar.gz
Source0: %{?scl:%{pkg_name}}%{!?scl:%{name}}-%{snapshot}.tar.gz
Patch1: rh-default.patch
Patch2: pybugz-0.11-7.git3459d-python2.patch
# Bug in yum, rhbz#1359084.
BuildArch: noarch
%description
Pybugz was conceived as a tool to speed up the work-flow for Gentoo Linux
@ -39,18 +45,20 @@ interface, the user can search, isolate and contribute to the project very
quickly. Developers alike can easily extract attachments and close bugs
comfortably from the command line.
%prep
%autosetup -p1 -n %{name}-%{snapshot}
%autosetup -p1 -n %{?scl:%pkg_name-%snapshot}%{?!scl:%name-%snapshot}
%build
%{__python3} setup.py build
%{?scl_enable}
%{__python2} setup.py build
%{?scl_disable}
%install
# default install process
%{__python3} setup.py install --root=%{buildroot}
%{?scl_enable}
%{__python} setup.py install --root=%{buildroot} --prefix=%{_prefix}
%{?scl_disable}
%global bash_cmpl_dir %(pkg-config --variable=completionsdir bash-completion)
%if 0%{?bash_completion}
@ -64,129 +72,23 @@ mkdir -p %{buildroot}%{_mandir}/man1
cp man/bugz.1 %{buildroot}%{_mandir}/man1/bugz.1
mkdir -p %{buildroot}%{_docdir}
%clean
%files
%{_bindir}/bugz
%{python3_sitelib}/bugz
%{python_sitelib}/bugz
%if 0%{?bash_completion}
%{bash_cmpl_dir}/bugz
%endif
%{python3_sitelib}/%{name}-*.egg-info
%{python_sitelib}/%{?scl:%pkg_name}%{!?scl:%{name}}-*.egg-info
%{_mandir}/man1/bugz.1.gz
%{_datadir}/pybugz.d/
%{_mandir}/man5/*
%doc README LICENSE
%changelog
* Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-20.gitbb0ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
* Wed Jun 03 2026 Python Maint <python-maint@redhat.com> - 0.13-19.gitbb0ae
- Rebuilt for Python 3.15
* Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-18.gitbb0ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
* Fri Sep 19 2025 Python Maint <python-maint@redhat.com> - 0.13-17.gitbb0ae
- Rebuilt for Python 3.14.0rc3 bytecode
* Fri Aug 15 2025 Python Maint <python-maint@redhat.com> - 0.13-16.gitbb0ae
- Rebuilt for Python 3.14.0rc2 bytecode
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-15.gitbb0ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Mon Jun 02 2025 Python Maint <python-maint@redhat.com> - 0.13-14.gitbb0ae
- Rebuilt for Python 3.14
* Sat Jan 18 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-13.gitbb0ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Mon Jul 29 2024 Miroslav Suchý <msuchy@redhat.com> - 0.13-12.gitbb0ae
- convert license to SPDX
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-11.gitbb0ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 0.13-10.gitbb0ae
- Rebuilt for Python 3.13
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-9.gitbb0ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-8.gitbb0ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-7.gitbb0ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 0.13-6.gitbb0ae
- Rebuilt for Python 3.12
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-5.gitbb0ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-4.gitbb0ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 0.13-3.gitbb0ae
- Rebuilt for Python 3.11
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.13-2.gitbb0ae
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Dec 03 2021 Pavel Raiskup <praiskup@redhat.com> - 0.13-1.gitbb0ae
- rebase to the latest git HEAD
- allow 'limit: ' configuration, and set limit=1000 for the Red Hat Bugzilla instance
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-23.git3459d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.11-22.git3459d
- Rebuilt for Python 3.10
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-21.git3459d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-20.git3459d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.11-19.git3459d
- Rebuilt for Python 3.9
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-18.git3459d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.11-17.git3459d
- Rebuilt for Python 3.8.0rc1 (#1748018)
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.11-16.git3459d
- Rebuilt for Python 3.8
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-15.git3459d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-14.git3459d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-13.git3459d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.11-12.git3459d
- Rebuilt for Python 3.7
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-11.git3459d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-10.git3459d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.11-9.git3459d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.11-8.git3459d
- Rebuild for Python 3.6
* Wed Jul 20 2016 Pavel Raiskup <praiskup@redhat.com> - 0.11-7.git3459d
- fun with scls
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11-7.git3459d
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

21
rh-default.patch Normal file
View file

@ -0,0 +1,21 @@
From 7e2b0baa8f8229668fb23f30bb741dfd79b412b4 Mon Sep 17 00:00:00 2001
From: Pavel Raiskup <praiskup@redhat.com>
Date: Mon, 19 Oct 2015 15:49:00 +0200
Subject: [PATCH] config: set RedHat connection as default
---
pybugz.d/default.conf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pybugz.d/default.conf b/pybugz.d/default.conf
index 33d48d6..c3fe9cd 100644
--- a/pybugz.d/default.conf
+++ b/pybugz.d/default.conf
@@ -1,3 +1,3 @@
[default]
-connection = Gentoo
+connection = RedHat
search_statuses = CONFIRMED IN_PROGRESS UNCONFIRMED
--
2.5.0

View file

@ -1 +1 @@
SHA512 (pybugz-0.13-gitbb0ae.tar.gz) = cca9c875f747d2a5153ee79aee68d7c83fc86a25f31ae035ca7c11f74fa4fe7a5df57562fedb5447d126d0747762b7af4bd33fdf54d0c6fe9cd08893a3261383
d061d49b70858c64a1d24b3c11f7d9be pybugz-0.11-git3459d.tar.gz