# note: PROJ_MIN_VERSION is defined in the setup.py file of pyproj # a compatibility matrix is also provided in docs/installation.rst %global minimal_needed_proj_version 8.2.0 Name: pyproj Version: 3.4.1 Release: 3%{?dist} Summary: Cython wrapper to provide python interfaces to Proj # this software uses the "MIT:Modern Style with sublicense" license License: MIT URL: https://github.com/jswhit/%{name} Source0: https://files.pythonhosted.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz # Change the pygments style to default, since the material style is not # available in EPEL9 Patch1: pyproj-sphynx-pygments.patch # unmodified test/test_transformer.py currently has 4 test failures # # These 2: # test_transformer__area_of_interest # test_transformer_proj__area_of_inter # are known problems for proj v9.5 and above. # see: https://github.com/pyproj4/pyproj/issues/1432 # # For test_repr and test_transform_bounds__ignore_inf # I could not find a reason why they fail for proj 9.6.0 # # This patch fixes the first 2 mentioned tests and disables the last 2 tests Patch2: pyproj_fix_test_transformer.patch # unmodified test/crs/test_crs.py currently has 2 test failures # The 2 failing tests are test_datum_unknown and test_datum__from_epsg # This patch disables these 2 tests cases. Patch3: pyproj_disable_test_crs_failures.patch # unmodified test/crs/test_crs_cf.py currently has 2 test failures # The 2 failing tests are test_oblique_mercator_losing_gamma # and test_azimuthal_equidistant # This patch disables these 2 tests cases. Patch4: pyproj_disable_test_crs_cf_failures.patch BuildRequires: make BuildRequires: gcc BuildRequires: proj-devel >= %{minimal_needed_proj_version} BuildRequires: proj >= %{minimal_needed_proj_version} BuildRequires: python3-setuptools BuildRequires: python3-devel BuildRequires: python3-numpy BuildRequires: python3-Cython BuildRequires: python3-certifi # needed to run the tests BuildRequires: python3-pytest # not yet available for EPEL9: # BuildRequires: python3-pandas BuildRequires: python3-shapely # not yet available for EPEL9: # BuildRequires: python3-xarray # needed to remove the hardcoded rpath '/usr/lib' from the _proj.so file BuildRequires: chrpath # needed to build the documentation BuildRequires: python3-sphinx BuildRequires: python3-sphinx-argparse BuildRequires: python3-sphinx_rtd_theme %global _description \ Cython wrapper to provide python interfaces to Proj. \ Performs cartographic transformations between geographic (Lat/Lon) \ and map projection (x/y) coordinates. Can also transform directly \ from one map projection coordinate system to another. \ Coordinates can be given as numpy arrays, python arrays, lists or scalars. \ Optimized for numpy arrays. %description %_description %package -n python3-%{name} Summary: %summary Requires: proj >= %{minimal_needed_proj_version} # Add shapely as (optional/weak) dependency. # For details see: https://github.com/pyproj4/pyproj/issues/1470 Recommends: python3-shapely # ensure python provides are provided when python3 becomes the default runtime %{?python_provide:%python_provide python3-%{name}} %description -n python3-%{name} %_description %package -n python3-%{name}-doc Summary: Documentation and example code BuildArch: noarch %description -n python3-%{name}-doc This package contains the html documentation for the pyproj module. %prep %autosetup -p1 # 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}/" %py3_build # generate documentation cd docs # Need to point to the build dir so sphinx can import the module # before it is installed. # Note that the new Python macros have %%{pyproject_build_lib} for this, # but this package uses the old macros, so we need to replicate the behavior manually. # The path has changed in setuptools 62.4.0, see https://bugzilla.redhat.com/2097115 %global py_build_libdir_old %{_builddir}/%{buildsubdir}/build/lib.%{python3_platform}-%{python3_version} %global py_build_libdir_new %{_builddir}/%{buildsubdir}/build/lib.%{python3_platform}-cpython-%{python3_version_nodots} # NOTE: need to add %%{_builddir}/%%{buildsubdir} as well to the path # since sphinx needs to be able to find the PKG-INFO file # before it will generate the documentation, # and this is the only place where it is available before installation. # (see: https://github.com/python/importlib_metadata/issues/364) export PYTHONPATH=%{py_build_libdir_old}:%{py_build_libdir_new}:%{_builddir}/%{buildsubdir} # default theme is now "furo" which is not available in fedora # (see BZ #1910798 and https://github.com/pyproj4/pyproj/discussions/1134) # so fall back to the previous theme: export PYPROJ_HTML_THEME=sphinx_rtd_theme make html make man # rpmlint complains many times with the rather cryptic warning: # "a special character is not allowed in a name" # Actually for this man page this indicates a syntax error, since # it does not have a space after ".B" in many places. # (it is not clear to me where this originates, from the sphinx tool # or the input sources.) # This sed command corrects for this problem. sed -i -e 's/^\.B\\-/\.B \\-/g' %{_builddir}/%{name}-%{version}/docs/_build/man/pyproj.1 %install export PROJ_DIR="%{_usr}/" %py3_install # ensure the autogenerated hidden .buildinfo file is not included # since rpmlint does not like hidden files in the documentation %{__rm} %{_builddir}/%{name}-%{version}/docs/_build/html/.buildinfo # move html documentation to datadir/doc mkdir -p %{buildroot}%{_datadir}/doc/%{name} mv %{_builddir}/%{name}-%{version}/docs/_build/html \ %{buildroot}%{_datadir}/doc/%{name}/html # copy pyproj man page mkdir -p %{buildroot}/%{_mandir}/man1 cp %{_builddir}/%{name}-%{version}/docs/_build/man/pyproj.1 \ %{buildroot}/%{_mandir}/man1/ # remove the documentation sources and generated doctrees # since they dont belong in the main package %{__rm} -rf %{_builddir}/%{name}-%{version}/docs # correct wrong write permission for group %{__chmod} 755 %{buildroot}/%{python3_sitearch}/%{name}/*.so # remove the rpath setting from _proj.so chrpath -d %{buildroot}/%{python3_sitearch}/%{name}/*.so %check # check importing the pyproj module %py3_check_import pyproj # follow the hint given in pyproj github issue # https://github.com/pyproj4/pyproj/issues/647 # i.e. take the test folder outside the build folder # to prevent the # cannot import name '_datadir' from partially initialized module # 'pyproj' (most likely due to a circular import) # error. # (probably this is not needed anymore but it doesn't hurt to leave this in) cd .. mkdir pyproj-test-folder cd pyproj-test-folder cp -r ../pyproj-%{version}/test . cp ../pyproj-%{version}/pytest.ini . # disable test_utils.py for now, since that is the only test module # that requires pandas and xarray PATH="%{buildroot}%{_bindir}:$PATH" \ PYTHONPATH="%{buildroot}%{python3_sitearch}" \ py.test-3 -m "not network" --ignore=test/test_utils.py # some notes on the test suite: # total number of testcases for version 3.4.1 is 827. # -m "not network" ==> deselects 24 tests # --ignore=test/test_utils.py ==> disables 7 test cases # this test/test_utils.py module imports pandas and xarray and cannot be used # as long as those python modules are not packaged for epel9 # network: these tests depend on downloading data from the network # which is not possible during the build process. %files -n python3-%{name} %doc README.md %{_bindir}/%{name} %{python3_sitearch}/%{name}/ %{python3_sitearch}/%{name}-*-py*.egg-info/ %{_mandir}/man1/pyproj* %files -n python3-%{name}-doc %doc %{_datadir}/doc/%{name}/ %changelog * Sun Jan 08 2026 Jos de Kloe 3.4.1-3 - Ensure the package builds again after proj was upgraded to v.9.6.0 * Tue Jun 24 2025 Orion Poplawski - 3.4.1-2 - Rebuild for proj 9 * Sun Jan 08 2023 Jos de Kloe 3.4.1-1 - First EPEL9 version