mmdr 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.
- mmdr-0.1.0/.github/workflows/publish.yml +174 -0
- mmdr-0.1.0/.gitignore +136 -0
- mmdr-0.1.0/Cargo.lock +3243 -0
- mmdr-0.1.0/Cargo.toml +32 -0
- mmdr-0.1.0/PKG-INFO +265 -0
- mmdr-0.1.0/README.md +249 -0
- mmdr-0.1.0/examples/test.py +26 -0
- mmdr-0.1.0/pyproject.toml +49 -0
- mmdr-0.1.0/python/mmdr/__init__.py +51 -0
- mmdr-0.1.0/python/mmdr/__main__.py +191 -0
- mmdr-0.1.0/python/mmdr/_mmdr.pyi +42 -0
- mmdr-0.1.0/python/mmdr/diagram.py +183 -0
- mmdr-0.1.0/python/mmdr/py.typed +0 -0
- mmdr-0.1.0/src/lib.rs +237 -0
- mmdr-0.1.0/tests/conftest.py +60 -0
- mmdr-0.1.0/tests/test_diagram.py +65 -0
- mmdr-0.1.0/tests/test_render.py +85 -0
- mmdr-0.1.0/tests/test_render_png.py +113 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
name: Build and Publish mmdr
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
pull_request:
|
|
6
|
+
push:
|
|
7
|
+
branches:
|
|
8
|
+
- master
|
|
9
|
+
tags:
|
|
10
|
+
- "v*"
|
|
11
|
+
|
|
12
|
+
env:
|
|
13
|
+
FORCE_COLOR: 3
|
|
14
|
+
|
|
15
|
+
concurrency:
|
|
16
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
17
|
+
cancel-in-progress: true
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
|
|
21
|
+
# ---------------------------------------------------------------------------
|
|
22
|
+
# Build wheels for every platform / arch
|
|
23
|
+
# ---------------------------------------------------------------------------
|
|
24
|
+
|
|
25
|
+
build:
|
|
26
|
+
name: Build (${{ matrix.os }} · ${{ matrix.target }})
|
|
27
|
+
runs-on: ${{ matrix.os }}
|
|
28
|
+
strategy:
|
|
29
|
+
matrix:
|
|
30
|
+
include:
|
|
31
|
+
- os: ubuntu-latest
|
|
32
|
+
target: x86_64
|
|
33
|
+
manylinux: auto
|
|
34
|
+
- os: ubuntu-latest
|
|
35
|
+
target: aarch64
|
|
36
|
+
manylinux: auto
|
|
37
|
+
- os: windows-latest
|
|
38
|
+
target: x64
|
|
39
|
+
- os: macos-latest
|
|
40
|
+
target: x86_64
|
|
41
|
+
- os: macos-latest
|
|
42
|
+
target: aarch64
|
|
43
|
+
|
|
44
|
+
steps:
|
|
45
|
+
- uses: actions/checkout@v4
|
|
46
|
+
|
|
47
|
+
- uses: actions/setup-python@v5
|
|
48
|
+
with:
|
|
49
|
+
python-version: "3.12"
|
|
50
|
+
|
|
51
|
+
- name: Build wheel
|
|
52
|
+
uses: PyO3/maturin-action@v1
|
|
53
|
+
with:
|
|
54
|
+
target: ${{ matrix.target }}
|
|
55
|
+
manylinux: ${{ matrix.manylinux }}
|
|
56
|
+
args: --release --out dist
|
|
57
|
+
|
|
58
|
+
- uses: actions/upload-artifact@v4
|
|
59
|
+
with:
|
|
60
|
+
name: wheels-${{ matrix.os }}-${{ matrix.target }}
|
|
61
|
+
path: dist/*.whl
|
|
62
|
+
overwrite: false
|
|
63
|
+
|
|
64
|
+
sdist:
|
|
65
|
+
name: Source distribution
|
|
66
|
+
runs-on: ubuntu-latest
|
|
67
|
+
steps:
|
|
68
|
+
- uses: actions/checkout@v4
|
|
69
|
+
|
|
70
|
+
- name: Build sdist
|
|
71
|
+
uses: PyO3/maturin-action@v1
|
|
72
|
+
with:
|
|
73
|
+
command: sdist
|
|
74
|
+
args: --out dist
|
|
75
|
+
|
|
76
|
+
- uses: actions/upload-artifact@v4
|
|
77
|
+
with:
|
|
78
|
+
name: wheels-sdist
|
|
79
|
+
path: dist/*.tar.gz
|
|
80
|
+
overwrite: false
|
|
81
|
+
|
|
82
|
+
# ---------------------------------------------------------------------------
|
|
83
|
+
# Test — install the built wheel on every OS and run pytest
|
|
84
|
+
# ---------------------------------------------------------------------------
|
|
85
|
+
|
|
86
|
+
test:
|
|
87
|
+
name: Test (${{ matrix.os }})
|
|
88
|
+
needs: [build]
|
|
89
|
+
runs-on: ${{ matrix.os }}
|
|
90
|
+
strategy:
|
|
91
|
+
fail-fast: false
|
|
92
|
+
matrix:
|
|
93
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
94
|
+
|
|
95
|
+
steps:
|
|
96
|
+
- uses: actions/checkout@v4
|
|
97
|
+
|
|
98
|
+
- uses: actions/setup-python@v5
|
|
99
|
+
with:
|
|
100
|
+
python-version: "3.12"
|
|
101
|
+
|
|
102
|
+
- uses: actions/download-artifact@v4
|
|
103
|
+
with:
|
|
104
|
+
path: dist
|
|
105
|
+
merge-multiple: true
|
|
106
|
+
|
|
107
|
+
- name: Install wheel + test deps
|
|
108
|
+
shell: bash
|
|
109
|
+
run: |
|
|
110
|
+
pip install --no-index --upgrade --find-links ./dist mmdr
|
|
111
|
+
pip install pytest
|
|
112
|
+
|
|
113
|
+
- uses: JesseTG/rm@v1.0.3
|
|
114
|
+
with:
|
|
115
|
+
path: pyproject.toml
|
|
116
|
+
|
|
117
|
+
- name: Run tests
|
|
118
|
+
run: python3 -m pytest tests/ -v
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
# ---------------------------------------------------------------------------
|
|
122
|
+
# Release — GitHub release + PyPI on tags
|
|
123
|
+
# ---------------------------------------------------------------------------
|
|
124
|
+
|
|
125
|
+
release:
|
|
126
|
+
name: Release
|
|
127
|
+
needs: [test, sdist]
|
|
128
|
+
runs-on: ubuntu-latest
|
|
129
|
+
permissions:
|
|
130
|
+
contents: write
|
|
131
|
+
id-token: write
|
|
132
|
+
|
|
133
|
+
steps:
|
|
134
|
+
- name: Determine release name
|
|
135
|
+
id: meta
|
|
136
|
+
shell: bash
|
|
137
|
+
run: |
|
|
138
|
+
if [[ "${{ github.ref }}" =~ ^refs/tags/v.*$ ]]; then
|
|
139
|
+
echo "release_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
|
140
|
+
echo "is_tag=true" >> $GITHUB_OUTPUT
|
|
141
|
+
echo "prerelease=false" >> $GITHUB_OUTPUT
|
|
142
|
+
else
|
|
143
|
+
echo "release_name=__beta__" >> $GITHUB_OUTPUT
|
|
144
|
+
echo "is_tag=false" >> $GITHUB_OUTPUT
|
|
145
|
+
echo "prerelease=true" >> $GITHUB_OUTPUT
|
|
146
|
+
fi
|
|
147
|
+
|
|
148
|
+
- uses: actions/download-artifact@v4
|
|
149
|
+
with:
|
|
150
|
+
path: dist
|
|
151
|
+
merge-multiple: true
|
|
152
|
+
|
|
153
|
+
- name: List artifacts
|
|
154
|
+
run: ls -lh dist/
|
|
155
|
+
|
|
156
|
+
- name: Create or update GitHub release
|
|
157
|
+
uses: softprops/action-gh-release@v2
|
|
158
|
+
with:
|
|
159
|
+
tag_name: ${{ steps.meta.outputs.release_name }}
|
|
160
|
+
name: ${{ steps.meta.outputs.release_name }}
|
|
161
|
+
draft: false
|
|
162
|
+
prerelease: ${{ steps.meta.outputs.prerelease }}
|
|
163
|
+
files: dist/*
|
|
164
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
165
|
+
|
|
166
|
+
- name: Publish to PyPI
|
|
167
|
+
if: steps.meta.outputs.is_tag == 'true'
|
|
168
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
169
|
+
with:
|
|
170
|
+
packages-dir: dist
|
|
171
|
+
skip-existing: true
|
|
172
|
+
password: ${{ secrets.PYPI_PASS }}
|
|
173
|
+
user: ${{ secrets.PYPI_USER }}
|
|
174
|
+
|
mmdr-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# ==========================================
|
|
2
|
+
# Languages & Runtimes
|
|
3
|
+
# ==========================================
|
|
4
|
+
|
|
5
|
+
# --- Python ---
|
|
6
|
+
__pycache__/
|
|
7
|
+
*.py[cod]
|
|
8
|
+
*$py.class
|
|
9
|
+
*.so
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# Environments (Virtual Envs)
|
|
30
|
+
.env
|
|
31
|
+
.venv
|
|
32
|
+
env/
|
|
33
|
+
venv/
|
|
34
|
+
ENV/
|
|
35
|
+
env.bak/
|
|
36
|
+
venv.bak/
|
|
37
|
+
|
|
38
|
+
# pytest & coverage
|
|
39
|
+
.pytest_cache/
|
|
40
|
+
.coverage
|
|
41
|
+
htmlcov/
|
|
42
|
+
.directory
|
|
43
|
+
.mypy_cache/
|
|
44
|
+
.dmypy.json
|
|
45
|
+
dmypy.json
|
|
46
|
+
.hypothesis/
|
|
47
|
+
|
|
48
|
+
# --- Rust ---
|
|
49
|
+
# Generated by Cargo
|
|
50
|
+
/target/
|
|
51
|
+
|
|
52
|
+
# Cargo-Geiger outputs
|
|
53
|
+
*.geiger
|
|
54
|
+
|
|
55
|
+
# --- JavaScript / Node.js ---
|
|
56
|
+
# Dependencies
|
|
57
|
+
node_modules/
|
|
58
|
+
jspm_packages/
|
|
59
|
+
|
|
60
|
+
# Build outputs (CRA, Next.js, Vite, Nuxt, etc.)
|
|
61
|
+
.next/
|
|
62
|
+
.nuxt/
|
|
63
|
+
.out/
|
|
64
|
+
.output/
|
|
65
|
+
dist/
|
|
66
|
+
build/
|
|
67
|
+
|
|
68
|
+
# Logs
|
|
69
|
+
logs
|
|
70
|
+
*.log
|
|
71
|
+
npm-debug.log*
|
|
72
|
+
yarn-debug.log*
|
|
73
|
+
yarn-error.log*
|
|
74
|
+
pnpm-debug.log*
|
|
75
|
+
lerna-debug.log*
|
|
76
|
+
|
|
77
|
+
# Runtime data & Caches
|
|
78
|
+
.pnpm-store/
|
|
79
|
+
.pany/
|
|
80
|
+
.eslintcache
|
|
81
|
+
.stylelintcache
|
|
82
|
+
.cache/
|
|
83
|
+
.parcel-cache/
|
|
84
|
+
.turbo/
|
|
85
|
+
|
|
86
|
+
# Serverless Webpack directories
|
|
87
|
+
.webpack/
|
|
88
|
+
|
|
89
|
+
# Optional npm cache directory
|
|
90
|
+
.npm
|
|
91
|
+
|
|
92
|
+
# ==========================================
|
|
93
|
+
# IDEs and Editors
|
|
94
|
+
# ==========================================
|
|
95
|
+
|
|
96
|
+
# --- Visual Studio Code ---
|
|
97
|
+
.vscode/
|
|
98
|
+
!.vscode/extensions.json
|
|
99
|
+
*.code-workspace
|
|
100
|
+
|
|
101
|
+
# --- JetBrains (PyCharm, WebStorm, CLion, etc.) ---
|
|
102
|
+
.idea/
|
|
103
|
+
*.iws
|
|
104
|
+
*.iml
|
|
105
|
+
*.ipr
|
|
106
|
+
out/
|
|
107
|
+
|
|
108
|
+
# --- Sublime Text ---
|
|
109
|
+
*.sublime-project
|
|
110
|
+
*.sublime-workspace
|
|
111
|
+
|
|
112
|
+
# ==========================================
|
|
113
|
+
# Operating Systems & Generic
|
|
114
|
+
# ==========================================
|
|
115
|
+
|
|
116
|
+
# macOS
|
|
117
|
+
.DS_Store
|
|
118
|
+
.AppleDouble
|
|
119
|
+
.LSOverride
|
|
120
|
+
._*
|
|
121
|
+
|
|
122
|
+
# Windows
|
|
123
|
+
Thumbs.db
|
|
124
|
+
Thumbs.db:encryptable
|
|
125
|
+
ehthumbs.db
|
|
126
|
+
ehthumbs_vista.db
|
|
127
|
+
*.lnk
|
|
128
|
+
*.ini
|
|
129
|
+
|
|
130
|
+
# Linux
|
|
131
|
+
*~
|
|
132
|
+
.fuse_hidden*
|
|
133
|
+
.directory
|
|
134
|
+
.trash
|
|
135
|
+
|
|
136
|
+
/Cargo.lock
|