Skip to content

Commit

Permalink
Support disabling C extensions via IMMUTABLES_EXT=0
Browse files Browse the repository at this point in the history
Support using IMMUTABLES_EXT environment variable to control whether
the C extension is built explicitly.  When set to a value other than 1,
the extension built is disabled.  This is helpful e.g. for future Python
versions where the extension does not work (this is affecting 3.13 right
now, but having an explicit option is more future-proof).
  • Loading branch information
mgorny committed May 13, 2024
1 parent 3ba46f7 commit b1cb263
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
'unable to read the version from immutables/_version.py')


if platform.python_implementation() == 'CPython':
if (platform.python_implementation() == 'CPython' and
os.environ.get('IMMUTABLES_EXT', '1') == '1'):
if os.environ.get("DEBUG_IMMUTABLES") == '1':
define_macros = []
undef_macros = ['NDEBUG']
Expand Down

0 comments on commit b1cb263

Please sign in to comment.