Skip to content

Commit

Permalink
Update build machinery to support the stable ABI
Browse files Browse the repository at this point in the history
  • Loading branch information
rhpvorderman committed Nov 27, 2024
1 parent a071f9d commit 5657fa2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=60", "setuptools-scm>=8.0"]
requires = ["setuptools>=60", "setuptools-scm>=8.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
Expand Down Expand Up @@ -30,7 +30,7 @@ classifiers = [
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Topic :: Scientific/Engineering :: Bio-Informatics",
]
requires-python = ">3.8"
requires-python = ">=3.10"
dependencies = [
"xopen>=2.0.0",
"pygal>=3.0.4",
Expand Down
26 changes: 24 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,34 @@
# You should have received a copy of the GNU Affero General Public License
# along with sequali. If not, see <https://www.gnu.org/licenses/

# ABI3 building example from
# https://github.com/joerick/python-abi3-package-sample/blob/main/setup.py

from setuptools import Extension, setup

from wheel.bdist_wheel import bdist_wheel


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

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


setup(
ext_modules=[
Extension("sequali._qc", ["src/sequali/_qcmodule.c"]),
Extension("sequali._seqident", ["src/sequali/_seqidentmodule.c"])
Extension(
"sequali._qc",
["src/sequali/_qcmodule.c"],
py_limited_api=True
),
Extension(
"sequali._seqident",
["src/sequali/_seqidentmodule.c"],
py_limited_api=True),
],
cmdclass={"bdist_wheel": bdist_wheel_abi3},
)

0 comments on commit 5657fa2

Please sign in to comment.