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..bf03184 --- /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 vX.Y.Z +git push origin vX.Y.Z +``` + +Replace `X.Y.Z` with the version you released. diff --git a/pyproject.toml b/pyproject.toml index 126160e..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 = "MIT" +license = { text = "MIT" } requires-python = ">=3.11" dependencies = [ "pydantic>=2",