# we have a circular (build) dependency with the (new) pytest package # when generating the docs or running the testsuite %global with_docs 0 %global run_check 0 %global pytest_version 2.5 %global project_description %{expand: The py lib is a Python development support library featuring the following tools and modules: * py.path: uniform local and svn path objects * py.apipkg: explicit API control and lazy-importing * py.iniconfig: easy parsing of .ini files * py.code: dynamic code generation and introspection * py.path: uniform local and svn path objects} %if 0%{?epel} >= 7 %bcond_without python3_other %endif Name: python3-py Version: 1.4.30 Release: 3%{?dist} Summary: Library with cross-python path, ini-parsing, io, code, log facilities License: MIT and Public Domain # main package: MIT, except: doc/style.css: Public Domain URL: http://pylib.readthedocs.org/ Source: http://pypi.python.org/packages/source/p/py/py-%{version}.tar.gz BuildArch: noarch %if 0%{?with_docs} BuildRequires: python-sphinx %endif # with_docs %if 0%{?run_check} # needed by the testsuite BuildRequires: subversion %endif # run_check %description %{project_description} %package -n python%{python3_pkgversion}-py Summary: %{summary} Requires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools %if 0%{?run_check} BuildRequires: python%{python3_pkgversion}-pytest >= %{pytest_version} %endif # run_check %description -n python%{python3_pkgversion}-py %{project_description} %if %{with python3_other} %package -n python%{python3_other_pkgversion}-py Summary: %{summary} Requires: python%{python3_other_pkgversion}-setuptools BuildRequires: python%{python3_other_pkgversion}-devel BuildRequires: python%{python3_other_pkgversion}-setuptools %if 0%{?run_check} BuildRequires: python%{python3_other_pkgversion}-pytest >= %{pytest_version} %endif # run_check %description -n python%{python3_other_pkgversion}-py %{project_description} %endif # python3_other %prep %setup -q -n py-%{version} # remove shebangs and fix permissions find -type f -a \( -name '*.py' -o -name 'py.*' \) \ -exec sed -i '1{/^#!/d}' {} + \ -exec chmod u=rw,go=r {} + # fix line-endings sed -i 's/\r//' README.txt %build %{py3_build} %{?with_python3_other:%py3_other_build} %if 0%{?with_docs} make -C doc html PYTHONPATH=$(pwd) %endif # with_docs %install %{?with_python3_other:%py3_other_install} %{py3_install} %check %if 0%{?run_check} PYTHONPATH=%{buildroot}%{python3_sitelib} \ LC_ALL="en_US.UTF-8" \ py.test-%{python3_version} -r s -k"-TestWCSvnCommandPath" testing %if 0%{with python3_other} PYTHONPATH=%{buildroot}%{python3_other_sitelib} \ LC_ALL="en_US.UTF-8" \ py.test-%{python3_other_version} -r s -k"-TestWCSvnCommandPath" testing %endif # python3_other %endif # run_check %files -n python%{python3_pkgversion}-py %license LICENSE %doc CHANGELOG README.txt %if 0%{?with_docs} # HTML docs generated with Python2 for now %doc doc/_build/html %endif # with_docs %{python3_sitelib}/* %if %{with python3_other} %license LICENSE %doc CHANGELOG README.txt %if 0%{?with_docs} # HTML docs generated with Python2 for now %doc doc/_build/html %endif # with_docs %{python3_other_sitelib}/* %endif # python3_other %changelog * Fri Jan 11 2019 Mikhail Ushanov - 1.4.30-3 - Add python3_other subpackage * Wed Dec 30 2015 Orion Poplawski - 1.4.30-2 - Drop group tag - Minor cleanup * Tue Dec 29 2015 Orion Poplawski - 1.4.30-1 - Initial EPEL package