SVG2DrawIOLib 1.0.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.
- svg2drawiolib-1.0.0/.github/workflows/ci.yml +82 -0
- svg2drawiolib-1.0.0/.github/workflows/publish.yml +95 -0
- svg2drawiolib-1.0.0/.github/workflows/release.yml +86 -0
- svg2drawiolib-1.0.0/.gitignore +33 -0
- svg2drawiolib-1.0.0/.pre-commit-config.yaml +37 -0
- svg2drawiolib-1.0.0/ARCHITECTURE.md +646 -0
- svg2drawiolib-1.0.0/CHANGELOG.md +50 -0
- svg2drawiolib-1.0.0/CONTRIBUTING.md +248 -0
- svg2drawiolib-1.0.0/LICENSE.txt +9 -0
- svg2drawiolib-1.0.0/MANIFEST.in +19 -0
- svg2drawiolib-1.0.0/Makefile +50 -0
- svg2drawiolib-1.0.0/PKG-INFO +220 -0
- svg2drawiolib-1.0.0/QUICKSTART.md +434 -0
- svg2drawiolib-1.0.0/README.md +186 -0
- svg2drawiolib-1.0.0/pyproject.toml +143 -0
- svg2drawiolib-1.0.0/src/SVG2DrawIOLib/__about__.py +3 -0
- svg2drawiolib-1.0.0/src/SVG2DrawIOLib/__init__.py +21 -0
- svg2drawiolib-1.0.0/src/SVG2DrawIOLib/cli/__init__.py +158 -0
- svg2drawiolib-1.0.0/src/SVG2DrawIOLib/cli/add.py +241 -0
- svg2drawiolib-1.0.0/src/SVG2DrawIOLib/cli/create.py +242 -0
- svg2drawiolib-1.0.0/src/SVG2DrawIOLib/cli/helpers.py +29 -0
- svg2drawiolib-1.0.0/src/SVG2DrawIOLib/cli/list.py +70 -0
- svg2drawiolib-1.0.0/src/SVG2DrawIOLib/cli/remove.py +71 -0
- svg2drawiolib-1.0.0/src/SVG2DrawIOLib/library_manager.py +269 -0
- svg2drawiolib-1.0.0/src/SVG2DrawIOLib/models.py +129 -0
- svg2drawiolib-1.0.0/src/SVG2DrawIOLib/svg_processor.py +317 -0
- svg2drawiolib-1.0.0/tests/__init__.py +0 -0
- svg2drawiolib-1.0.0/tests/conftest.py +14 -0
- svg2drawiolib-1.0.0/tests/test_cli.py +879 -0
- svg2drawiolib-1.0.0/tests/test_library_manager.py +477 -0
- svg2drawiolib-1.0.0/tests/test_models.py +86 -0
- svg2drawiolib-1.0.0/tests/test_svg_processor.py +286 -0
- svg2drawiolib-1.0.0/uv.lock +889 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, develop]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, develop]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
name: Test Python ${{ matrix.python-version }}
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
python-version: ["3.13", "3.14"]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Install uv
|
|
21
|
+
uses: astral-sh/setup-uv@v4
|
|
22
|
+
with:
|
|
23
|
+
version: "latest"
|
|
24
|
+
|
|
25
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
26
|
+
uses: actions/setup-python@v5
|
|
27
|
+
with:
|
|
28
|
+
python-version: ${{ matrix.python-version }}
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: |
|
|
32
|
+
uv pip install --system -e ".[dev]"
|
|
33
|
+
|
|
34
|
+
- name: Run ruff format check
|
|
35
|
+
run: ruff format --check src tests
|
|
36
|
+
|
|
37
|
+
- name: Run ruff linting
|
|
38
|
+
run: ruff check src tests
|
|
39
|
+
|
|
40
|
+
- name: Run mypy type checking
|
|
41
|
+
run: mypy src
|
|
42
|
+
|
|
43
|
+
- name: Run bandit security checks
|
|
44
|
+
run: bandit -r src -ll
|
|
45
|
+
|
|
46
|
+
- name: Run tests with coverage
|
|
47
|
+
run: |
|
|
48
|
+
pytest --cov-report=xml --cov-report=term --cov=src/SVG2DrawIOLib tests/
|
|
49
|
+
|
|
50
|
+
- name: Upload coverage to Codecov
|
|
51
|
+
uses: codecov/codecov-action@v4
|
|
52
|
+
if: matrix.python-version == '3.13'
|
|
53
|
+
with:
|
|
54
|
+
file: ./coverage.xml
|
|
55
|
+
fail_ci_if_error: false
|
|
56
|
+
|
|
57
|
+
build:
|
|
58
|
+
name: Build package
|
|
59
|
+
runs-on: ubuntu-latest
|
|
60
|
+
needs: test
|
|
61
|
+
|
|
62
|
+
steps:
|
|
63
|
+
- uses: actions/checkout@v4
|
|
64
|
+
|
|
65
|
+
- name: Install uv
|
|
66
|
+
uses: astral-sh/setup-uv@v4
|
|
67
|
+
|
|
68
|
+
- name: Set up Python
|
|
69
|
+
uses: actions/setup-python@v5
|
|
70
|
+
with:
|
|
71
|
+
python-version: "3.13"
|
|
72
|
+
|
|
73
|
+
- name: Build package
|
|
74
|
+
run: |
|
|
75
|
+
uv pip install --system twine
|
|
76
|
+
uv build
|
|
77
|
+
|
|
78
|
+
- name: Upload artifacts
|
|
79
|
+
uses: actions/upload-artifact@v4
|
|
80
|
+
with:
|
|
81
|
+
name: dist
|
|
82
|
+
path: dist/
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
environment:
|
|
9
|
+
description: 'Deployment environment'
|
|
10
|
+
required: true
|
|
11
|
+
default: 'testpypi'
|
|
12
|
+
type: choice
|
|
13
|
+
options:
|
|
14
|
+
- testpypi
|
|
15
|
+
- pypi
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
build:
|
|
19
|
+
name: Build distribution
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- name: Install uv
|
|
26
|
+
uses: astral-sh/setup-uv@v4
|
|
27
|
+
with:
|
|
28
|
+
version: "latest"
|
|
29
|
+
|
|
30
|
+
- name: Set up Python
|
|
31
|
+
uses: actions/setup-python@v5
|
|
32
|
+
with:
|
|
33
|
+
python-version: "3.13"
|
|
34
|
+
|
|
35
|
+
- name: Install build dependencies
|
|
36
|
+
run: |
|
|
37
|
+
uv pip install --system twine
|
|
38
|
+
|
|
39
|
+
- name: Build package
|
|
40
|
+
run: uv build
|
|
41
|
+
|
|
42
|
+
- name: Check distribution
|
|
43
|
+
run: twine check dist/*
|
|
44
|
+
|
|
45
|
+
- name: Upload artifacts
|
|
46
|
+
uses: actions/upload-artifact@v4
|
|
47
|
+
with:
|
|
48
|
+
name: python-package-distributions
|
|
49
|
+
path: dist/
|
|
50
|
+
|
|
51
|
+
publish-testpypi:
|
|
52
|
+
name: Publish to TestPyPI
|
|
53
|
+
if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'testpypi'
|
|
54
|
+
needs: build
|
|
55
|
+
runs-on: ubuntu-latest
|
|
56
|
+
environment:
|
|
57
|
+
name: testpypi
|
|
58
|
+
url: https://test.pypi.org/p/SVG2DrawIOLib
|
|
59
|
+
|
|
60
|
+
permissions:
|
|
61
|
+
id-token: write
|
|
62
|
+
|
|
63
|
+
steps:
|
|
64
|
+
- name: Download artifacts
|
|
65
|
+
uses: actions/download-artifact@v4
|
|
66
|
+
with:
|
|
67
|
+
name: python-package-distributions
|
|
68
|
+
path: dist/
|
|
69
|
+
|
|
70
|
+
- name: Publish to TestPyPI
|
|
71
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
72
|
+
with:
|
|
73
|
+
repository-url: https://test.pypi.org/legacy/
|
|
74
|
+
|
|
75
|
+
publish-pypi:
|
|
76
|
+
name: Publish to PyPI
|
|
77
|
+
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'pypi')
|
|
78
|
+
needs: build
|
|
79
|
+
runs-on: ubuntu-latest
|
|
80
|
+
environment:
|
|
81
|
+
name: pypi
|
|
82
|
+
url: https://pypi.org/p/SVG2DrawIOLib
|
|
83
|
+
|
|
84
|
+
permissions:
|
|
85
|
+
id-token: write
|
|
86
|
+
|
|
87
|
+
steps:
|
|
88
|
+
- name: Download artifacts
|
|
89
|
+
uses: actions/download-artifact@v4
|
|
90
|
+
with:
|
|
91
|
+
name: python-package-distributions
|
|
92
|
+
path: dist/
|
|
93
|
+
|
|
94
|
+
- name: Publish to PyPI
|
|
95
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
name: Create Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
version:
|
|
7
|
+
description: 'Version number (e.g., 0.2.0)'
|
|
8
|
+
required: true
|
|
9
|
+
type: string
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
create-release:
|
|
13
|
+
name: Create Release
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
permissions:
|
|
16
|
+
contents: write
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
with:
|
|
21
|
+
fetch-depth: 0
|
|
22
|
+
|
|
23
|
+
- name: Set up Python
|
|
24
|
+
uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: "3.13"
|
|
27
|
+
|
|
28
|
+
- name: Install uv
|
|
29
|
+
uses: astral-sh/setup-uv@v4
|
|
30
|
+
|
|
31
|
+
- name: Update version
|
|
32
|
+
run: |
|
|
33
|
+
VERSION="${{ github.event.inputs.version }}"
|
|
34
|
+
echo "Updating version to $VERSION"
|
|
35
|
+
sed -i "s/__version__ = .*/__version__ = \"$VERSION\"/" src/SVG2DrawIOLib/__about__.py
|
|
36
|
+
git config user.name "github-actions[bot]"
|
|
37
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
38
|
+
git add src/SVG2DrawIOLib/__about__.py
|
|
39
|
+
git commit -m "Bump version to $VERSION"
|
|
40
|
+
git push
|
|
41
|
+
|
|
42
|
+
- name: Create Git tag
|
|
43
|
+
run: |
|
|
44
|
+
VERSION="${{ github.event.inputs.version }}"
|
|
45
|
+
git tag -a "v$VERSION" -m "Release v$VERSION"
|
|
46
|
+
git push origin "v$VERSION"
|
|
47
|
+
|
|
48
|
+
- name: Generate changelog
|
|
49
|
+
id: changelog
|
|
50
|
+
run: |
|
|
51
|
+
VERSION="${{ github.event.inputs.version }}"
|
|
52
|
+
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
|
|
53
|
+
|
|
54
|
+
if [ -z "$PREV_TAG" ]; then
|
|
55
|
+
CHANGELOG=$(git log --pretty=format:"- %s (%h)" --no-merges)
|
|
56
|
+
else
|
|
57
|
+
CHANGELOG=$(git log ${PREV_TAG}..HEAD --pretty=format:"- %s (%h)" --no-merges)
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
|
|
61
|
+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
|
|
62
|
+
echo "EOF" >> $GITHUB_OUTPUT
|
|
63
|
+
|
|
64
|
+
- name: Create GitHub Release
|
|
65
|
+
uses: actions/create-release@v1
|
|
66
|
+
env:
|
|
67
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
68
|
+
with:
|
|
69
|
+
tag_name: v${{ github.event.inputs.version }}
|
|
70
|
+
release_name: Release v${{ github.event.inputs.version }}
|
|
71
|
+
body: |
|
|
72
|
+
## Changes in v${{ github.event.inputs.version }}
|
|
73
|
+
|
|
74
|
+
${{ steps.changelog.outputs.changelog }}
|
|
75
|
+
|
|
76
|
+
## Installation
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
pip install --upgrade SVG2DrawIOLib
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Full Changelog
|
|
83
|
+
|
|
84
|
+
See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for details.
|
|
85
|
+
draft: false
|
|
86
|
+
prerelease: false
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# IDE
|
|
2
|
+
.kiro
|
|
3
|
+
.claude
|
|
4
|
+
|
|
5
|
+
# Virt Env
|
|
6
|
+
.venv
|
|
7
|
+
|
|
8
|
+
# Caches
|
|
9
|
+
__pycache__
|
|
10
|
+
.pytest_cache
|
|
11
|
+
.ruff_cache
|
|
12
|
+
.mypy_cache
|
|
13
|
+
|
|
14
|
+
# Build
|
|
15
|
+
dist
|
|
16
|
+
build
|
|
17
|
+
*.egg-info
|
|
18
|
+
|
|
19
|
+
# Coverage
|
|
20
|
+
.coverage
|
|
21
|
+
htmlcov/
|
|
22
|
+
coverage.xml
|
|
23
|
+
|
|
24
|
+
# OS
|
|
25
|
+
.DS_Store
|
|
26
|
+
Thumbs.db
|
|
27
|
+
|
|
28
|
+
# Docs
|
|
29
|
+
DEPLOYMENT.md
|
|
30
|
+
DEPLOYMENT_CHECKLIST.md
|
|
31
|
+
|
|
32
|
+
# Testing Resources
|
|
33
|
+
resources/
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v4.5.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: trailing-whitespace
|
|
6
|
+
- id: end-of-file-fixer
|
|
7
|
+
- id: check-yaml
|
|
8
|
+
- id: check-added-large-files
|
|
9
|
+
- id: check-json
|
|
10
|
+
- id: check-toml
|
|
11
|
+
- id: check-merge-conflict
|
|
12
|
+
- id: debug-statements
|
|
13
|
+
|
|
14
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
15
|
+
rev: v0.8.4
|
|
16
|
+
hooks:
|
|
17
|
+
- id: ruff
|
|
18
|
+
args: [--fix]
|
|
19
|
+
- id: ruff-format
|
|
20
|
+
|
|
21
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
22
|
+
rev: v1.13.0
|
|
23
|
+
hooks:
|
|
24
|
+
- id: mypy
|
|
25
|
+
additional_dependencies:
|
|
26
|
+
- types-click
|
|
27
|
+
- types-setuptools
|
|
28
|
+
args: [--strict]
|
|
29
|
+
files: ^src/
|
|
30
|
+
exclude: ^src/SVG2DrawIOLib/cli/
|
|
31
|
+
|
|
32
|
+
- repo: https://github.com/PyCQA/bandit
|
|
33
|
+
rev: 1.7.10
|
|
34
|
+
hooks:
|
|
35
|
+
- id: bandit
|
|
36
|
+
args: [-r, src, -ll]
|
|
37
|
+
pass_filenames: false
|