diff --git a/setup.py b/setup.py index f01f2073..300a45bf 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,4 @@ +import sys import os from setuptools import setup @@ -5,6 +6,24 @@ import versioneer +# Check for 32-bit windows builds, which currently aren't supported. We can't +# rely on `platform.architecture` here since users can still run 32-bit python +# builds on 64 bit architectures. +if sys.platform == "win32" and sys.maxsize == (2**31 - 1): + import textwrap + + error = """ + ==================================================================== + `msgspec` currently doesn't support 32-bit Python windows builds. If + this is important for your use case, please open an issue on GitHub: + + /~https://github.com/jcrist/msgspec/issues + ==================================================================== + """ + print(textwrap.dedent(error)) + exit(1) + + SANITIZE = os.environ.get("MSGSPEC_SANITIZE", False) COVERAGE = os.environ.get("MSGSPEC_COVERAGE", False) DEBUG = os.environ.get("MSGSPEC_DEBUG", SANITIZE or COVERAGE)