Skip to content

Commit 3a444ab

Browse files
2.6.0 RC2 build tools
1 parent a338577 commit 3a444ab

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

.github/workflows/build_wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
name: Build wheels on ${{ matrix.os }}
1111
runs-on: ${{ matrix.os }}
1212
env:
13-
CIBW_PYPY_VERSION: "7.3.10*"
13+
CIBW_SKIP: "pp36-* pp37-* pp38-*"
1414
strategy:
1515
matrix:
1616
os: [ubuntu-20.04, windows-2019, macos-11]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ websockets = "11.0.3"
4242
[tool.poetry.dev-dependencies]
4343

4444
[build-system]
45-
requires = ["setuptools", "wheel", "Cython", "pip", "mypy"]
45+
requires = ["setuptools", "wheel", "Cython", "pip"] # mypy is installed my the github action to exclude pypy
4646
build-backend = "setuptools.build_meta"
4747

4848
[tool.poetry.package_data]

setup.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from Cython.Build import cythonize
2222
from setuptools import setup, find_packages, Extension
2323
import os
24+
import platform
2425
import shutil
2526
import subprocess
2627

@@ -33,22 +34,23 @@
3334
]
3435

3536
# Setup
36-
print("Generating stub files ...")
37-
os.makedirs(stubs_dir, exist_ok=True)
38-
for filename in os.listdir(source_dir):
39-
if filename.endswith('.py'):
40-
source_path = os.path.join(source_dir, filename)
41-
subprocess.run(['stubgen', '-o', stubs_dir, source_path], check=True)
42-
for stub_file in os.listdir(os.path.join(stubs_dir, source_dir)):
43-
if stub_file.endswith('.pyi'):
44-
source_stub_path = os.path.join(stubs_dir, source_dir, stub_file)
45-
if os.path.exists(os.path.join(source_dir, stub_file)):
46-
print(f"Skipped moving {source_stub_path} because {os.path.join(source_dir, stub_file)} already exists!")
47-
else:
48-
shutil.move(source_stub_path, source_dir)
49-
print(f"Moved {source_stub_path} to {source_dir}!")
50-
shutil.rmtree(os.path.join(stubs_dir))
51-
print("Stub files generated and moved successfully.")
37+
if platform.python_implementation() != 'PyPy':
38+
print("Generating stub files ...")
39+
os.makedirs(stubs_dir, exist_ok=True)
40+
for filename in os.listdir(source_dir):
41+
if filename.endswith('.py'):
42+
source_path = os.path.join(source_dir, filename)
43+
subprocess.run(['stubgen', '-o', stubs_dir, source_path], check=True)
44+
for stub_file in os.listdir(os.path.join(stubs_dir, source_dir)):
45+
if stub_file.endswith('.pyi'):
46+
source_stub_path = os.path.join(stubs_dir, source_dir, stub_file)
47+
if os.path.exists(os.path.join(source_dir, stub_file)):
48+
print(f"Skipped moving {source_stub_path} because {os.path.join(source_dir, stub_file)} already exists!")
49+
else:
50+
shutil.move(source_stub_path, source_dir)
51+
print(f"Moved {source_stub_path} to {source_dir}!")
52+
shutil.rmtree(os.path.join(stubs_dir))
53+
print("Stub files generated and moved successfully.")
5254

5355
with open("README.md", "r") as fh:
5456
print("Using README.md content as `long_description` ...")

0 commit comments

Comments
 (0)