From b17147e31c725f8e98797dcb29df910369f54af0 Mon Sep 17 00:00:00 2001 From: Christian-Manuel Butzke Date: Tue, 30 Jun 2026 16:59:08 +0900 Subject: [PATCH] release: package as harel-python for PyPI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prepare for distribution: rename the PyPI project to 'harel-python' (the name 'harel' is taken by an unrelated project; the import name stays 'harel'), add classifiers/keywords/urls, and ship a py.typed marker. Move cel-python from dev to runtime dependencies — it is imported at load time, so it was a real install bug (a clean 'pip install' could not 'import harel'). Add a tag-triggered release workflow that builds and publishes via PyPI Trusted Publishing (OIDC). Verified: 'python -m build' produces an sdist + wheel that 'twine check' passes and that installs into a clean venv and imports/runs (engine, schema, console script, streaming) with cel-python pulled in automatically. Closes #14. --- .github/workflows/release.yml | 43 +++++++++++++++++++++++++++++++++++ pyproject.toml | 22 ++++++++++++++++-- src/harel/py.typed | 0 3 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 src/harel/py.typed diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0f1bd28 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +name: release + +# Tag-triggered release: build sdist+wheel and publish to PyPI via Trusted +# Publishing (OIDC) — no API token stored. Configure a PyPI Trusted Publisher for +# project `harel-python` (repo fruwehq/harel-python, workflow release.yml, +# environment `pypi`) before the first tag-driven release. +on: + push: + tags: ["v*"] + +jobs: + build: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.13" + - name: Build sdist + wheel + run: | + python -m pip install --upgrade build + python -m build + - name: Check metadata + run: | + python -m pip install --upgrade twine + python -m twine check dist/* + - uses: actions/upload-artifact@v4 + with: + name: dist + path: dist/ + + publish: + needs: build + runs-on: ubuntu-24.04 + environment: pypi + permissions: + id-token: write # OIDC for Trusted Publishing + steps: + - uses: actions/download-artifact@v4 + with: + name: dist + path: dist/ + - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/pyproject.toml b/pyproject.toml index 86e1dda..4400b4d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,22 +3,40 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "harel" +name = "harel-python" version = "0.1.0" description = "Python reference implementation of the harel statechart engine" readme = "README.md" requires-python = ">=3.11" license = { file = "LICENSE" } authors = [{ name = "Christian-Manuel Butzke" }] +keywords = ["statechart", "state-machine", "harel", "fsm", "hsm", "uml", "scxml"] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Topic :: Software Development :: Libraries", + "Typing :: Typed", +] dependencies = [ "pyyaml>=6", "jsonschema>=4", + "cel-python>=0.1", ] +[project.urls] +Homepage = "https://github.com/fruwehq/harel-python" +Repository = "https://github.com/fruwehq/harel-python" +Specification = "https://github.com/fruwehq/harel" +Issues = "https://github.com/fruwehq/harel-python/issues" + [project.optional-dependencies] dev = [ "pytest>=8", - "cel-python", "ruff", "mypy", "types-PyYAML", diff --git a/src/harel/py.typed b/src/harel/py.typed new file mode 100644 index 0000000..e69de29