Skip to content

Commit 143abf3

Browse files
authored
Merge pull request #85 from hlin/master
Drop python2 support
2 parents 4cbdaa0 + 6155b94 commit 143abf3

6 files changed

Lines changed: 5 additions & 89 deletions

File tree

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ services: docker
55
matrix:
66
include:
77
# https://hub.docker.com/_/fedora/
8-
- env: CONTAINER_IMAGE=fedora:29 TOXENV=py37
8+
# will use centos:8 after it released
99
- env: CONTAINER_IMAGE=fedora:28 TOXENV=py36
10-
# https://hub.docker.com/_/centos/
11-
- env: CONTAINER_IMAGE=centos:7 TOXENV=py27
1210

1311
install:
1412
- ./.travis/install.sh

.travis/Dockerfile.centos:7

Lines changed: 0 additions & 23 deletions
This file was deleted.

.travis/Dockerfile.fedora:29

Lines changed: 0 additions & 22 deletions
This file was deleted.

product-listings-manager.spec

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
%if 0%{?rhel} && 0%{?rhel} <= 7
2-
%bcond_with python3
3-
%else
4-
%bcond_without python3
5-
%endif
6-
71
%global modname product_listings_manager
82

93
Name: product-listings-manager
@@ -16,7 +10,6 @@ URL: https://github.com/release-engineering/product-listings-manager
1610
Source0: %{name}-%{version}.tar.gz
1711
BuildArch: noarch
1812

19-
%if %{with python3}
2013
BuildRequires: python3-devel
2114
BuildRequires: python3-flask
2215
BuildRequires: python3-flask-sqlalchemy
@@ -25,28 +18,13 @@ BuildRequires: python3-koji
2518
BuildRequires: python3-psycopg2
2619
BuildRequires: python3-setuptools
2720
BuildRequires: python3-sqlalchemy
21+
Requires: koji
2822
Requires: python3-flask
2923
Requires: python3-flask-sqlalchemy
3024
Requires: python3-flask-restful
3125
Requires: python3-koji
3226
Requires: python3-psycopg2
3327
Requires: python3-sqlalchemy
34-
%else
35-
BuildRequires: python2-devel
36-
BuildRequires: python-flask
37-
BuildRequires: python-flask-sqlalchemy
38-
BuildRequires: python-psycopg2
39-
BuildRequires: python-sqlalchemy
40-
BuildRequires: python2-flask-restful
41-
BuildRequires: python2-koji
42-
BuildRequires: python2-setuptools
43-
Requires: python-flask
44-
Requires: python-flask-sqlalchemy
45-
Requires: python-sqlalchemy
46-
Requires: python2-flask-restful
47-
Requires: python2-koji
48-
Requires: python-psycopg2
49-
%endif
5028

5129
%description
5230
HTTP interface for finding product listings and interacting with data in
@@ -55,21 +33,11 @@ composedb.
5533
%prep
5634
%autosetup
5735

58-
5936
%build
60-
%if %{with python3}
6137
%py3_build
62-
%else
63-
%py2_build
64-
%endif
65-
6638

6739
%install
68-
%if %{with python3}
6940
%py3_install
70-
%else
71-
%py2_install
72-
%endif
7341
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
7442
cp -p %{modname}/config.py %{buildroot}%{_sysconfdir}/%{name}
7543

@@ -79,13 +47,8 @@ cp -p %{modname}/config.py %{buildroot}%{_sysconfdir}/%{name}
7947
%config(noreplace) %{_sysconfdir}/%{name}/config.py
8048
%exclude %{_sysconfdir}/%{name}/config.pyc
8149
%exclude %{_sysconfdir}/%{name}/config.pyo
82-
%if %{with python3}
8350
%{python3_sitelib}/%{modname}/
8451
%{python3_sitelib}/%{modname}-*.egg-info/
85-
%else
86-
%{python2_sitelib}/%{modname}/
87-
%{python2_sitelib}/%{modname}-*.egg-info/
88-
%endif
8952

9053
%changelog
9154
* Mon Jul 01 2019 Haibo Lin <hlin@redhat.com> 1.1.0-1

product_listings_manager/products.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,11 @@ def getProductListings(productLabel, buildInfo):
288288
listings.setdefault(variant, {}).setdefault(rpm['nvr'], {}).setdefault(rpm['arch'], []).append(dest_arch)
289289

290290
for variant in listings.keys():
291-
nvrs = listings[variant].keys()
291+
nvrs = list(listings[variant].keys())
292292
# BREW-260: Read allow_src_only flag for the product/version
293293
allow_src_only = Products.get_srconly_flag(productLabel, version)
294294
if len(nvrs) == 1:
295-
maps = listings[variant][nvrs[0]].keys()
295+
maps = list(listings[variant][nvrs[0]].keys())
296296
# BREW-260: check for allow_src_only flag added
297297
if len(maps) == 1 and maps[0] == 'src' and not allow_src_only:
298298
del listings[variant]

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py27,py36,py37
2+
envlist = py36
33

44
[testenv]
55
setenv =

0 commit comments

Comments
 (0)