refactor setup.py
#!/usr/bin/env python3
-# Copyright (c) 2011-2020 Manfred Moitzi
+# Copyright (c) 2011-2021 Manfred Moitzi
# License: MIT License
import os
import sys
@@ -7,11 +7,7 @@ from setuptools import setup, find_packages
from setuptools import Extension
# setuptools docs: https://setuptools.readthedocs.io/en/latest/setuptools.html
-
-# Cython accelerated modules are optional:
-try:
- from Cython.Distutils import build_ext
-
+# All Cython accelerated modules are optional:
ext_modules = [
Extension("ezdxf.acc.vector", [
"src/ezdxf/acc/vector.pyx",
@@ -34,15 +30,18 @@ try:
"src/ezdxf/acc/construct.pyx",
], optional=True, language='c++'),
]
+try:
+ from Cython.Distutils import build_ext
commands = {'build_ext': build_ext}
except ImportError:
ext_modules = []
commands = {}
+
PYPY = hasattr(sys, 'pypy_version_info')
if PYPY:
- print("C-extensions are disabled for pypy because JIT complied Python code "
- "is much faster!")
+ print("C-extensions are disabled for pypy, because JIT complied "
+ "Python code is much faster!")
ext_modules = []
commands = {}
