1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#!/usr/bin/env python
from __future__ import annotations
import os
from setuptools import setup
USE_MYPYC = False
if os.getenv("CHARSET_NORMALIZER_USE_MYPYC", None) == "1":
USE_MYPYC = True
try:
from mypyc.build import mypycify
except ImportError:
mypycify = None # type: ignore[assignment]
if USE_MYPYC and mypycify is not None:
MYPYC_MODULES = mypycify(
[
"src/charset_normalizer/md.py",
],
debug_level="1",
opt_level="3",
)
else:
MYPYC_MODULES = None
setup(name="charset-normalizer", ext_modules=MYPYC_MODULES)
|