diff --git a/.gitattributes b/.gitattributes index deb5a71c8..11fb9d82a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,8 +2,8 @@ docs/* linguist-documentation examples/* linguist-documentation tutorial/* linguist-documentation -**/*.bom.tsv linguist-generated -**/*.bom.csv linguist-generated +**/*.tsv linguist-generated +**/*.csv linguist-generated **/*.gv linguist-generated **/*.html linguist-generated **/*.png linguist-generated diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 301ac18ad..533b74fb3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,25 +8,25 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [3.7, 3.8] + python-version: ["3.8", "3.10"] steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Setup Graphviz - uses: ts-graphviz/setup-graphviz@v1 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install . - - name: Create Examples - run: PYTHONPATH=$(pwd)/src:$PYTHONPATH cd src/wireviz/ && python build_examples.py - - name: Upload examples, demos, and tutorials - uses: actions/upload-artifact@v2 - with: - name: examples-and-tutorials - path: | - examples/ - tutorial/ \ No newline at end of file + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Setup Graphviz + uses: ts-graphviz/setup-graphviz@v1 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install . + - name: Create Examples + run: PYTHONPATH=$(pwd)/src:$PYTHONPATH python src/wireviz/tools/build_examples.py + - name: Upload examples, demos, and tutorials + uses: actions/upload-artifact@v2 + with: + name: examples-and-tutorials + path: | + examples/ + tutorial/ diff --git a/.gitignore b/.gitignore index 7484ecbd7..dc58d27e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,21 @@ +# OS-specific files .DS_Store +desktop.ini +Thumbs.db + +# Development aids .idea/ -.eggs -__pycache__ -.*.swp -*.egg-info -*.pyc -build -data -dist +.vscode/ +temp/ venv/ .venv/ -desktop.ini -thumbs.db -temp/ + +# Build/compile/release artifacts +build/ +dist/ +*.egg-info +*.pyc + +# Other temporary files +__pycache__ +.*.swp diff --git a/cleanup.sh b/cleanup.sh new file mode 100755 index 000000000..9c774be4b --- /dev/null +++ b/cleanup.sh @@ -0,0 +1,5 @@ +#!/bin/zsh + +autoflake -i --remove-all-unused-imports src/wireviz/*.py +isort src/wireviz/*py +black src/wireviz/*.py diff --git a/devtools.txt b/devtools.txt new file mode 100644 index 000000000..adf89cad0 --- /dev/null +++ b/devtools.txt @@ -0,0 +1,12 @@ +# The following tools have proven useful during development +# Feel free to install while inside the WireViz virtualenv, using: +# pip install -r devtools.txt + +# Code formatting +black # black src/wireviz/*.py +isort # isort src/wireviz/*py + +# Development aids +pudb # import pudb; pudb.set_trace() +autoflake # autoflake -i --remove-all-unused-imports src/wireviz/*.py +pyan # pyan3 src/wireviz/*.py -uncge --html > temp/pyan.html diff --git a/docs/README.md b/docs/README.md index 732f67145..5e14600f9 100644 --- a/docs/README.md +++ b/docs/README.md @@ -74,13 +74,13 @@ Output file: ![Sample output diagram](../examples/demo01.png) -[Bill of Materials](../examples/demo01.bom.tsv) (auto-generated) +[Bill of Materials](../examples/demo01.tsv) (auto-generated) ### Demo 02 ![](../examples/demo02.png) -[Source](../examples/demo02.yml) - [Bill of Materials](../examples/demo02.bom.tsv) +[Source](../examples/demo02.yml) - [Bill of Materials](../examples/demo02.tsv) ### Syntax, tutorial and example gallery @@ -133,7 +133,7 @@ Depending on the options specified, this will output some or all of the followin mywire.gv GraphViz output mywire.svg Wiring diagram as vector image mywire.png Wiring diagram as raster image -mywire.bom.tsv BOM (bill of materials) as tab-separated text file +mywire.tsv BOM (bill of materials) as tab-separated text file mywire.html HTML page with wiring diagram and BOM embedded ``` diff --git a/docs/buildscript.md b/docs/buildscript.md index 2655770e8..d39eab416 100644 --- a/docs/buildscript.md +++ b/docs/buildscript.md @@ -26,7 +26,7 @@ Possible group names: - `tutorial` to process`tutorial/{readme.md,tutorial*.*}` - `demos` to process`examples/demo*.*` - Affected filetypes: `.gv`, `.bom.tsv`, `.png`, `.svg`, `.html` + Affected filetypes: `.gv`, `.tsv`, `.png`, `.svg`, `.html` ## Usage hints diff --git a/examples/demo01.gv b/examples/demo01.gv index 8b327c4d9..be6313a1f 100644 --- a/examples/demo01.gv +++ b/examples/demo01.gv @@ -60,6 +60,8 @@ graph { > fillcolor="#FFFFFF" shape=box style=filled] + edge [color="#000000:#ffffff:#000000"] + X1:p7r:e -- X1:p8r:e X2 [label=<
diff --git a/examples/demo01.html b/examples/demo01.html
index 2786c1c79..8dcb55017 100644
--- a/examples/demo01.html
+++ b/examples/demo01.html
@@ -1,7 +1,7 @@
-
+
|