Skip to content
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

BUG: Cython 3 Compatibility #1321

Closed
snowman2 opened this issue Jul 17, 2023 · 9 comments · Fixed by #1322
Closed

BUG: Cython 3 Compatibility #1321

snowman2 opened this issue Jul 17, 2023 · 9 comments · Fixed by #1322
Labels
Milestone

Comments

@snowman2
Copy link
Member

Error compiling Cython file:
------------------------------------------------------------
...

cdef void pyproj_context_initialize(PJ_CONTEXT* context) except *:
    """
    Setup the context for pyproj
    """
    proj_log_func(context, NULL, pyproj_log_function)
                                 ^
------------------------------------------------------------

pyproj/_datadir.pyx:148:33: Cannot assign type 'void (void *, int, const char *) except * nogil' to 'PJ_LOG_FUNCTION'
@snowman2 snowman2 added the bug label Jul 17, 2023
@snowman2 snowman2 added this to the 3.6.1 milestone Jul 17, 2023
@snowman2 snowman2 changed the title Cython 3 Compatibility BUG: Cython 3 Compatibility Jul 17, 2023
RoDuth added a commit to RoDuth/ghini.desktop that referenced this issue Jul 18, 2023
mjanez added a commit to mjanez/ckan-docker-spatial that referenced this issue Jul 19, 2023
Need to compile proj 9 because it does not exist in alpine:3.15 (8.2.0-r0) and pyproj >3.6.0 (ckanext-spatial requirement) requires >9.0.0 pyproj4/pyproj#1321
@snowman2 snowman2 pinned this issue Jul 20, 2023
@snowman2
Copy link
Member Author

snowman2 commented Jul 20, 2023

I believe this should work for current versions of pyproj:

python -m pip install 'cython<3'
python -m pip install --no-use-pep517 pyproj

To install the version with the fix implemented:

python -m pip install pyproj@git+https://github.com/pyproj4/pyproj.git@main

@pritish-ranjan01
Copy link

pritish-ranjan01 commented Jul 21, 2023

Same problem with our docker build.

BASE_IMAGE=python:3.9-alpine3.16
pyproj = "~=2.6.1"

poetry = 1.2.2

Error:-

at /usr/local/lib/python3.9/site-packages/poetry/utils/pip.py:51 in pip_install
47│
48│ try:
49│ return environment.run_pip(*args)
50│ except EnvCommandError as e:
→ 51│ raise PoetryException(f"Failed to install {path.as_posix()}") from e
52│

@snowman2
Copy link
Member Author

Does this work: python-poetry/poetry#3433 (comment)

poetry run python -m pip install 'cython<3'
poetry run python -m pip install --no-use-pep517 pyproj
poetry install

@richieho-chownow
Copy link

richieho-chownow commented Jul 22, 2023

It does not work for projects that still use setup.py.

ERROR: Disabling PEP 517 processing is invalid: project specifies a build backend of setuptools.build_meta in pyproject.toml

Seems like you have the fix in v3.6.1. If so, when will will it be released?
@snowman2

jbronn added a commit to radiant-maxar/geoint-apps that referenced this issue Jul 22, 2023
jbronn added a commit to radiant-maxar/geoint-apps that referenced this issue Jul 22, 2023
* Upgrade Overpass API from v0.7.60.6 to v0.7.61.2 (EL9)

* Disable MapProxy RPM builds until `pyproj==3.6.1` is released, refs pyproj4/pyproj/issues/1321.

---------

Co-authored-by: Justin Bronn <justin.bronn@maxar.com>
@snowman2
Copy link
Member Author

Seems like you have the fix in v3.6.1. If so, when will will it be released?

Here is the 3.6.1 milestone: https://github.com/pyproj4/pyproj/milestone/11. With current dependencies, it is expected to arrive sometime at the end of September or beginning of October.

@richieho-chownow
Copy link

I see Python 3.12 as a dep. Will projects that use pyproj also need to be on Python 3.12?

@snowman2 snowman2 reopened this Jul 24, 2023
@snowman2
Copy link
Member Author

Will projects that use pyproj also need to be on Python 3.12?

Python 3.12 support will be added (i.e. wheels) in addition to currently supported Python versions.

@pyproj4 pyproj4 locked as resolved and limited conversation to collaborators Jul 24, 2023
@snowman2
Copy link
Member Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants