GRDN.AI.3 / setup.py
danidanidani's picture
Add sitecustomize.py to fix OMP_NUM_THREADS at Python startup
f38a4b7
from setuptools import setup
from setuptools.command.install import install
import os
import shutil
import site
class PostInstallCommand(install):
def run(self):
install.run(self)
# Copy sitecustomize.py to site-packages
for site_dir in site.getsitepackages():
try:
dest = os.path.join(site_dir, 'sitecustomize.py')
shutil.copy('sitecustomize.py', dest)
print(f"✅ Installed sitecustomize.py to {dest}")
break
except:
continue
setup(
name='grdn-hf-fix',
version='0.0.1',
cmdclass={'install': PostInstallCommand},
)