Skip to content

Commit

Permalink
Experiment with limited API
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Aug 23, 2022
1 parent f191a3b commit 67178fa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ requires = ["setuptools",
"wheel",
"extension-helpers",
"oldest-supported-numpy",
"cython==0.29.21"]
"cython==3.0.0a11"]
build-backend = 'setuptools.build_meta'

[tool.cibuildwheel]
Expand Down
9 changes: 7 additions & 2 deletions reproject/spherical_intersect/setup_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ def get_extensions():
if int(os.environ.get('DEBUG_OVERLAP_AREA', 0)):
define_macros = [('DEBUG_OVERLAP_AREA', 1)]
else:
define_macros = None
define_macros = []

define_macros.append(('CYTHON_LIMITED_API', '0x030800f0'))
define_macros.append(('Py_LIMITED_API', '0x030800f0'))

extension = Extension(
name="reproject.spherical_intersect._overlap",
Expand All @@ -32,6 +35,8 @@ def get_extensions():
libraries=libraries,
language="c",
extra_compile_args=['-O2'],
define_macros=define_macros)
define_macros=define_macros,
py_limited_api=True,
)

return [extension]
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,6 @@ length_sort_stdlib = True

[flake8]
max-line-length = 100

[bdist_wheel]
py_limited_api = cp38

0 comments on commit 67178fa

Please sign in to comment.