Skip to content

Commit

Permalink
BUG: Cython 3 compatibility fixes (#1322)
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 committed Jul 17, 2023
1 parent c4c1e74 commit 1452ba4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
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"]

This comment has been minimized.

Copy link
@schmidtbryan

schmidtbryan Jul 31, 2023

No vulnerabilities in this version

build-backend = "setuptools.build_meta"

[project]
Expand Down

0 comments on commit 1452ba4

Please sign in to comment.