summaryrefslogtreecommitdiff
path: root/setup.py
blob: e0ebfed8e6d26e4c2b5cf6f285e4615b4b485595 (plain)
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
import os
import platform

from setuptools import Extension
from setuptools import setup
from setuptools_rust import RustExtension

if platform.python_implementation() not in {
    "PyPy",
    "Jython",
    "GraalVM",
}:
    local = os.environ.get("CIBUIDWHEEL", "0") != "1"
    setup(
        ext_modules=[
            Extension(
                "markupsafe._speedups", ["src/markupsafe/_speedups.c"], optional=local
            )
        ],
        rust_extensions=[
            RustExtension(
                "markupsafe._rust_speedups", "src/rust/Cargo.toml", optional=local
            )
        ],
    )
else:
    setup()