python-3.xdockercythoncythonize

Python match case syntax error(not a version problem)


I am using python match case statement in my python project. To test it, I am building a image with docker file, with python:3.12.2-slim-bullseye as base image, and installing python3 during build process.I have verified that the python version which gets installed during build is 3.10.12.Also I have a setup.py file which uses cython to build python files into .so files.

While building the image, cython throws error on match syntax, as I said, I have verified that python version being installed is 3.10.12 and more over I built a dummy image which has python 3.10.12, and went inside container and tested with a sample python file with match syntax and it works perfectly fine.But while building the files with Cython it is failing..Please if anyone has any idea please help me out. I am a fresher and working on this big project, Cython was new to me. Syntax error shown while cythonizing

Cython version I am using


Solution

  • It isn't yet supported in any Cython release (as of my knowledge cutoff of 27 March 2024, i.e. today).

    The patma-preview branch does contain a complete implementation so you can check that branch out and use it. However it's a large and basically unreviewed chunk of code so use it at your own risk. It'll be gradually merged into a release as it gets reviewed.

    pip install from git repo branch shows you how to install from a branch.

    If you want to track it, the relevant Cython issue is https://github.com/cython/cython/issues/4029 (note that commenting "me too" on the issue is not a helpful contribution so please don't do that. Reporting any bugs you find in the branch would be useful though).