Skip to content

Commit

Permalink
- making builds for Python 3.12+ "pure" Python, as these
Browse files Browse the repository at this point in the history
  use sys.monitoring and no longer need a native probe;
  • Loading branch information
jaltmayerpizzorno committed Apr 12, 2024
1 parent 413bd30 commit 4279171
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build-and-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ jobs:
container: ${{ matrix.container }}
strategy:
matrix:
python_version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python_version: ['3.8', '3.9', '3.10', '3.11']
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
include:
- os: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64 # https://github.com/pypa/manylinux
# just need ONE build from 3.12 onwards; also only one needs to upload sources
- os: macos-latest
python_version: 3.8
upload_source: true # just need ONE of them to do it
python_version: 3.12
upload_source: true

steps:
- uses: actions/checkout@v3
Expand Down
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def get_version():
v = re.findall(r"\nVERSION *= *\"([^\"]+)\"", Path("src/slipcover/slipcover.py").read_text())[0]
return v

PYTHON_VERSION = sys.version_info[0:2]
VERSION = get_version()
REPO_URL = "https://github.com/plasma-umass/slipcover"

Expand Down Expand Up @@ -74,7 +75,7 @@ def limited_api_args():
language='c++',
)

if sys.argv[1].startswith('bdist') and sys.platform == 'darwin' and \
if sys.argv[1].startswith('bdist') and sys.platform == 'darwin' and PYTHON_VERSION < (3,12) and\
sum(arg == '-arch' for arg in platform_compile_args()) > 1:
# Build universal wheels on MacOS.
# ---
Expand All @@ -99,8 +100,9 @@ def limited_api_args():
license="Apache License 2.0",
packages=['slipcover'],
package_dir={'': 'src'},
ext_modules=([probe]),
python_requires=">=3.8,<3.14",
ext_modules=([probe] if PYTHON_VERSION < (3,12) else []),
python_requires=f">=3.{PYTHON_VERSION[1]},<3.{PYTHON_VERSION[1]+1}" if PYTHON_VERSION < (3,12) \
else ">=3.12,<3.14",
install_requires=[
"tabulate"
],
Expand Down

0 comments on commit 4279171

Please sign in to comment.