From 66a96f4374cd50d3f500b5942017fe8c4deb5c79 Mon Sep 17 00:00:00 2001 From: Jos de Kloe Date: Nov 23 2019 13:19:27 +0000 Subject: Patch bug that caused 6 failing tests on i686 architecture and clean up some no longer needed fixes --- diff --git a/.gitignore b/.gitignore index f46a000..4d7caa7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +/pyproj-2.2.1.tar.gz /pyproj-2.3.1.tar.gz /pyproj-2.4.1.tar.gz diff --git a/pyproj.spec b/pyproj.spec index 30ef68d..cbd22c1 100644 --- a/pyproj.spec +++ b/pyproj.spec @@ -1,44 +1,43 @@ # avoid providing the private libs: -%if 0%{?fedora} || 0%{?rhel} >= 7 - %global __provides_exclude_from ^(%{python3_sitearch})/.*\\.so.*$ - -%else -# only for rhel 6 or before -%{?filter_setup: -%filter_provides_in %{python2_sitearch}.*\.so$ -%filter_setup -} -%endif - %global minimal_needed_proj_version 6.2.0 -Name: pyproj -Version: 2.4.1 -Release: 1%{?dist} -Summary: Cython wrapper to provide python interfaces to Proj +Name: pyproj +Version: 2.4.1 +Release: 2%{?dist} +Summary: Cython wrapper to provide python interfaces to Proj -License: MIT -URL: https://github.com/jswhit/%{name} -Source0: https://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz +License: MIT +URL: https://github.com/jswhit/%{name} +Source0: https://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz # the old source url still works, but if need be it can be replaced # with: https://files.pythonhosted.org/packages/source/p/%%{name}/%%{name}-%%{version}.tar.gz -BuildRequires: gcc -BuildRequires: proj-devel >= %{minimal_needed_proj_version} -BuildRequires: proj >= %{minimal_needed_proj_version} +# patch a bug causing 6 test failures on i686/32-bit architecture +# see bug report https://github.com/pyproj4/pyproj/issues/481 +# and pull request https://github.com/pyproj4/pyproj/pull/490 +Patch1: pyproj_init_pj_coord.patch + +BuildRequires: gcc +BuildRequires: proj-devel >= %{minimal_needed_proj_version} +BuildRequires: proj >= %{minimal_needed_proj_version} + +BuildRequires: python3-devel +BuildRequires: python3-numpy +BuildRequires: python3-Cython # needed to run the tests -BuildRequires: python3-pytest -BuildRequires: python3-mock +BuildRequires: python3-pytest +BuildRequires: python3-mock +BuildRequires: python3-shapely # needed to remove the hardcoded path '/usr/lib' from the _proj.so file -BuildRequires: chrpath +BuildRequires: chrpath # needed to build the documentation -BuildRequires: python3-sphinx -BuildRequires: python3-sphinx_rtd_theme +BuildRequires: python3-sphinx +BuildRequires: python3-sphinx_rtd_theme %global _description \ Cython wrapper to provide python interfaces to Proj. \ @@ -55,14 +54,7 @@ Optimized for numpy arrays. Summary: %summary -BuildRequires: python3-devel -BuildRequires: python3-numpy -BuildRequires: python3-Cython -# needed during unittesting -BuildRequires: python3-nose2 -#?? BuildRequires: python3-mock - -Requires: proj >= %{minimal_needed_proj_version} +Requires: proj >= %{minimal_needed_proj_version} # ensure python provides are provided when python3 becomes the default runtime %{?python_provide:%python_provide python3-%{name}} @@ -78,17 +70,13 @@ BuildArch: noarch This package contains the html documentation for the pyproj module. %prep -%setup -q +%autosetup -p1 # Delete Cython generated files rm -v $(grep -rl '/\* Generated by Cython') -# patch python version to point to python3 in docs/Makefile and docs/conf.py -# note: a patch to solve these issues upstream has been proposed and accepted -# see: https://github.com/pyproj4/pyproj/commit/7ede45b61e604a5619fdc16f1268b822ab6c3227 - -sed -i -e 's/= python /= python3 /g' docs/Makefile -sed -i -e 's/^#!\/usr\/bin\/env python/#!\/usr\/bin\/python3/g' docs/conf.py +# remove use of /usr/bin/env in docs/conf.py +sed -i -e 's/^#!\/usr\/bin\/env python3/#!\/usr\/bin\/python3/g' docs/conf.py %build export PROJ_DIR="%{_usr}/" @@ -143,28 +131,9 @@ chrpath -d %{buildroot}/%{python3_sitearch}/%{name}/*.so %check -# the test run for the i686 platform gives 6 failing tests -# for pyproj 2.4.1, see: -# https://github.com/pyproj4/pyproj/issues/481 -# so for now disable the tests for this platform. -# and replace it with a simpler test. -# (taken from the appveyor.yml script of pyproj) - -%ifarch i686 - -# a cd is required, since the next test works fine everywhere -# except when the current dir is in the pyproj source dir.... -cd -PYTHONPATH="%{buildroot}%{python3_sitearch}" \ -%{__python3} -c "import pyproj; pyproj.Proj('epsg:4269')" - -%else - PYTHONPATH="%{buildroot}%{python3_sitearch}" \ py.test-3 -%endif - %files -n python3-%{name} %doc docs README.md %{python3_sitearch}/%{name}/ @@ -175,6 +144,10 @@ py.test-3 %changelog +* Sat Nov 23 2019 Jos de Kloe 2.4.1-2 +- Patch bug that caused 6 failing tests on i686 architecture + and clean up some no longer needed fixes + * Sat Nov 9 2019 Jos de Kloe 2.4.1-1 - Update to 2.4.1 diff --git a/pyproj_init_pj_coord.patch b/pyproj_init_pj_coord.patch new file mode 100644 index 0000000..9175160 --- /dev/null +++ b/pyproj_init_pj_coord.patch @@ -0,0 +1,20 @@ +--- pyproj-2.4.1.unchanged/pyproj/_proj.pyx 2019-10-31 00:38:17.000000000 +0100 ++++ pyproj-2.4.1/pyproj/_proj.pyx 2019-11-23 13:09:05.965987907 +0100 +@@ -58,7 +58,7 @@ cdef class Proj: + raised and 1.e30 is returned. + """ + cdef PJ_COORD projxyout +- cdef PJ_COORD projlonlatin ++ cdef PJ_COORD projlonlatin = proj_coord(0, 0, 0, float("inf")) + cdef Py_ssize_t buflenx, bufleny, ndim, iii + cdef double *lonsdata + cdef double *latsdata +@@ -134,7 +134,7 @@ cdef class Proj: + if not self.has_inverse: + raise ProjError('inverse projection undefined') + +- cdef PJ_COORD projxyin ++ cdef PJ_COORD projxyin = proj_coord(0, 0, 0, float("inf")) + cdef PJ_COORD projlonlatout + cdef Py_ssize_t buflenx, bufleny, ndim, iii + cdef void *xdata