Skip to content

Commit

Permalink
Improve setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioz committed Feb 1, 2024
1 parent fe77748 commit cc55085
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,7 @@ def accept_file(f):
if extra_compile_args:
kwargs['extra_compile_args'] = extra_compile_args

args_with_binaries = args.copy()
args_with_binaries.update(dict(
distclass=BinaryDistribution,
ext_modules=[
ext_modules = [
# In this setup, don't even try to compile with cython, just go with the .c file which should've
# been properly generated from a tested version.
Extension(
Expand All @@ -177,6 +174,32 @@ def accept_file(f):
**kwargs
)
]

py_version = sys.version_info[:2]
if (3, 6) <= py_version <= (3, 11):
ext_modules.append(
Extension(
'_pydevd_frame_eval.pydevd_frame_evaluator',
["_pydevd_frame_eval/pydevd_frame_evaluator.c", ],
define_macros=[('Py_BUILD_CORE_MODULE', '1')],
**kwargs
)
)

if py_version >= (3, 12):
ext_modules.append(
Extension(
'_pydevd_sys_monitoring._pydevd_sys_monitoring_cython',
["_pydevd_sys_monitoring/_pydevd_sys_monitoring_cython.c", ],
define_macros=[('Py_BUILD_CORE_MODULE', '1')],
**kwargs
)
)

args_with_binaries = args.copy()
args_with_binaries.update(dict(
distclass=BinaryDistribution,
ext_modules=ext_modules
))
setup(**args_with_binaries)
except:
Expand Down

0 comments on commit cc55085

Please sign in to comment.