Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ __pycache__/
*.pyo
*.pyd
build/
dist/
*.egg-info/
.pytest_cache/
.mypy_cache/
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
77 changes: 77 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -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 vX.Y.Z
git push origin vX.Y.Z
```

Replace `X.Y.Z` with the version you released.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[build-system]
requires = ["setuptools>=68", "wheel"]
requires = ["setuptools>=68,<77", "wheel"]
build-backend = "setuptools.build_meta"

[project]
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" }
requires-python = ">=3.11"
dependencies = [
"pydantic>=2",
Expand Down