feat: new build process and workflows
Some checks failed
Publish to PyPI / Build (docker-amd64, py3.10) (push) Failing after 28s
Publish to PyPI / Build (docker-arm64, py3.10) (push) Failing after 46s
Publish to PyPI / Build (docker-amd64, py3.11) (push) Failing after 30s
Publish to PyPI / Build (docker-arm64, py3.11) (push) Failing after 46s
Publish to PyPI / Build (docker-amd64, py3.12) (push) Failing after 28s
Publish to PyPI / Build (docker-arm64, py3.12) (push) Failing after 43s
Publish to PyPI / Publish to PyPI (push) Has been skipped

ver: bump
This commit is contained in:
Alpha Nerd 2026-04-12 15:49:20 +02:00
parent c80625a418
commit 58815eec71
Signed by: alpha-nerd
SSH key fingerprint: SHA256:QkkAgVoYi9TQ0UKPkiKSfnerZy2h4qhi3SVPXJmBN+M
5 changed files with 78 additions and 17 deletions

View file

@ -7,10 +7,16 @@ on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
publish: build:
runs-on: docker-amd64 name: Build (${{ matrix.runner }}, py${{ matrix.python }})
runs-on: ${{ matrix.runner }}
container: container:
image: python:3.12-bookworm image: python:${{ matrix.python }}-bookworm
strategy:
matrix:
python: ["3.10", "3.11", "3.12"]
runner: [docker-amd64, docker-arm64]
steps: steps:
- name: Checkout repository - name: Checkout repository
@ -20,13 +26,36 @@ jobs:
. .
- name: Install build tools - name: Install build tools
run: pip install build twine run: pip install build Cython
- name: Build package - name: Build wheel
run: python -m build run: python -m build --wheel
- name: Upload wheel artifact
uses: actions/upload-artifact@v3
with:
name: wheel-${{ matrix.runner }}-py${{ matrix.python }}
path: dist/*.whl
publish:
name: Publish to PyPI
needs: build
runs-on: docker-amd64
container:
image: python:3.12-bookworm
steps:
- name: Download all wheels
uses: actions/download-artifact@v3
with:
path: dist/
merge-multiple: true
- name: Install twine
run: pip install twine
- name: Publish to PyPI - name: Publish to PyPI
env: env:
TWINE_USERNAME: __token__ TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/* run: twine upload dist/**/*.whl

4
.gitignore vendored
View file

@ -52,6 +52,10 @@ dist/
*.egg *.egg
*.sh *.sh
# Cython generated files
*.so
*.c
# Virtual environments # Virtual environments
venv/ venv/
.env .env

View file

@ -51,6 +51,6 @@ try:
except ImportError: except ImportError:
pass pass
__version__ = "0.2.3" __version__ = "0.2.4"
__author__ = "NOMYO AI" __author__ = "NOMYO AI"
__license__ = "Apache-2.0" __license__ = "Apache-2.0"

View file

@ -1,10 +1,10 @@
[build-system] [build-system]
requires = ["hatchling>=1.0.0", "wheel"] requires = ["setuptools>=68", "wheel", "Cython>=3.0"]
build-backend = "hatchling.build" build-backend = "setuptools.build_meta"
[project] [project]
name = "nomyo" name = "nomyo"
version = "0.2.3" version = "0.2.4"
description = "OpenAI-compatible secure chat client with end-to-end encryption for NOMYO Inference Endpoints" description = "OpenAI-compatible secure chat client with end-to-end encryption for NOMYO Inference Endpoints"
authors = [ authors = [
{name = "NOMYO.AI", email = "ichi@nomyo.ai"}, {name = "NOMYO.AI", email = "ichi@nomyo.ai"},
@ -42,12 +42,9 @@ dependencies = [
[project.urls] [project.urls]
Homepage = "https://www.nomyo.ai" Homepage = "https://www.nomyo.ai"
Documentation = "https://bitfreedom.net/code/nomyo-ai/nomyo/src/branch/main/doc" Documentation = "https://bitfreedom.net/code/nomyo-ai/nomyo/wiki/NOMYO-Secure-Client-Documentation"
Repository = "https://bitfreedom.net/code/nomyo-ai/nomyo" Repository = "https://bitfreedom.net/code/nomyo-ai/nomyo"
Issues = "https://bitfreedom.net/code/nomyo-ai/nomyo/issues" Issues = "https://bitfreedom.net/code/nomyo-ai/nomyo/issues"
[tool.hatch.build.targets.wheel] [tool.setuptools.packages.find]
packages = ["nomyo"] include = ["nomyo*"]
[tool.hatch.build.targets.sdist]
exclude = ["test/", "build.sh", "dist/"]

31
setup.py Normal file
View file

@ -0,0 +1,31 @@
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},
)