build123d-techdraw 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- build123d_techdraw-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +35 -0
- build123d_techdraw-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +28 -0
- build123d_techdraw-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +23 -0
- build123d_techdraw-0.1.0/.github/dependabot.yml +15 -0
- build123d_techdraw-0.1.0/.github/release.yml +32 -0
- build123d_techdraw-0.1.0/.github/workflows/ci.yml +67 -0
- build123d_techdraw-0.1.0/.github/workflows/docs.yml +74 -0
- build123d_techdraw-0.1.0/.github/workflows/release.yml +110 -0
- build123d_techdraw-0.1.0/.github/workflows/semantic-pr.yml +35 -0
- build123d_techdraw-0.1.0/.gitignore +56 -0
- build123d_techdraw-0.1.0/.pre-commit-config.yaml +16 -0
- build123d_techdraw-0.1.0/.python-version +1 -0
- build123d_techdraw-0.1.0/CONTRIBUTING.md +76 -0
- build123d_techdraw-0.1.0/LICENSE +176 -0
- build123d_techdraw-0.1.0/PKG-INFO +306 -0
- build123d_techdraw-0.1.0/README.md +274 -0
- build123d_techdraw-0.1.0/SECURITY.md +18 -0
- build123d_techdraw-0.1.0/docs/api-reference/annotations.md +37 -0
- build123d_techdraw-0.1.0/docs/api-reference/core.md +32 -0
- build123d_techdraw-0.1.0/docs/api-reference/index.md +8 -0
- build123d_techdraw-0.1.0/docs/api-reference/layout.md +9 -0
- build123d_techdraw-0.1.0/docs/api-reference/renderers.md +23 -0
- build123d_techdraw-0.1.0/docs/assets/examples/assembly_drawing.svg +384 -0
- build123d_techdraw-0.1.0/docs/assets/examples/assembly_drawing_white.svg +384 -0
- build123d_techdraw-0.1.0/docs/assets/examples/quickstart_enclosure.svg +281 -0
- build123d_techdraw-0.1.0/docs/assets/examples/quickstart_enclosure_white.svg +281 -0
- build123d_techdraw-0.1.0/docs/assets/examples/stepped_bracket.svg +331 -0
- build123d_techdraw-0.1.0/docs/assets/examples/stepped_bracket_white.svg +331 -0
- build123d_techdraw-0.1.0/docs/getting-started.md +145 -0
- build123d_techdraw-0.1.0/docs/index.md +93 -0
- build123d_techdraw-0.1.0/docs/user-guide/assembly-bom.md +90 -0
- build123d_techdraw-0.1.0/docs/user-guide/dimensions.md +117 -0
- build123d_techdraw-0.1.0/docs/user-guide/export-formats.md +63 -0
- build123d_techdraw-0.1.0/docs/user-guide/gdt-and-symbols.md +100 -0
- build123d_techdraw-0.1.0/docs/user-guide/multiview-layout.md +56 -0
- build123d_techdraw-0.1.0/docs/user-guide/sheets-and-views.md +120 -0
- build123d_techdraw-0.1.0/examples/README.md +46 -0
- build123d_techdraw-0.1.0/examples/algebraic_mode_bracket.py +90 -0
- build123d_techdraw-0.1.0/examples/assembly_bom.py +74 -0
- build123d_techdraw-0.1.0/examples/builder_mode_bracket.py +91 -0
- build123d_techdraw-0.1.0/examples/generate_all.py +36 -0
- build123d_techdraw-0.1.0/examples/output/assembly_drawing.dxf +3116 -0
- build123d_techdraw-0.1.0/examples/output/assembly_drawing.pdf +0 -0
- build123d_techdraw-0.1.0/examples/output/assembly_drawing.svg +384 -0
- build123d_techdraw-0.1.0/examples/output/assembly_drawing_white.svg +384 -0
- build123d_techdraw-0.1.0/examples/output/quickstart_enclosure.dxf +3116 -0
- build123d_techdraw-0.1.0/examples/output/quickstart_enclosure.pdf +0 -0
- build123d_techdraw-0.1.0/examples/output/quickstart_enclosure.svg +281 -0
- build123d_techdraw-0.1.0/examples/output/quickstart_enclosure_white.svg +281 -0
- build123d_techdraw-0.1.0/examples/output/stepped_bracket.dxf +3116 -0
- build123d_techdraw-0.1.0/examples/output/stepped_bracket.pdf +0 -0
- build123d_techdraw-0.1.0/examples/output/stepped_bracket.svg +331 -0
- build123d_techdraw-0.1.0/examples/output/stepped_bracket_white.svg +331 -0
- build123d_techdraw-0.1.0/examples/quickstart_enclosure.py +42 -0
- build123d_techdraw-0.1.0/examples/stepped_bracket.py +75 -0
- build123d_techdraw-0.1.0/mkdocs.yml +87 -0
- build123d_techdraw-0.1.0/pyproject.toml +126 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/__init__.py +182 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/_version.py +24 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/annotations/__init__.py +77 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/annotations/callouts.py +730 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/annotations/centerlines.py +284 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/annotations/dimensions.py +1226 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/annotations/gdt.py +263 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/annotations/resolver.py +175 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/annotations/surface.py +129 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/annotations/symbols.py +40 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/annotations/tables.py +257 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/builder.py +917 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/context.py +17 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/core/__init__.py +25 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/core/booklet.py +100 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/core/scale.py +67 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/core/sheet.py +1200 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/core/title_block.py +403 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/core/view.py +1802 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/layout/__init__.py +15 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/layout/linter.py +228 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/layout/multiview.py +544 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/py.typed +0 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/recognizers/__init__.py +15 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/recognizers/features.py +240 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/renderers/__init__.py +15 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/renderers/dxf.py +235 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/renderers/pdf.py +376 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/renderers/svg.py +28 -0
- build123d_techdraw-0.1.0/src/build123d_techdraw/renderers/theme.py +189 -0
- build123d_techdraw-0.1.0/tests/test_booklet_pdf_bookmarks.py +74 -0
- build123d_techdraw-0.1.0/tests/test_builder_and_algebraic.py +491 -0
- build123d_techdraw-0.1.0/tests/test_callouts_advanced.py +98 -0
- build123d_techdraw-0.1.0/tests/test_detail_and_break_views.py +218 -0
- build123d_techdraw-0.1.0/tests/test_dimensions.py +116 -0
- build123d_techdraw-0.1.0/tests/test_dimensions_advanced.py +176 -0
- build123d_techdraw-0.1.0/tests/test_dxf_full_sheet.py +65 -0
- build123d_techdraw-0.1.0/tests/test_gdt.py +203 -0
- build123d_techdraw-0.1.0/tests/test_init.py +8 -0
- build123d_techdraw-0.1.0/tests/test_linter.py +102 -0
- build123d_techdraw-0.1.0/tests/test_multiview.py +166 -0
- build123d_techdraw-0.1.0/tests/test_ordinate_dimensions.py +82 -0
- build123d_techdraw-0.1.0/tests/test_projection.py +68 -0
- build123d_techdraw-0.1.0/tests/test_recognizers.py +84 -0
- build123d_techdraw-0.1.0/tests/test_renderers.py +179 -0
- build123d_techdraw-0.1.0/tests/test_scale.py +64 -0
- build123d_techdraw-0.1.0/tests/test_sheet.py +138 -0
- build123d_techdraw-0.1.0/tests/test_view_dxf_export.py +98 -0
- build123d_techdraw-0.1.0/tests/test_views_advanced.py +130 -0
- build123d_techdraw-0.1.0/uv.lock +3245 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
description: Create a report to help us improve build123d-techdraw
|
|
3
|
+
title: "[Bug]: "
|
|
4
|
+
labels: ["bug"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Thanks for taking the time to report a bug! Please fill out the sections below.
|
|
10
|
+
- type: textarea
|
|
11
|
+
id: description
|
|
12
|
+
attributes:
|
|
13
|
+
label: Description
|
|
14
|
+
description: A clear and concise description of what the bug is.
|
|
15
|
+
validations:
|
|
16
|
+
required: true
|
|
17
|
+
- type: textarea
|
|
18
|
+
id: reproduction
|
|
19
|
+
attributes:
|
|
20
|
+
label: Minimal Reproducible Example
|
|
21
|
+
description: Please provide a self-contained Python script using build123d-techdraw reproducing the issue.
|
|
22
|
+
render: python
|
|
23
|
+
validations:
|
|
24
|
+
required: true
|
|
25
|
+
- type: textarea
|
|
26
|
+
id: environment
|
|
27
|
+
attributes:
|
|
28
|
+
label: Environment Info
|
|
29
|
+
description: |
|
|
30
|
+
- Python version (`python --version`)
|
|
31
|
+
- build123d version (`pip show build123d`)
|
|
32
|
+
- build123d-techdraw version (`pip show build123d-techdraw`)
|
|
33
|
+
- OS (Ubuntu, Windows WSL, macOS, etc.)
|
|
34
|
+
validations:
|
|
35
|
+
required: true
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
name: Feature Request
|
|
2
|
+
description: Suggest an idea or enhancement for build123d-techdraw
|
|
3
|
+
title: "[Feature]: "
|
|
4
|
+
labels: ["enhancement"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Thank you for suggesting an idea! Please explain your use case and desired API.
|
|
10
|
+
- type: textarea
|
|
11
|
+
id: problem
|
|
12
|
+
attributes:
|
|
13
|
+
label: Problem or Motivation
|
|
14
|
+
description: Is your feature request related to a problem or missing standard drafting capability?
|
|
15
|
+
validations:
|
|
16
|
+
required: true
|
|
17
|
+
- type: textarea
|
|
18
|
+
id: proposed-solution
|
|
19
|
+
attributes:
|
|
20
|
+
label: Proposed Solution / API
|
|
21
|
+
description: Describe what the solution or Python API would look like.
|
|
22
|
+
validations:
|
|
23
|
+
required: true
|
|
24
|
+
- type: textarea
|
|
25
|
+
id: alternatives
|
|
26
|
+
attributes:
|
|
27
|
+
label: Alternatives Considered
|
|
28
|
+
description: Any alternative solutions or features you've considered.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
## Summary of Changes
|
|
2
|
+
|
|
3
|
+
A clear and concise description of what this PR accomplishes.
|
|
4
|
+
|
|
5
|
+
## Related Issues
|
|
6
|
+
|
|
7
|
+
Closes #
|
|
8
|
+
|
|
9
|
+
## Type of Change
|
|
10
|
+
|
|
11
|
+
- [ ] `feat`: New feature (non-breaking change which adds functionality)
|
|
12
|
+
- [ ] `fix`: Bug fix (non-breaking change which fixes an issue)
|
|
13
|
+
- [ ] `docs`: Documentation updates or additions
|
|
14
|
+
- [ ] `refactor`: Code change that neither fixes a bug nor adds a feature
|
|
15
|
+
- [ ] `test`: Adding missing tests or correcting existing tests
|
|
16
|
+
- [ ] `chore`: Changes to build process, tooling, or CI
|
|
17
|
+
|
|
18
|
+
## Checklist
|
|
19
|
+
|
|
20
|
+
- [ ] My code adheres to the project's styling and type safety standards (`uv run ruff check` and `uv run ruff format --check`).
|
|
21
|
+
- [ ] Full static typing added and verified (`uv run mypy src`).
|
|
22
|
+
- [ ] All new and existing tests pass locally (`uv run pytest`).
|
|
23
|
+
- [ ] Documentation updated where appropriate.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "github-actions"
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: "weekly"
|
|
7
|
+
commit-message:
|
|
8
|
+
prefix: "chore(ci)"
|
|
9
|
+
|
|
10
|
+
- package-ecosystem: "pip"
|
|
11
|
+
directory: "/"
|
|
12
|
+
schedule:
|
|
13
|
+
interval: "weekly"
|
|
14
|
+
commit-message:
|
|
15
|
+
prefix: "chore(deps)"
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
changelog:
|
|
2
|
+
categories:
|
|
3
|
+
- title: "๐ Features"
|
|
4
|
+
labels:
|
|
5
|
+
- "feature"
|
|
6
|
+
- "enhancement"
|
|
7
|
+
keywords:
|
|
8
|
+
- "feat"
|
|
9
|
+
- "feature"
|
|
10
|
+
- title: "๐ Bug Fixes"
|
|
11
|
+
labels:
|
|
12
|
+
- "bug"
|
|
13
|
+
- "fix"
|
|
14
|
+
keywords:
|
|
15
|
+
- "fix"
|
|
16
|
+
- title: "๐ Documentation"
|
|
17
|
+
labels:
|
|
18
|
+
- "documentation"
|
|
19
|
+
- "docs"
|
|
20
|
+
keywords:
|
|
21
|
+
- "docs"
|
|
22
|
+
- title: "๐ง Maintenance & Internal"
|
|
23
|
+
labels:
|
|
24
|
+
- "chore"
|
|
25
|
+
- "refactor"
|
|
26
|
+
- "ci"
|
|
27
|
+
- "dependencies"
|
|
28
|
+
keywords:
|
|
29
|
+
- "chore"
|
|
30
|
+
- "refactor"
|
|
31
|
+
- "test"
|
|
32
|
+
- "ci"
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, master]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, master]
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
lint:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v7
|
|
21
|
+
- name: Install uv
|
|
22
|
+
uses: astral-sh/setup-uv@v7
|
|
23
|
+
with:
|
|
24
|
+
enable-cache: true
|
|
25
|
+
- name: Set up Python
|
|
26
|
+
run: uv python install 3.12
|
|
27
|
+
- name: Lint with ruff
|
|
28
|
+
run: uv run ruff check --output-format=github .
|
|
29
|
+
- name: Format check with ruff
|
|
30
|
+
run: uv run ruff format --check .
|
|
31
|
+
|
|
32
|
+
type-check:
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
steps:
|
|
35
|
+
- uses: actions/checkout@v7
|
|
36
|
+
- name: Install uv
|
|
37
|
+
uses: astral-sh/setup-uv@v7
|
|
38
|
+
with:
|
|
39
|
+
enable-cache: true
|
|
40
|
+
- name: Set up Python
|
|
41
|
+
run: uv python install 3.12
|
|
42
|
+
- name: Install dependencies
|
|
43
|
+
run: uv sync --all-groups
|
|
44
|
+
- name: Run mypy
|
|
45
|
+
run: uv run mypy src
|
|
46
|
+
|
|
47
|
+
test:
|
|
48
|
+
runs-on: ubuntu-latest
|
|
49
|
+
strategy:
|
|
50
|
+
matrix:
|
|
51
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
52
|
+
steps:
|
|
53
|
+
- uses: actions/checkout@v7
|
|
54
|
+
- name: Install system dependencies for OCP / OpenGL
|
|
55
|
+
run: |
|
|
56
|
+
sudo apt-get update
|
|
57
|
+
sudo apt-get install -y libgl1 libegl1 libxrender1 libxcursor1 libxft2 libxinerama1
|
|
58
|
+
- name: Install uv
|
|
59
|
+
uses: astral-sh/setup-uv@v7
|
|
60
|
+
with:
|
|
61
|
+
enable-cache: true
|
|
62
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
63
|
+
run: uv python install ${{ matrix.python-version }}
|
|
64
|
+
- name: Install dependencies
|
|
65
|
+
run: uv sync --all-groups --python ${{ matrix.python-version }}
|
|
66
|
+
- name: Run tests with pytest
|
|
67
|
+
run: uv run --python ${{ matrix.python-version }} pytest
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
name: Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, master]
|
|
6
|
+
paths:
|
|
7
|
+
- "docs/**"
|
|
8
|
+
- "mkdocs.yml"
|
|
9
|
+
- "src/**"
|
|
10
|
+
- "pyproject.toml"
|
|
11
|
+
- ".github/workflows/docs.yml"
|
|
12
|
+
pull_request:
|
|
13
|
+
branches: [main, master]
|
|
14
|
+
paths:
|
|
15
|
+
- "docs/**"
|
|
16
|
+
- "mkdocs.yml"
|
|
17
|
+
- "src/**"
|
|
18
|
+
- "pyproject.toml"
|
|
19
|
+
- ".github/workflows/docs.yml"
|
|
20
|
+
workflow_dispatch:
|
|
21
|
+
|
|
22
|
+
permissions:
|
|
23
|
+
contents: read
|
|
24
|
+
pages: write
|
|
25
|
+
id-token: write
|
|
26
|
+
|
|
27
|
+
concurrency:
|
|
28
|
+
group: pages
|
|
29
|
+
cancel-in-progress: false
|
|
30
|
+
|
|
31
|
+
jobs:
|
|
32
|
+
build:
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
steps:
|
|
35
|
+
- uses: actions/checkout@v4
|
|
36
|
+
with:
|
|
37
|
+
fetch-depth: 0
|
|
38
|
+
|
|
39
|
+
- name: Install system dependencies for OCP / OpenGL
|
|
40
|
+
run: |
|
|
41
|
+
sudo apt-get update
|
|
42
|
+
sudo apt-get install -y libgl1 libegl1 libxrender1 libxcursor1 libxft2 libxinerama1
|
|
43
|
+
|
|
44
|
+
- name: Install uv
|
|
45
|
+
uses: astral-sh/setup-uv@v5
|
|
46
|
+
with:
|
|
47
|
+
enable-cache: true
|
|
48
|
+
|
|
49
|
+
- name: Set up Python
|
|
50
|
+
run: uv python install 3.12
|
|
51
|
+
|
|
52
|
+
- name: Install dependencies
|
|
53
|
+
run: uv sync --group docs --group dev
|
|
54
|
+
|
|
55
|
+
- name: Build documentation
|
|
56
|
+
run: uv run mkdocs build --strict
|
|
57
|
+
|
|
58
|
+
- name: Upload Pages artifact
|
|
59
|
+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
|
|
60
|
+
uses: actions/upload-pages-artifact@v3
|
|
61
|
+
with:
|
|
62
|
+
path: site
|
|
63
|
+
|
|
64
|
+
deploy:
|
|
65
|
+
environment:
|
|
66
|
+
name: github-pages
|
|
67
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
68
|
+
runs-on: ubuntu-latest
|
|
69
|
+
needs: build
|
|
70
|
+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
|
|
71
|
+
steps:
|
|
72
|
+
- name: Deploy to GitHub Pages
|
|
73
|
+
id: deployment
|
|
74
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
dry_run:
|
|
9
|
+
description: "Dry run (build and validate only, do not publish to PyPI)"
|
|
10
|
+
required: true
|
|
11
|
+
type: boolean
|
|
12
|
+
default: false
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: write
|
|
16
|
+
id-token: write
|
|
17
|
+
attestations: write
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
validate-and-build:
|
|
21
|
+
name: Validate and Build Package
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- name: Checkout repository
|
|
25
|
+
uses: actions/checkout@v7
|
|
26
|
+
with:
|
|
27
|
+
fetch-depth: 0
|
|
28
|
+
|
|
29
|
+
- name: Install system dependencies for OCP / OpenGL
|
|
30
|
+
run: |
|
|
31
|
+
sudo apt-get update
|
|
32
|
+
sudo apt-get install -y libgl1 libegl1 libxrender1 libxcursor1 libxft2 libxinerama1
|
|
33
|
+
|
|
34
|
+
- name: Install uv
|
|
35
|
+
uses: astral-sh/setup-uv@v7
|
|
36
|
+
with:
|
|
37
|
+
enable-cache: true
|
|
38
|
+
|
|
39
|
+
- name: Set up Python
|
|
40
|
+
run: uv python install 3.12
|
|
41
|
+
|
|
42
|
+
- name: Install dependencies
|
|
43
|
+
run: uv sync --all-groups
|
|
44
|
+
|
|
45
|
+
- name: Run linter and format checks
|
|
46
|
+
run: |
|
|
47
|
+
uv run ruff check .
|
|
48
|
+
uv run ruff format --check .
|
|
49
|
+
|
|
50
|
+
- name: Run type checks
|
|
51
|
+
run: uv run mypy src
|
|
52
|
+
|
|
53
|
+
- name: Run test suite
|
|
54
|
+
run: uv run pytest
|
|
55
|
+
|
|
56
|
+
- name: Build wheel and source distribution
|
|
57
|
+
run: uv build
|
|
58
|
+
|
|
59
|
+
- name: Validate distribution artifacts
|
|
60
|
+
run: uv run twine check dist/*
|
|
61
|
+
|
|
62
|
+
- name: Generate build provenance attestations
|
|
63
|
+
uses: actions/attest-build-provenance@v4
|
|
64
|
+
if: github.event_name == 'release'
|
|
65
|
+
with:
|
|
66
|
+
subject-path: 'dist/*'
|
|
67
|
+
|
|
68
|
+
- name: Upload build artifacts
|
|
69
|
+
uses: actions/upload-artifact@v7
|
|
70
|
+
with:
|
|
71
|
+
name: python-package-distributions
|
|
72
|
+
path: dist/
|
|
73
|
+
retention-days: 7
|
|
74
|
+
|
|
75
|
+
publish-pypi:
|
|
76
|
+
name: Publish to PyPI
|
|
77
|
+
needs: [validate-and-build]
|
|
78
|
+
runs-on: ubuntu-latest
|
|
79
|
+
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && !inputs.dry_run)
|
|
80
|
+
environment:
|
|
81
|
+
name: pypi
|
|
82
|
+
url: https://pypi.org/p/build123d-techdraw
|
|
83
|
+
steps:
|
|
84
|
+
- name: Download build artifacts
|
|
85
|
+
uses: actions/download-artifact@v8
|
|
86
|
+
with:
|
|
87
|
+
name: python-package-distributions
|
|
88
|
+
path: dist/
|
|
89
|
+
|
|
90
|
+
- name: Publish to PyPI via Trusted Publishing (OIDC)
|
|
91
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
92
|
+
with:
|
|
93
|
+
packages-dir: dist/
|
|
94
|
+
|
|
95
|
+
attach-github-release:
|
|
96
|
+
name: Attach Assets to GitHub Release
|
|
97
|
+
needs: [validate-and-build]
|
|
98
|
+
runs-on: ubuntu-latest
|
|
99
|
+
if: github.event_name == 'release'
|
|
100
|
+
steps:
|
|
101
|
+
- name: Download build artifacts
|
|
102
|
+
uses: actions/download-artifact@v8
|
|
103
|
+
with:
|
|
104
|
+
name: python-package-distributions
|
|
105
|
+
path: dist/
|
|
106
|
+
|
|
107
|
+
- name: Upload release assets to GitHub Release
|
|
108
|
+
uses: softprops/action-gh-release@v2
|
|
109
|
+
with:
|
|
110
|
+
files: dist/*
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: "Lint Pull Request"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request_target:
|
|
5
|
+
types:
|
|
6
|
+
- opened
|
|
7
|
+
- edited
|
|
8
|
+
- synchronize
|
|
9
|
+
- reopened
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
pull-requests: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
validate-pr-title:
|
|
16
|
+
name: Validate Conventional Commit PR Title
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: amannn/action-semantic-pull-request@v5
|
|
20
|
+
env:
|
|
21
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
22
|
+
with:
|
|
23
|
+
types: |
|
|
24
|
+
feat
|
|
25
|
+
fix
|
|
26
|
+
docs
|
|
27
|
+
style
|
|
28
|
+
refactor
|
|
29
|
+
perf
|
|
30
|
+
test
|
|
31
|
+
build
|
|
32
|
+
ci
|
|
33
|
+
chore
|
|
34
|
+
revert
|
|
35
|
+
requireScope: false
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
src/build123d_techdraw/_version.py
|
|
8
|
+
build/
|
|
9
|
+
develop-eggs/
|
|
10
|
+
dist/
|
|
11
|
+
downloads/
|
|
12
|
+
eggs/
|
|
13
|
+
.eggs/
|
|
14
|
+
lib/
|
|
15
|
+
lib64/
|
|
16
|
+
parts/
|
|
17
|
+
sdist/
|
|
18
|
+
var/
|
|
19
|
+
wheels/
|
|
20
|
+
share/python-wheels/
|
|
21
|
+
*.egg-info/
|
|
22
|
+
.installed.cfg
|
|
23
|
+
*.egg
|
|
24
|
+
MANIFEST
|
|
25
|
+
|
|
26
|
+
# Virtual environments
|
|
27
|
+
.venv/
|
|
28
|
+
env/
|
|
29
|
+
venv/
|
|
30
|
+
ENV/
|
|
31
|
+
env.bak/
|
|
32
|
+
venv.bak/
|
|
33
|
+
|
|
34
|
+
# Testing & Coverage
|
|
35
|
+
.pytest_cache/
|
|
36
|
+
.coverage
|
|
37
|
+
.coverage.*
|
|
38
|
+
htmlcov/
|
|
39
|
+
coverage.xml
|
|
40
|
+
|
|
41
|
+
# Documentation
|
|
42
|
+
site/
|
|
43
|
+
.cache/
|
|
44
|
+
|
|
45
|
+
# Linters & Type Checking
|
|
46
|
+
.mypy_cache/
|
|
47
|
+
.ruff_cache/
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
# IDE & OS
|
|
51
|
+
.vscode/
|
|
52
|
+
.idea/
|
|
53
|
+
*.swp
|
|
54
|
+
*.swo
|
|
55
|
+
*~
|
|
56
|
+
.DS_Store
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v5.0.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: trailing-whitespace
|
|
6
|
+
- id: end-of-file-fixer
|
|
7
|
+
- id: check-yaml
|
|
8
|
+
- id: check-toml
|
|
9
|
+
- id: check-added-large-files
|
|
10
|
+
|
|
11
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
12
|
+
rev: v0.9.0
|
|
13
|
+
hooks:
|
|
14
|
+
- id: ruff
|
|
15
|
+
args: [--fix]
|
|
16
|
+
- id: ruff-format
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.14
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Contributing to build123d-techdraw
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to `build123d-techdraw`!
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## ๐ ๏ธ Development Setup
|
|
8
|
+
|
|
9
|
+
We use [`uv`](https://github.com/astral-sh/uv) for fast, deterministic Python environment and dependency management.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Clone the repository
|
|
13
|
+
git clone https://github.com/szubster/build123d-techdraw.git
|
|
14
|
+
cd build123d-techdraw
|
|
15
|
+
|
|
16
|
+
# Install dependencies into virtual environment
|
|
17
|
+
uv sync --all-groups
|
|
18
|
+
|
|
19
|
+
# Run tests
|
|
20
|
+
uv run pytest
|
|
21
|
+
|
|
22
|
+
# Run linter & formatter
|
|
23
|
+
uv run ruff check
|
|
24
|
+
uv run ruff format --check
|
|
25
|
+
|
|
26
|
+
# Run static type checker
|
|
27
|
+
uv run mypy src
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## ๐ Conventional Commits & Release Management
|
|
33
|
+
|
|
34
|
+
We follow the [Conventional Commits](https://www.conventionalcommits.org/) specification (v1.0.0). Every commit message and pull request title must follow this format:
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
<type>(<scope>): <short description>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Allowed Types
|
|
41
|
+
- **`feat:`** A new feature (triggers a MINOR version bump).
|
|
42
|
+
- **`fix:`** A bug fix (triggers a PATCH version bump).
|
|
43
|
+
- **`docs:`** Documentation changes.
|
|
44
|
+
- **`refactor:`** Code changes that neither fix a bug nor add a feature.
|
|
45
|
+
- **`test:`** Adding or refactoring tests.
|
|
46
|
+
- **`chore:`** Maintenance, build configuration, or dependency updates.
|
|
47
|
+
- **`ci:`** Changes to GitHub Actions or CI scripts.
|
|
48
|
+
|
|
49
|
+
### Breaking Changes
|
|
50
|
+
Indicate breaking changes with a `!` after the type/scope (e.g., `feat(core)!: change projection API signature`) or by including `BREAKING CHANGE:` in the commit footer. This triggers a MAJOR version bump.
|
|
51
|
+
|
|
52
|
+
### Examples
|
|
53
|
+
- `feat(core): add ISO A3 and A4 sheet templates with border markings`
|
|
54
|
+
- `fix(renderers): correct line cap styling in dark blueprint SVG export`
|
|
55
|
+
- `docs: add interactive preview examples to README`
|
|
56
|
+
- `test(dimensions): add test coverage for diameter callout geometry`
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## ๐งช Testing & Code Quality Requirements
|
|
61
|
+
|
|
62
|
+
Before submitting a pull request, ensure all checks pass:
|
|
63
|
+
|
|
64
|
+
1. **Linting & Formatting:**
|
|
65
|
+
```bash
|
|
66
|
+
uv run ruff check --fix
|
|
67
|
+
uv run ruff format
|
|
68
|
+
```
|
|
69
|
+
2. **Type Checking:** Full strict type annotations are required on all public classes, functions, and module interfaces:
|
|
70
|
+
```bash
|
|
71
|
+
uv run mypy src
|
|
72
|
+
```
|
|
73
|
+
3. **Tests & Coverage:**
|
|
74
|
+
```bash
|
|
75
|
+
uv run pytest
|
|
76
|
+
```
|