Skip to content
Merged
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
45 changes: 16 additions & 29 deletions .github/workflows/lint-and-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,64 +5,51 @@ on: [push]
jobs:
lint-with-ruff:
runs-on: ubuntu-latest

steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Install ruff
run: pip install ruff
- name: Install dependencies
run: uv sync --dev --locked

- name: Run ruff linter
run: ruff check ./cad/
run: uv run ruff check ./cad/

check-with-pyright:
runs-on: ubuntu-latest

steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install Python dependencies
run: pip install -r requirements.txt
- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Install pyright
run: pip install pyright
- name: Install dependencies
run: uv sync --dev --locked

- name: Run pyright
run: pyright ./cad/

run: uv run pyright ./cad/

run-python-scripts:
runs-on: ubuntu-latest

steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Install dependencies
run: uv sync --dev --locked

- name: Install Python dependencies
run: pip install -r requirements.txt

- name: Run Python scripts in CAD folder
run: |
find cad/ **/cad/ -name "*.py" ! -path "*/no_ci/*" | while read file; do
echo "Running $file"
python "$file"
uv run python "$file"
done

- name: Compress the build folder
Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.13
3.12
3 changes: 2 additions & 1 deletion cad/column_rod_housing_assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def make_octagon_rod(
).translate((0, 0, p.bounding_box().max.Z))

# Remove the motor shaft hole from the motor coupler.
p -= (
motor_shaft_d_hole = (
bd.Cone(
top_radius=spec.motor_shaft_hole_id_outer / 2,
bottom_radius=spec.motor_shaft_hole_id_inner / 2,
Expand All @@ -317,6 +317,7 @@ def make_octagon_rod(
(-spec.motor_shaft_hole_id_outer * 0.25, 0, 0)
)
).translate((0, 0, p.bounding_box().max.Z))
p -= motor_shaft_d_hole

# Remove a hole for the the zeroing magnet on each rod.
p -= (
Expand Down
23 changes: 23 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[project]
name = "cad"
version = "0.0.0"
dependencies = [
"loguru",
"GitPython",
"build123d==0.9.0",
"ocp_vscode",
"bd_warehouse @ git+https://github.com/gumyr/bd_warehouse@b7e0dbe87e76244282651e903f6f55257a298219",
"build123d-ease==0.2.0.0",
"gggears @ git+https://github.com/GarryBGoode/gggears.git",
# "ocp_tessellate<3.0.10",
]
requires-python = ">=3.12"

[dependency-groups]
dev = [
"pyright>=1.1.403",
"ruff>=0.12.8",
]

[tool.pyright]
typeCheckingMode = "basic"
3 changes: 0 additions & 3 deletions pyrightconfig.json

This file was deleted.

11 changes: 0 additions & 11 deletions requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
target-version = "py313"
target-version = "py312"

line-length = 88

Expand Down
1,646 changes: 1,646 additions & 0 deletions uv.lock

Large diffs are not rendered by default.