Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opensuse template updates and pep8 fixes #91

Merged
merged 2 commits into from
Dec 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions py2pack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ def _license_from_classifiers(data):

def _normalize_license(data):
"""try to get SDPX license"""
l = data.get('license', None)
if not l:
license = data.get('license', None)
if not license:
# try to get license from classifiers
l = _license_from_classifiers(data)
if l:
if l in SDPX_LICENSES.keys():
data['license'] = SDPX_LICENSES[l]
license = _license_from_classifiers(data)
if license:
if license in SDPX_LICENSES.keys():
data['license'] = SDPX_LICENSES[license]
else:
data['license'] = "%s (FIXME:No SPDX)" % (l)
data['license'] = "%s (FIXME:No SPDX)" % (license)
else:
data['license'] = ""

Expand Down
4 changes: 2 additions & 2 deletions py2pack/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

try:
import http.client as httplib
except:
except ImportError:
import httplib
try:
import xmlrpc.client as xmlrpclib
except:
except ImportError:
import xmlrpclib


Expand Down
2 changes: 1 addition & 1 deletion py2pack/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def run(self):
try:
subprocess.call(["xsltproc", "--output", "doc/py2pack.html", "/usr/share/xml/docbook/stylesheet/nwalsh/current/html/docbook.xsl", "doc/src/py2pack.xml.in"])
subprocess.call(["xsltproc", "--output", "doc/py2pack.1", "/usr/share/xml/docbook/stylesheet/nwalsh/current/manpages/docbook.xsl", "doc/src/py2pack.xml.in"])
except:
except OSError:
pass


Expand Down
12 changes: 3 additions & 9 deletions py2pack/templates/opensuse.spec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without test
Name: python-{{ name }}
Version: {{ version }}
Release: 0
Expand All @@ -33,20 +32,18 @@ BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module {{ req }}}
{%- endfor %}
{%- endif %}
{%- if (install_requires and install_requires is not none) or (tests_require and tests_require is not none) %}
# SECTION test requirements
{%- if install_requires and install_requires is not none %}
%if %{with test}
{%- for req in install_requires|sort %}
BuildRequires: %{python_module {{ req }}}
{%- endfor %}
%endif
{%- endif %}
{%- if tests_require and tests_require is not none %}
# SECTION test requirements
%if %{with test}
{%- for req in tests_require|sort %}
BuildRequires: %{python_module {{ req }}}
{%- endfor %}
%endif
{%- endif %}
# /SECTION
{%- endif %}
{%- if source_url.endswith('.zip') %}
Expand Down Expand Up @@ -90,14 +87,11 @@ BuildArch: noarch
{%- endif %}

{%- if testsuite or test_suite %}
%if %{with test}
%check
%python_exec setup.py test
%endif
{%- endif %}

%files %{python_files}
%defattr(-,root,root,-)
{%- if doc_files and doc_files is not none %}
%doc {{ doc_files|join(" ") }}
{%- endif %}
Expand Down
2 changes: 1 addition & 1 deletion py2pack/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

try:
from pbr import version as pbr_version
except:
except ImportError:
# no pbr available
version = 'unknown'
pass
Expand Down
2 changes: 0 additions & 2 deletions test/examples/py2pack-opensuse.spec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without test
Name: python-py2pack
Version: 0.8.0
Release: 0
Expand Down Expand Up @@ -180,7 +179,6 @@ on your system.
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%files %{python_files}
%defattr(-,root,root,-)
%{python_sitelib}/*

%changelog