Skip to content

Commit

Permalink
Merge pull request #85 from hlin/master
Browse files Browse the repository at this point in the history
Drop python2 support
  • Loading branch information
hlin authored Aug 2, 2019
2 parents 4cbdaa0 + 6155b94 commit 143abf3
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 89 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ services: docker
matrix:
include:
# https://hub.docker.com/_/fedora/
- env: CONTAINER_IMAGE=fedora:29 TOXENV=py37
# will use centos:8 after it released
- env: CONTAINER_IMAGE=fedora:28 TOXENV=py36
# https://hub.docker.com/_/centos/
- env: CONTAINER_IMAGE=centos:7 TOXENV=py27

install:
- ./.travis/install.sh
Expand Down
23 changes: 0 additions & 23 deletions .travis/Dockerfile.centos:7

This file was deleted.

22 changes: 0 additions & 22 deletions .travis/Dockerfile.fedora:29

This file was deleted.

39 changes: 1 addition & 38 deletions product-listings-manager.spec
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
%if 0%{?rhel} && 0%{?rhel} <= 7
%bcond_with python3
%else
%bcond_without python3
%endif

%global modname product_listings_manager

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

%if %{with python3}
BuildRequires: python3-devel
BuildRequires: python3-flask
BuildRequires: python3-flask-sqlalchemy
Expand All @@ -25,28 +18,13 @@ BuildRequires: python3-koji
BuildRequires: python3-psycopg2
BuildRequires: python3-setuptools
BuildRequires: python3-sqlalchemy
Requires: koji
Requires: python3-flask
Requires: python3-flask-sqlalchemy
Requires: python3-flask-restful
Requires: python3-koji
Requires: python3-psycopg2
Requires: python3-sqlalchemy
%else
BuildRequires: python2-devel
BuildRequires: python-flask
BuildRequires: python-flask-sqlalchemy
BuildRequires: python-psycopg2
BuildRequires: python-sqlalchemy
BuildRequires: python2-flask-restful
BuildRequires: python2-koji
BuildRequires: python2-setuptools
Requires: python-flask
Requires: python-flask-sqlalchemy
Requires: python-sqlalchemy
Requires: python2-flask-restful
Requires: python2-koji
Requires: python-psycopg2
%endif

%description
HTTP interface for finding product listings and interacting with data in
Expand All @@ -55,21 +33,11 @@ composedb.
%prep
%autosetup


%build
%if %{with python3}
%py3_build
%else
%py2_build
%endif


%install
%if %{with python3}
%py3_install
%else
%py2_install
%endif
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
cp -p %{modname}/config.py %{buildroot}%{_sysconfdir}/%{name}

Expand All @@ -79,13 +47,8 @@ cp -p %{modname}/config.py %{buildroot}%{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/config.py
%exclude %{_sysconfdir}/%{name}/config.pyc
%exclude %{_sysconfdir}/%{name}/config.pyo
%if %{with python3}
%{python3_sitelib}/%{modname}/
%{python3_sitelib}/%{modname}-*.egg-info/
%else
%{python2_sitelib}/%{modname}/
%{python2_sitelib}/%{modname}-*.egg-info/
%endif

%changelog
* Mon Jul 01 2019 Haibo Lin <hlin@redhat.com> 1.1.0-1
Expand Down
4 changes: 2 additions & 2 deletions product_listings_manager/products.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,11 @@ def getProductListings(productLabel, buildInfo):
listings.setdefault(variant, {}).setdefault(rpm['nvr'], {}).setdefault(rpm['arch'], []).append(dest_arch)

for variant in listings.keys():
nvrs = listings[variant].keys()
nvrs = list(listings[variant].keys())
# BREW-260: Read allow_src_only flag for the product/version
allow_src_only = Products.get_srconly_flag(productLabel, version)
if len(nvrs) == 1:
maps = listings[variant][nvrs[0]].keys()
maps = list(listings[variant][nvrs[0]].keys())
# BREW-260: check for allow_src_only flag added
if len(maps) == 1 and maps[0] == 'src' and not allow_src_only:
del listings[variant]
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27,py36,py37
envlist = py36

[testenv]
setenv =
Expand Down

0 comments on commit 143abf3

Please sign in to comment.