Consolidate to single dlp_io module and publish release artifacts via Gitea Actions
publish-dlp-io / publish (push) Successful in 1m27s

This commit is contained in:
2026-07-31 16:42:59 +08:00
parent 3b0c81fd9d
commit fe1a6ed749
20 changed files with 1191 additions and 1245 deletions
+33
View File
@@ -0,0 +1,33 @@
"""Build hook for dlp-io.
Default builds (``python -m build``) stay pure Python and produce the
``py3-none-any`` wheel declared in ``pyproject.toml``.
Setting ``DLP_IO_PYD=1`` compiles the single ``dlp_io`` module into a C
extension with Cython, producing a platform wheel (for example
``cp313-cp313-win_amd64``) that ships one ``.pyd`` binary instead of
the ``.py`` source.
"""
from __future__ import annotations
import os
from setuptools import setup
_BUILD_PYD = os.environ.get("DLP_IO_PYD") == "1"
_MODULE = "dlp_io"
if _BUILD_PYD:
from Cython.Build import cythonize
setup(
ext_modules=cythonize(
[f"{_MODULE}.py"],
build_dir=os.path.join("build", "cython"),
compiler_directives={"language_level": "3"},
),
py_modules=[],
)
else:
setup(py_modules=[_MODULE])