fix: revert workflows to reach any platform and any arch
This commit is contained in:
parent
57998fd84c
commit
5040d181d2
3 changed files with 14 additions and 56 deletions
|
|
@ -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/*
|
||||
|
|
|
|||
|
|
@ -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/"]
|
||||
|
|
|
|||
31
setup.py
31
setup.py
|
|
@ -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},
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue