Skip to main content

b123d-setup

A small CLI for creating build123d CAD projects managed by uv. The generator has no runtime dependencies. CAD dependencies are installed in each generated project's own environment.

Quick start

Install uv, then run:

uvx b123d-setup my-part --with-vscode
cd my-part
uv run -m scripts.export_all

To use a local checkout, run this from the repository directory instead:

uvx --from . b123d-setup my-part --with-vscode

To run directly from GitHub:

uvx --from git+https://github.com/kirisaki/b123d-setup.git b123d-setup my-part --with-vscode

The generator only creates files. The first uv run or uv sync in the generated project installs its dependencies and creates .venv and uv.lock. Generated projects use Python 3.11; uv downloads it if needed. Commit uv.lock to preserve the resolved dependency versions.

Preview in VS Code

Open the generated project in VS Code and install the recommended Python and OCP CAD Viewer extensions. Start OCP CAD Viewer, then run:

uv run main.py

Edit parts/base_plate.py and run the command again to preview your changes. For F5 debugging, run uv sync first and select the project's .venv interpreter.

CLI

b123d-setup DIRECTORY [--with-vscode]
b123d-setup --name DIRECTORY [--with-vscode]
b123d-setup --help
b123d-setup --version
  • Create a project in a new directory or an existing empty directory.
  • Nonempty directories are rejected; existing files are never overwritten.
  • --with-vscode adds settings, launch configurations, and extension recommendations.

Generated project

my-part/
├── pyproject.toml
├── .python-version
├── .gitignore
├── README.md
├── main.py
├── parts/
│   ├── __init__.py
│   └── base_plate.py
├── assembly/
├── scripts/
│   ├── __init__.py
│   └── export_all.py
├── exports/
└── .vscode/              # With --with-vscode

The sample is a 60 × 40 × 3 mm plate with six 3 mm diameter through holes. Run uv run -m scripts.export_all from the project directory to export STEP and STL files into exports/. Exporting does not require a viewer.

Jupyter is optional. Start it in the generated project with:

uv run --extra notebook jupyter lab

Development and building

uv run python -m unittest discover -s tests -v
uv build
uvx --from ./dist/b123d_setup-0.1.0-py3-none-any.whl b123d-setup --help

Building creates a wheel and source distribution in dist/.

Publishing

The publish.yml workflow tests and builds the package on pushes to main and pull requests. Only a manual run from main publishes to PyPI, using Trusted Publishing with the GitHub environment pypi. No API token is needed.

For the first release, register a pending publisher at PyPI Publishing with:

Field Value
PyPI project name b123d-setup
GitHub owner kirisaki
Repository b123d-setup
Workflow filename publish.yml
Environment pypi

Then open Actions → Build and publish to PyPI → Run workflow and select main. Each subsequent release needs a new version in pyproject.toml and an updated uv.lock before running the workflow again.

Metadata

Release files for b123d-setup 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for b123d-setup 0.1.0
File Size Uploaded
b123d_setup-0.1.0.tar.gz 5.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for b123d-setup 0.1.0
File Interpreter ABI Platform
b123d_setup-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.5 kB

Release files / b123d_setup-0.1.0.tar.gz

Download URL b123d_setup-0.1.0.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
60e4fc58b17cf7a1c6a8ef632ceacb25607d224c93628ffd24e2fa7a27f6bead
BLAKE2b-256 checksum
How to use checksums
652448a3de8b18c2067114552de4f7387e152fcc0237e00d9e02f4823306cff7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / b123d_setup-0.1.0-py3-none-any.whl

Download URL b123d_setup-0.1.0-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae3330bb42222f755a0825d9e62dfb8dc3648a8381f63b1226c63b12c709f0aa
BLAKE2b-256 checksum
How to use checksums
deaf7c6f625d6ef5eed64260fa1fe83c11ac8c8877d4b85e463aa27880911a17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page