Skip to content

Commit

Permalink
Add setup.py file for build
Browse files Browse the repository at this point in the history
  • Loading branch information
xuhe committed Sep 26, 2024
1 parent b0ddbbf commit a6ca6eb
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import os
import sys

from setuptools import Extension, setup

NO_EXTENSIONS = (
bool(os.environ.get("FROZENLIST_NO_EXTENSIONS"))
or sys.implementation.name != "cpython"
)

if NO_EXTENSIONS:
print("*********************")
print("* Pure Python build *")
print("*********************")
ext_modules = None
else:
print("*********************")
print("* Accelerated build *")
print("*********************")
ext_modules = [Extension("frozenlist._frozenlist", ["frozenlist/_frozenlist.c"])]


setup(
ext_modules=ext_modules,
)

0 comments on commit a6ca6eb

Please sign in to comment.