You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
python-ndindex/SOURCES/0002-setup.py-specify-cytho...

45 lines
1.6 KiB

From 3763937b7c986a35c17c816699fdc81c1859191c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sun, 16 Jul 2023 13:46:40 +0200
Subject: [PATCH] setup.py: specify cython language_level
Cython still defaults to compat with python2, but ndindex requires >=3.7,
so this is not useful. Specifying the level allows slightly shorter code
and gets rid of a bunch of warnings:
/usr/lib64/python3.12/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /builddir/build/BUILD/ndindex-1.7/ndindex/_crt.py
tree = Parsing.p_module(s, pxd, full_module_name)
...
---
setup.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/setup.py b/setup.py
index 5d7e7efe0d..f39b71f980 100644
--- a/setup.py
+++ b/setup.py
@@ -18,7 +18,9 @@ def check_cython():
from Cython.Build import cythonize
sys.argv = argv_org[:1] + ["build_ext"]
setuptools.setup(name="foo", version="1.0.0",
- ext_modules=cythonize(["ndindex/__init__.py"]))
+ ext_modules=cythonize(
+ ["ndindex/__init__.py"],
+ language_level="3"))
except:
return False
finally:
@@ -37,7 +39,8 @@ else:
if use_cython:
from Cython.Build import cythonize
- ext_modules = cythonize(["ndindex/*.py"])
+ ext_modules = cythonize(["ndindex/*.py"],
+ language_level="3")
else:
ext_modules = []
--
2.41.0