Skip to content

Commit

Permalink
Use setup.cfg to specify limited API (#658)
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio committed Jul 11, 2024
2 parents e12bb56 + ae974df commit 0de61f7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Python/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ dist-hook:
mkdir -p $(distdir)/test
cp ./test/*.py $(distdir)/test

EXTRA_DIST = README.txt setup.py QuantLib/__init__.py $(BUILT_SOURCES)
EXTRA_DIST = README.txt setup.py setup.cfg QuantLib/__init__.py $(BUILT_SOURCES)

2 changes: 2 additions & 0 deletions Python/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[bdist_wheel]
py_limited_api=cp38
12 changes: 0 additions & 12 deletions Python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from setuptools.command.build_ext import build_ext
from setuptools.command.build import build
from setuptools._distutils.ccompiler import get_default_compiler
from wheel.bdist_wheel import bdist_wheel

py_limited_api = (platform.python_implementation() == 'CPython')

Expand Down Expand Up @@ -196,16 +195,6 @@ def finalize_options(self):
ext.extra_link_args += extra_link_args


class my_bdist_wheel(bdist_wheel):
def get_tag(self):
python, abi, plat = super().get_tag()

if python.startswith("cp"):
return "cp38", "abi3", plat

return python, abi, plat


classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
Expand Down Expand Up @@ -247,7 +236,6 @@ def get_tag(self):
'wrap': my_wrap,
'build': my_build,
'build_ext': my_build_ext,
'bdist_wheel': my_bdist_wheel,
}
)

12 changes: 0 additions & 12 deletions Python/setup.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ from setuptools import Command
from setuptools.command.build_ext import build_ext
from setuptools.command.build import build
from setuptools._distutils.ccompiler import get_default_compiler
from wheel.bdist_wheel import bdist_wheel

py_limited_api = (platform.python_implementation() == 'CPython')

Expand Down Expand Up @@ -196,16 +195,6 @@ class my_build_ext(build_ext):
ext.extra_link_args += extra_link_args


class my_bdist_wheel(bdist_wheel):
def get_tag(self):
python, abi, plat = super().get_tag()

if python.startswith("cp"):
return "cp38", "abi3", plat

return python, abi, plat


classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
Expand Down Expand Up @@ -247,7 +236,6 @@ a comprehensive software framework for quantitative finance.
'wrap': my_wrap,
'build': my_build,
'build_ext': my_build_ext,
'bdist_wheel': my_bdist_wheel,
}
)

0 comments on commit 0de61f7

Please sign in to comment.