Skip to content

Commit

Permalink
Attempt to make setup.py runnable under Blender directly,
Browse files Browse the repository at this point in the history
to make sure the correct Python version is used to compile
the module
  • Loading branch information
Paul Melis committed Aug 6, 2019
1 parent 989f8ce commit 0c53eb9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
try:
import bpy
# We're running in Blender, hack sys.argv to make setup() below
# do the right thing using Blender's version of Python
import sys
sys.argv = ['setup.py', 'build_ext', '--inplace']

except ImportError:
# Running outside blender, work as regular setup.py script
pass

from setuptools import setup, Extension
import numpy

Expand Down

0 comments on commit 0c53eb9

Please sign in to comment.