Skip to content

BUG: Cython 3 compatibility fixes #1322

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

Merged
merged 1 commit into from
Jul 17, 2023
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
1 change: 1 addition & 0 deletions docs/history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Change Log
Latest
------
- BUG: Remove pkg_resources from setup.py (issue #1313)
- BUG: Cython 3 compatibility fixes (issue #1321)

3.6.0
------
Expand Down
4 changes: 2 additions & 2 deletions pyproj/_datadir.pxd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include "proj.pxi"

cpdef str _get_proj_error()
cpdef void _clear_proj_error()
cpdef str _get_proj_error() noexcept
cpdef void _clear_proj_error() noexcept
cdef PJ_CONTEXT* PYPROJ_GLOBAL_CONTEXT
cdef PJ_CONTEXT* pyproj_context_create() except *
cdef void pyproj_context_destroy(PJ_CONTEXT* context) except *
7 changes: 3 additions & 4 deletions pyproj/_datadir.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ from libc.stdlib cimport free, malloc

from pyproj._compat cimport cstrencode

from pyproj.exceptions import DataDirError
from pyproj.utils import strtobool

# for logging the internal PROJ messages
Expand Down Expand Up @@ -79,22 +78,22 @@ def get_user_data_dir(create=False):
)


cpdef str _get_proj_error():
cpdef str _get_proj_error() noexcept:
"""
Get the internal PROJ error message. Returns None if no error was set.
"""
return _INTERNAL_PROJ_ERROR


cpdef void _clear_proj_error():
cpdef void _clear_proj_error() noexcept:
"""
Clear the internal PROJ error message.
"""
global _INTERNAL_PROJ_ERROR
_INTERNAL_PROJ_ERROR = None


cdef void pyproj_log_function(void *user_data, int level, const char *error_msg) nogil:
cdef void pyproj_log_function(void *user_data, int level, const char *error_msg) nogil noexcept:
"""
Log function for catching PROJ errors.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=61.0.0", "wheel", "cython>=0.28.4"]
requires = ["setuptools>=61.0.0", "wheel", "cython>=3"]
build-backend = "setuptools.build_meta"

[project]
Expand Down