From 5040d181d279e25e884c25eb39522806244b2a27 Mon Sep 17 00:00:00 2001 From: alpha nerd Date: Mon, 13 Apr 2026 17:48:10 +0200 Subject: [PATCH] fix: revert workflows to reach any platform and any arch --- .forgejo/workflows/publish.yml | 28 +++++++--------------------- pyproject.toml | 11 +++++++---- setup.py | 31 ------------------------------- 3 files changed, 14 insertions(+), 56 deletions(-) delete mode 100644 setup.py diff --git a/.forgejo/workflows/publish.yml b/.forgejo/workflows/publish.yml index 17f700c..9fdee68 100644 --- a/.forgejo/workflows/publish.yml +++ b/.forgejo/workflows/publish.yml @@ -7,16 +7,10 @@ on: workflow_dispatch: jobs: - build-and-publish: - name: Build & Publish (${{ matrix.runner }}, py${{ matrix.python }}) - runs-on: ${{ matrix.runner }} + publish: + runs-on: docker-amd64 container: - image: python:${{ matrix.python }}-bookworm - - strategy: - matrix: - python: ["3.10", "3.11", "3.12"] - runner: [docker-amd64, docker-arm64] + image: python:3.12-bookworm steps: - name: Checkout repository @@ -26,21 +20,13 @@ jobs: . - name: Install build tools - run: | - apt-get update -qq && apt-get install -y patchelf - pip install build Cython twine auditwheel + run: pip install build twine - - name: Build wheel - run: python -m build --wheel - - - name: Repair wheel to manylinux - run: auditwheel repair dist/*.whl --wheel-dir wheelhouse/ - - - name: Check wheel metadata - run: twine check wheelhouse/*.whl + - name: Build package + run: python -m build - name: Publish to PyPI env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} - run: twine upload --verbose wheelhouse/*.whl + run: twine upload dist/* diff --git a/pyproject.toml b/pyproject.toml index e0902c3..681ba9a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] -requires = ["setuptools>=68", "wheel", "Cython>=3.0"] -build-backend = "setuptools.build_meta" +requires = ["hatchling>=1.0.0", "wheel"] +build-backend = "hatchling.build" [project] name = "nomyo" @@ -46,5 +46,8 @@ Documentation = "https://bitfreedom.net/code/nomyo-ai/nomyo/wiki/NOMYO-Secure-Cl Repository = "https://bitfreedom.net/code/nomyo-ai/nomyo" Issues = "https://bitfreedom.net/code/nomyo-ai/nomyo/issues" -[tool.setuptools.packages.find] -include = ["nomyo*"] +[tool.hatch.build.targets.wheel] +packages = ["nomyo"] + +[tool.hatch.build.targets.sdist] +exclude = ["test/", "build.sh", "dist/"] diff --git a/setup.py b/setup.py deleted file mode 100644 index 92d0bd3..0000000 --- a/setup.py +++ /dev/null @@ -1,31 +0,0 @@ -from setuptools import setup -from setuptools.command.build_py import build_py as _build_py -from Cython.Build import cythonize - -# Modules compiled to .so — exclude their .py source from the wheel -COMPILED_MODULES = {"nomyo", "SecureCompletionClient", "SecureMemory"} - - -class BuildPyNoPy(_build_py): - """Skip copying .py source files for cythonized modules.""" - - def find_package_modules(self, package, package_dir): - modules = super().find_package_modules(package, package_dir) - return [ - (pkg, mod, path) - for pkg, mod, path in modules - if not (pkg == "nomyo" and mod in COMPILED_MODULES) - ] - - -setup( - ext_modules=cythonize( - [ - "nomyo/nomyo.py", - "nomyo/SecureCompletionClient.py", - "nomyo/SecureMemory.py", - ], - compiler_directives={"language_level": "3"}, - ), - cmdclass={"build_py": BuildPyNoPy}, -)