From 52f49641bc972b5b379ac16ebf4e49212ae54af3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Mar 2026 02:24:15 +0000 Subject: [PATCH 1/4] Initial plan From 66a62b33b3b58449098be68d402786c9dd3df183 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Mar 2026 02:31:30 +0000 Subject: [PATCH 2/4] docs: add PyPI release guide and packaging fix Co-authored-by: isayahc <18591926+isayahc@users.noreply.github.com> --- .gitignore | 1 + README.md | 1 + RELEASING.md | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++ pyproject.toml | 5 +++- 4 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 RELEASING.md diff --git a/.gitignore b/.gitignore index f99d39e..501b0ce 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ __pycache__/ *.pyo *.pyd build/ +dist/ *.egg-info/ .pytest_cache/ .mypy_cache/ diff --git a/README.md b/README.md index 9f13247..1c42524 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,7 @@ python -m opencad.cli run examples/hardware_mounting_bracket.py \ ## Documentation - [PRODUCTION.md](PRODUCTION.md) — deployment, routes, and verification +- [RELEASING.md](RELEASING.md) — build and publish OpenCAD to PyPI - [ARCHITECTURE.md](ARCHITECTURE.md) — component design and API contracts - [TOPOLOGY.md](TOPOLOGY.md) — topology reference stability (open research question) - [SECURITY.md](SECURITY.md) — vulnerability reporting and hardening baseline diff --git a/RELEASING.md b/RELEASING.md new file mode 100644 index 0000000..644f3b0 --- /dev/null +++ b/RELEASING.md @@ -0,0 +1,77 @@ +# Releasing OpenCAD to PyPI + +OpenCAD already uses `setuptools` via `pyproject.toml`, so publishing a release is a +standard Python packaging flow. + +## 1. Prepare the release + +- Update `version` in `pyproject.toml`. +- Make sure `README.md` and any user-facing docs match the release. +- Run the existing test suite from the repository root: + +```bash +pytest +``` + +## 2. Build the distribution artifacts + +Install the packaging tools: + +```bash +python -m pip install -U build twine +``` + +Build both the source distribution and wheel: + +```bash +python -m build +``` + +This writes release artifacts to `dist/`. + +## 3. Validate the artifacts locally + +Check the generated metadata before uploading: + +```bash +python -m twine check dist/* +``` + +Optional smoke test from the built wheel: + +```bash +python -m pip install --force-reinstall dist/opencad-*.whl +opencad --help +``` + +## 4. Upload to PyPI + +Create a PyPI API token and either: + +- export it for the current shell, or +- store it in `~/.pypirc`. + +Example using an environment variable: + +```bash +export TWINE_USERNAME=__token__ +export TWINE_PASSWORD=pypi-*** +python -m twine upload dist/* +``` + +If you want a dry run against TestPyPI first: + +```bash +python -m twine upload --repository testpypi dist/* +``` + +## 5. Tag the release + +After the upload succeeds, create and push a matching Git tag: + +```bash +git tag v0.2.0 +git push origin v0.2.0 +``` + +Replace `v0.2.0` with the version you released. diff --git a/pyproject.toml b/pyproject.toml index 126160e..0b7429c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "opencad" version = "0.2.0" description = "Modular CAD platform — kernel, solver, feature tree, viewport, and AI agent" readme = "README.md" -license = "MIT" +license = { text = "MIT License" } requires-python = ">=3.11" dependencies = [ "pydantic>=2", @@ -48,6 +48,9 @@ testpaths = [ ] addopts = "-q" +[tool.setuptools] +license-files = [] + [tool.setuptools.packages.find] namespaces = false include = [ From 033fba7cc382690ff8227db7717bdb86e9475ad0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Mar 2026 02:31:55 +0000 Subject: [PATCH 3/4] docs: generalize PyPI tag example Co-authored-by: isayahc <18591926+isayahc@users.noreply.github.com> --- RELEASING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RELEASING.md b/RELEASING.md index 644f3b0..bf03184 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -70,8 +70,8 @@ python -m twine upload --repository testpypi dist/* After the upload succeeds, create and push a matching Git tag: ```bash -git tag v0.2.0 -git push origin v0.2.0 +git tag vX.Y.Z +git push origin vX.Y.Z ``` -Replace `v0.2.0` with the version you released. +Replace `X.Y.Z` with the version you released. From a001e5bebd80cbc10eba36fe713cbccbe7c83d0c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Mar 2026 02:34:06 +0000 Subject: [PATCH 4/4] build: pin setuptools for PyPI-compatible metadata Co-authored-by: isayahc <18591926+isayahc@users.noreply.github.com> --- pyproject.toml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0b7429c..3390044 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=68", "wheel"] +requires = ["setuptools>=68,<77", "wheel"] build-backend = "setuptools.build_meta" [project] @@ -7,7 +7,7 @@ name = "opencad" version = "0.2.0" description = "Modular CAD platform — kernel, solver, feature tree, viewport, and AI agent" readme = "README.md" -license = { text = "MIT License" } +license = { text = "MIT" } requires-python = ">=3.11" dependencies = [ "pydantic>=2", @@ -48,9 +48,6 @@ testpaths = [ ] addopts = "-q" -[tool.setuptools] -license-files = [] - [tool.setuptools.packages.find] namespaces = false include = [