Created attachment 233499 [details] Patch This fixes hidden dependency on cython, which is used as long as it's available on the system. Using cython also fixes compatibility with newer python versions (bundled pregenerated C sources are often not compatible) and tests (which require pyximport module which comes with cython).
Thanks for looking into it. Feel free to commit if you've tested that, I won't have time until the weekend.
The upstream sdist (PyPI tarball creation) process has a process for checking and ensuring cython files are compiled to C files prior to upload: class CheckSDist(sdist): """Custom sdist that ensures Cython has compiled all pyx files to c.""" Unfortunately the check for Cython is not made conditional: try: import Cython However later in the setup.py, the following only adds (registers) and actual cython dependency if socket.c doesnt exist (indicating cython sources havent been compiled) if not os.path.exists(os.path.join("zmq", "backend", "cython", "socket.c")): # this generally means pip install from git # which requires Cython setup_args.setdefault("setup_requires", []).append( f"cython>={min_cython_version} Adding a cython dependency to the port is spurious, and a better approach is either: 1) merge/move the import line to within the source file check, so both the try import and the registration are conditional, and send upstream, OR 2) hack: remove the try/import/exception block. As far as Python version support goes, the standard is to declare version support against the versions upstream CI's and passes tests against. If they are testing with Cython builds, that means their sdist pipeline is untested, which is problematic and should be reported too.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=2238cdaeeee894eaee1c99f327b5b4a22231b462 commit 2238cdaeeee894eaee1c99f327b5b4a22231b462 Author: Dmitry Marakasov <amdmi3@FreeBSD.org> AuthorDate: 2022-04-26 17:43:21 +0000 Commit: Dmitry Marakasov <amdmi3@FreeBSD.org> CommitDate: 2022-04-27 11:42:14 +0000 net/py-pyzmq: add dependency on cython This: - Fixes hidden dependency, as cython is used as soon as its detected - Improves compatibility with newer python versions by regenerating C files with latest cython - Fixes tests which require pyximport module from cython PR: 263580 Reported by: reprise Approved by: novel (maintainer) net/py-pyzmq/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)