From 02bbb9a64f4562624e111ab23bcbbd93ef7b45a5 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Aug 12 2018 13:15:36 +0000 Subject: Drop python2 subpackage Signed-off-by: Igor Gnatenko --- diff --git a/0001-use-system-compyte.patch b/0001-use-system-compyte.patch deleted file mode 100644 index 072f8a6..0000000 --- a/0001-use-system-compyte.patch +++ /dev/null @@ -1,126 +0,0 @@ -From 59cd4f60e8a70a4825ece5db0201f3eca1f4260e Mon Sep 17 00:00:00 2001 -From: Igor Gnatenko -Date: Sat, 24 Oct 2015 12:51:23 +0200 -Subject: [PATCH 1/3] use system compyte - -Signed-off-by: Igor Gnatenko ---- - pyopencl/array.py | 2 +- - pyopencl/cffi_cl.py | 2 +- - pyopencl/reduction.py | 2 +- - pyopencl/tools.py | 10 +++++----- - setup.py | 12 ------------ - 5 files changed, 8 insertions(+), 20 deletions(-) - -diff --git a/pyopencl/array.py b/pyopencl/array.py -index 4d5334b..8c2c050 100644 ---- a/pyopencl/array.py -+++ b/pyopencl/array.py -@@ -34,7 +34,7 @@ import numpy as np - import pyopencl.elementwise as elementwise - import pyopencl as cl - from pytools import memoize_method --from pyopencl.compyte.array import ( -+from compyte.array import ( - as_strided as _as_strided, - f_contiguous_strides as _f_contiguous_strides, - c_contiguous_strides as _c_contiguous_strides, -diff --git a/pyopencl/cffi_cl.py b/pyopencl/cffi_cl.py -index c5effc7..f9a2ff8 100644 ---- a/pyopencl/cffi_cl.py -+++ b/pyopencl/cffi_cl.py -@@ -37,7 +37,7 @@ import re - from pytools import memoize_method - - from pyopencl._cffi import ffi as _ffi --from .compyte.array import f_contiguous_strides, c_contiguous_strides -+from compyte.array import f_contiguous_strides, c_contiguous_strides - - - from pyopencl._cffi import lib as _lib -diff --git a/pyopencl/reduction.py b/pyopencl/reduction.py -index 7c01741..acb96d1 100644 ---- a/pyopencl/reduction.py -+++ b/pyopencl/reduction.py -@@ -514,7 +514,7 @@ def _get_dot_expr(dtype_out, dtype_a, dtype_b, conjugate_first, - dtype_b = dtype_a - - if dtype_out is None: -- from pyopencl.compyte.array import get_common_dtype -+ from compyte.array import get_common_dtype - dtype_out = get_common_dtype( - dtype_a.type(0), dtype_b.type(0), - has_double_support) -diff --git a/pyopencl/tools.py b/pyopencl/tools.py -index 6a72ee9..38ae708 100644 ---- a/pyopencl/tools.py -+++ b/pyopencl/tools.py -@@ -40,13 +40,13 @@ from pytools.persistent_dict import KeyBuilder as KeyBuilderBase - - import re - --from pyopencl.compyte.dtypes import ( # noqa -+from compyte.dtypes import ( # noqa - get_or_register_dtype, TypeNameNotKnown, - register_dtype, dtype_to_ctype) - - - def _register_types(): -- from pyopencl.compyte.dtypes import ( -+ from compyte.dtypes import ( - TYPE_REGISTRY, fill_registry_with_opencl_c_types) - - fill_registry_with_opencl_c_types(TYPE_REGISTRY) -@@ -345,7 +345,7 @@ def parse_c_arg(c_arg, with_offset=False): - else: - vec_arg_factory = VectorArg - -- from pyopencl.compyte.dtypes import parse_c_arg_backend -+ from compyte.dtypes import parse_c_arg_backend - return parse_c_arg_backend(c_arg, ScalarArg, vec_arg_factory) - - -@@ -781,7 +781,7 @@ class _TemplateRenderer(object): - try: - return self.type_aliases[typename] - except KeyError: -- from pyopencl.compyte.dtypes import NAME_TO_DTYPE -+ from compyte.dtypes import NAME_TO_DTYPE - return NAME_TO_DTYPE[typename] - else: - return np.dtype(typename) -@@ -819,7 +819,7 @@ class _TemplateRenderer(object): - else: - vec_arg_factory = _VectorArgPlaceholder - -- from pyopencl.compyte.dtypes import parse_c_arg_backend -+ from compyte.dtypes import parse_c_arg_backend - parsed_args = [] - for arg in all_args: - if isinstance(arg, str): -diff --git a/setup.py b/setup.py -index 3a66674..4ca9284 100644 ---- a/setup.py -+++ b/setup.py -@@ -169,18 +169,6 @@ def main(): - from aksetup_helper import count_down_delay - count_down_delay(delay=5) - -- if not exists("pyopencl/compyte/dtypes.py"): -- print(75 * "-") -- print("You are missing important files from the pyopencl distribution.") -- print(75 * "-") -- print("You may have downloaded a zip or tar file from Github.") -- print("Those do not work, and I am unable to prevent Github from showing") -- print("them. Delete that file, and get an actual release file from the") -- print("Python package index:") -- print() -- print("https://pypi.python.org/pypi/pyopencl") -- sys.exit(1) -- - # {{{ write cffi build script - - with open("cffi_build.py.in", "rt") as f: --- -2.15.1 - diff --git a/python-pyopencl.spec b/python-pyopencl.spec index 49fb059..0f1f4fc 100644 --- a/python-pyopencl.spec +++ b/python-pyopencl.spec @@ -1,16 +1,10 @@ +%{?python_enable_dependency_generator} + %global srcname pyopencl -# It is hard to run tests -%bcond_with tests -# POCL arches -%ifarch aarch64 ppc64 ppc64le s390 s390x -#bcond_with tests -%else -#bcond_without tests -%endif Name: python-%{srcname} Version: 2018.1.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Python wrapper for OpenCL # https://bugzilla.redhat.com/show_bug.cgi?id=1219819#c16 @@ -36,9 +30,6 @@ Summary: Python wrapper for OpenCL License: MIT and Boost and ASL 2.0 and GPLv2 and BSD URL: https://mathema.tician.de/software/pyopencl Source0: %{pypi_source} -# https://github.com/inducer/compyte/pull/24 -# Upstream maintainer not interested to unbundle compyte -#Patch0: 0001-use-system-compyte.patch Patch1: 0002-disable-executing-git-submodule.patch # Have not asked upstream, but they want to enforce CFLAGS/LDFLAGS Patch2: 0003-don-t-hack-distutils-with-C-LDFLAGS.patch @@ -63,9 +54,6 @@ BuildRequires: atlas-devel BuildRequires: blas-devel BuildRequires: pkgconfig(libffi) BuildRequires: pkgconfig(gl) -%if %{with tests} -BuildRequires: pocl -%endif %global _description \ PyOpenCL makes it possible to access GPUs and other massively\ @@ -75,61 +63,14 @@ API in a manner similar to the sister project `PyCUDA`. %description %{_description} -%package -n python2-%{srcname} -Summary: Python 2 wrapper for OpenCL -%{?python_provide:%python_provide python2-%{srcname}} -BuildRequires: python2-devel -BuildRequires: python2-setuptools -BuildRequires: python2-numpy -BuildRequires: python2-cffi -%if %{with tests} -BuildRequires: python2-pytest -#BuildRequires: python2-compyte -BuildRequires: python2-pytools >= 2017.2 -BuildRequires: python2-decorator -BuildRequires: python2-appdirs -BuildRequires: python2-six -BuildRequires: python2-mako -BuildRequires: python2-scipy -%endif -#Requires: python2-compyte -Requires: python2-numpy -Requires: python2-pytools >= 2017.2 -Requires: python2-decorator -Requires: python2-cffi -Requires: python2-appdirs -Requires: python2-six -Requires: python2-mako - -%description -n python2-%{srcname} %{_description} - -Python 2 version. - %package -n python3-%{srcname} Summary: Python 3 wrapper for OpenCL %{?python_provide:%python_provide python3-%{srcname}} BuildRequires: python3-devel BuildRequires: python3-setuptools -BuildRequires: python3-numpy -BuildRequires: python3-cffi -%if %{with tests} -BuildRequires: python3-pytest -#BuildRequires: python3-compyte -BuildRequires: python3-pytools >= 2017.2 -BuildRequires: python3-decorator -BuildRequires: python3-appdirs -BuildRequires: python3-six -BuildRequires: python3-mako -BuildRequires: python3-scipy -%endif -#Requires: python3-compyte -Requires: python3-numpy -Requires: python3-pytools >= 2017.2 -Requires: python3-decorator -Requires: python3-cffi -Requires: python3-appdirs -Requires: python3-six -Requires: python3-mako +BuildRequires: python3dist(numpy) +BuildRequires: python3dist(cffi) >= 1.1.0 +Recommends: python%{python3_version}dist(Mako) >= 0.3.6 %description -n python3-%{srcname} %{_description} @@ -147,33 +88,13 @@ rm -vf examples/download-examples-from-wiki.py %build %{__python3} configure.py --cl-enable-gl -%py2_build %py3_build %install -%py2_install %py3_install -find %{buildroot}%{python2_sitearch}/%{srcname} -name '*.so' -exec chmod 755 {} \+ find %{buildroot}%{python3_sitearch}/%{srcname} -name '*.so' -exec chmod 755 {} \+ -%if %{with tests} -%check -pushd test/ - export PYTHONPATH=%{buildroot}%{python2_sitearch} - find -name '*.py' -exec py.test-%{python2_version} -v {} \+ - - export PYTHONPATH=%{buildroot}%{python3_sitearch} - find -name '*.py' -exec py.test-%{python3_version} -v {} \+ -popd -%endif - -%files -n python2-%{srcname} -%license LICENSE -%doc examples -%{python2_sitearch}/%{srcname}/ -%{python2_sitearch}/%{srcname}-*.egg-info/ - %files -n python3-%{srcname} %license LICENSE %doc examples @@ -181,6 +102,9 @@ popd %{python3_sitearch}/%{srcname}-*.egg-info/ %changelog +* Sun Aug 12 2018 Igor Gnatenko - 2018.1.1-3 +- Drop python2 subpackage + * Tue Jul 31 2018 Florian Weimer - 2018.1.1-2 - Rebuild with fixed binutils