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.1-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.1

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.1
File Size Uploaded
b123d_setup-0.1.1.tar.gz 6.3 kB Details

Built distribution (wheel)

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

Total release size: 12.9 kB

Release files / b123d_setup-0.1.1.tar.gz

Download URL b123d_setup-0.1.1.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c7859fc16e70d41699bf1b7047575b3a1e5e0f95f904c688f5bc822746d67c8c
BLAKE2b-256 checksum
How to use checksums
341706497b3df00e579e2105c2dafa3c823a2c2cd335da74f8f22fce80a5b73e
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.1-py3-none-any.whl

Download URL b123d_setup-0.1.1-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b663677ab0a0458ac8bc2f80812977e2f47ff8ec2cb5d3a0fe3d79d3d4355acd
BLAKE2b-256 checksum
How to use checksums
de78234727c7fb69a6c8297ce833ce6e1a86ad14f08ccf8494249b3bdd51b0c4
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

This release

0.1.1 This release

2 release files

0.1.0

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