Major refactor from upstream PR #455 adding jumper wires as a first-class
component type. Includes renamed modules (DataClasses→wv_dataclasses,
Harness→wv_harness), new color system, and updated BOM generation.
Preserved Jinja2 preprocessor (PR #382) in wv_cli.py alongside jumper changes.
A number of such warnings showed up when running e.g.
PYTHONWARNINGS=always python build_examples.py
PYTHONWARNINGS=always wireviz ../../examples/demo0?.yml
See https://github.com/wireviz/WireViz/pull/309#issuecomment-2170988381
Fix: All open() calls should be in a "with open() as x" statement
to ensure closing the file when exiting the block in any way.
Otherwise, use the new file_read_text() or file_write_text() functions
to read or write the whole utf-8 text file and closing it.
Co-authored-by: kvid <kvid@users.noreply.github.com>
Add local replacement_if_used() that call function to read the file
only when needed and append the return value as replacement.
Co-authored-by: kvid <kvid@users.noreply.github.com>
This will enable users to replace the SVG diagram with an embedded PNG,
that is an improved work-around when the SVG output from Graphviz
is not looking good. Suggested as work-around for Graphviz bug in
https://github.com/wireviz/WireViz/issues/175#issuecomment-2132206026
Co-authored-by: kvid <kvid@users.noreply.github.com>
This will e.g. enable users to replace the SVG diagram with PNG,
that is needed as a work-around when the SVG output from Graphviz
is not looking good. Suggested as work-around for Graphviz bug in
https://github.com/wireviz/WireViz/issues/175#issuecomment-2132206026
Co-authored-by: kvid <kvid@users.noreply.github.com>
The CLI handling code was redesigned for v0.4 and it seems the code
to assign a default title from v0.3.1 has been messed up. This bug
has not been triggered by build_examples.py due to it seems to call
the parse() function differently.
The output_name should be used as default title when present.
This will fix the #360 bug report.
Co-authored-by: kvid <kvid@users.noreply.github.com>
In Windows might OSError(errno=EINVAL) be raised instead of the already
catched exceptions in some cases (depending on the Python version).
Suggested fix posted by JarrettR in
https://github.com/wireviz/WireViz/issues/344#issuecomment-2113476151
Co-authored-by: kvid <kvid@users.noreply.github.com>
Co-authored-by: JarrettR <jrainier@gmail.com>
Running 6 different Python versions (3.7 to 3.12) in parallel now.
NOTE: This is in conflict with #309, but can be resolved easily in a later PR.
GitHub Actions require an update:
- actions/upload-artifact@v3 is scheduled for deprecation on November
30, 2024.
- Similarly, v1/v2 are scheduled for deprecation on June 30, 2024.
- Updating this comes with a breaking change in upload-artifact@v4:
Uploading to the same named Artifact multiple times.
Due to how Artifacts are created in this new version, it is no longer
possible to upload to the same named Artifact multiple times. You must
either split the uploads into multiple Artifacts with different names,
or only upload once. Otherwise you will encounter an error.
The artifact .zip files therefore have the python version added to
their name.
This happened to be a regression for WireViz-Web [1], which aims to do
as much in memory as possible.
[1] https://github.com/daq-tools/wireviz-web.
kvid rebased and mixed original commit with similar change by Daniel Rojas
Co-authored-by: Andreas Motl <andreas.motl@panodata.org>
Co-authored-by: kvid <kvid@users.noreply.github.com>