From 7aa9fbb518a07a21f5c49054c67e3b7e9e5193e4 Mon Sep 17 00:00:00 2001 From: cschen Date: Tue, 10 Sep 2024 19:09:54 +0200 Subject: [PATCH] feat(python): build wheels with manual specified `__init__.py` fix(python): remove build script, not needed anymore --- .gitignore | 1 + dist/py/build.sh | 8 -------- dist/py/pyproject.toml | 4 +++- dist/py/src/codemp/__init__.py | 5 +++++ dist/py/{ => src/codemp}/codemp.pyi | 0 5 files changed, 9 insertions(+), 9 deletions(-) delete mode 100755 dist/py/build.sh create mode 100644 dist/py/src/codemp/__init__.py rename dist/py/{ => src/codemp}/codemp.pyi (100%) diff --git a/.gitignore b/.gitignore index 497840a..11b3a99 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ # python .venv wheels/ +dist/py/build.sh # lua dist/lua/*.so diff --git a/dist/py/build.sh b/dist/py/build.sh deleted file mode 100755 index 0795b16..0000000 --- a/dist/py/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -ROOT_DIR="$(pwd)" -WHEEL_DIR="$ROOT_DIR/wheels" - -PYO3_PYTHON="$(pyenv which python)" -TARGET_EXT="$($PYO3_PYTHON -c 'import sysconfig; print(sysconfig.get_config_var("EXT_SUFFIX"))')" - -MATURIN_PYPI_TOKEN="$(cat ~/.local/secrets/pypi_codemp_token)" maturin publish -i "$PYO3_PYTHON" \ ---out "$WHEEL_DIR" --non-interactive --repository "pypi" diff --git a/dist/py/pyproject.toml b/dist/py/pyproject.toml index 9afc2e4..278a91c 100644 --- a/dist/py/pyproject.toml +++ b/dist/py/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "codemp" -version = "0.0.7" +version = "0.0.8" description = "code multiplexer" requires-python = ">= 3.8" license = "GPL-3.0-only" @@ -30,4 +30,6 @@ build-backend = "maturin" [tool.maturin] features = ["python", "pyo3/extension-module"] manifest-path = "../../Cargo.toml" +python-source = "src" + diff --git a/dist/py/src/codemp/__init__.py b/dist/py/src/codemp/__init__.py new file mode 100644 index 0000000..2ac1e90 --- /dev/null +++ b/dist/py/src/codemp/__init__.py @@ -0,0 +1,5 @@ +from .codemp import * + +__doc__ = codemp.__doc__ +if hasattr(codemp, "__all__"): + __all__ = codemp.__all__ diff --git a/dist/py/codemp.pyi b/dist/py/src/codemp/codemp.pyi similarity index 100% rename from dist/py/codemp.pyi rename to dist/py/src/codemp/codemp.pyi