Skip to content

Commit b32f1b0

Browse files
committed
Require Python 3.9.1 or later for Big Sur compatibility
1 parent fc2bbe6 commit b32f1b0

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

setup.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@
44
from setuptools import setup, find_packages
55
from typing import Optional, Tuple
66

7+
8+
PYTHON_REQUIRES = ">=3.7"
9+
if sys.platform == "darwin":
10+
import platform
11+
try:
12+
macos_major_version = int(platform.release().split(".")[0])
13+
if macos_major_version >= 20:
14+
# We are running macOS Big Sur or later.
15+
# The new shared cache on Big Sur breaks `ctypes.util.find_library`,
16+
# which is used by the `cxxfilt` dependency.
17+
# https://stackoverflow.com/questions/62587131/macos-big-sur-python-ctypes-find-library-does-not-find-libraries-ssl-corefou/63609524#63609524
18+
# https://github.com/python/cpython/pull/22855
19+
# This wasn't patched in CPython until version 3.9.1, so require that:
20+
PYTHON_REQUIRES = ">=3.9.1"
21+
except ValueError:
22+
pass
23+
724
SETUP_DIR = os.path.dirname(os.path.realpath(__file__))
825
POLYTRACKER_HEADER = os.path.join(SETUP_DIR, 'polytracker', 'include', 'polytracker', 'polytracker.h')
926

@@ -58,7 +75,7 @@ def polytracker_version_string() -> str:
5875
author='Trail of Bits',
5976
version=polytracker_version_string(),
6077
packages=find_packages(),
61-
python_requires='>=3.7',
78+
python_requires=PYTHON_REQUIRES,
6279
install_requires=[
6380
'cxxfilt==0.2.2',
6481
'docker==4.4.0',

0 commit comments

Comments
 (0)