Skip to content

Commit 386fb8c

Browse files
committed
fix constructor and setup script
1 parent 127d6eb commit 386fb8c

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

setup.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ def pretend_cython():
3131
_pure_python = os.getenv("BYTECODE_PURE_PYTHON")
3232
print(f"bytecode: building {'pure-Python' if _pure_python else 'Cython'} version")
3333

34-
# Include .pxd declaration files only in Cython builds so they are available
35-
# to downstream Cython users who want to cimport from bytecode.
36-
_package_data = {} if _pure_python else {"bytecode": ["*.pxd"]}
34+
# Always include .pyi stubs; also include .pxd declaration files in Cython
35+
# builds so downstream Cython users can cimport from bytecode.
36+
_package_data: dict = {"bytecode": ["*.pyi"]}
37+
if not _pure_python:
38+
_package_data["bytecode"].append("*.pxd")
3739

3840
setup(
3941
name="bytecode",
40-
setup_requires=["setuptools_scm[toml]>=4", "cython"] + ([] if _pure_python else ["cmake>=3.24.2,<3.28"]),
42+
setup_requires=["setuptools_scm[toml]>=4"] + ([] if _pure_python else ["cython"]),
4143
package_data=_package_data,
4244
ext_modules=[] if _pure_python else cythonize(
4345
pretend_cython(),

src/bytecode/concrete.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def _from_trusted(
218218
location: Optional[InstrLocation],
219219
) -> T:
220220
"""Fast path for concrete_instructions: skip validation, compute size from arg."""
221-
new = object.__new__(cls)
221+
new = cls.__new__(cls)
222222
new._name = name
223223
new._opcode = opcode
224224
new._arg = arg

0 commit comments

Comments
 (0)