The application name and URL was defined several places in the code,
and the name was not written exactly the same everywhere.
By using the same constants everywhere, consistency is obtained.
Add -V command line option (and --version as an alias) to
both wireviz.py and build_examples.py that show version number.
Move the version number from setup.py into __init__.py to access
the same version number specification from all files needing it.
This solves part 4 of issue #167.
When used to "git diff", it is easy to write "build_examples.py diff"
instead of "build_examples.py compare" by a mistake. Therefore,
"diff" is now an alias to "compare" so both commands will work.
This solves part 3 of issue #167.
Adding an optional -b BRANCH argument to build_examples.py to enable
comparing to and restoring from any branch or commit. That will help
when e.g. reversing an unfortunate commit of generated files.
This solves part 2 of issue #167.
- Add double quotes around path string in `os.system()` call and
status output to handle any spaces in the path.
- Split the `generated_extensions` list into the two lists
`extensions_not_containing_graphviz_output` and
`extensions_containing_graphviz_output` for readability.
By putting all value entries on separate lines with a trailing comma,
it becomes easier to read the diff when later inserting or deleting
the first or last value entry in any dict.
This make it possible to append '-g' or '--groups' followed by
space separated group names to any CLI action command, and the
set of generated files affected by the command will be limited
to the selected groups ('examples', 'tutorial', and 'demos').
Default is all groups. A simple help text is added for each of
the arguments (action and groups) to improve the autogenerated
CLI help output.
This is a squash rebase of these commits:
- p ec29076 Make all actions honor the optional argument -generate
- s e3ad11a Move open_file_append() outside the if to avoid re-open
- s ba4b900 Avoid including readme in all file groups
- s 1ca8bd1 Simplify code
- s a9e7337 Rename some variables to better reflect their contents and relations
- s 58a54b2 Move test to include readme inside collect_filenames() function
- s f2a0db0 Improve status output by adding group name
- s d3b299b Rename -generate option to -g/--groups and add argument help
Add new actions:
- 'compare' action to compare generated files (except those
generated by Graphviz) against the latest commit, and
- 'restore' action to restore generated files from the latest commit.
This is a squash rebase of these commits:
- p 9ad3e13 Reduce code duplication by moving common code into a generic function
- s d4feae6 Add action to restore generated files from git repository
- s 64f6507 Add action to compare generated files against git repository
- s 099c202 Simplify code
- Use `pathlib.Path` instead of `os.path`
- Fix order of files while building
- Consolidate code for building demos, examples and tutorial
- Change argument from `tutorials` to `tutorial` to remain consistent
- Add some indentation in console output for better readability
build_examples supports cleaning examples and intelligently will detect new examples.
SUGGESTION: When merging into dev, require
```
build_examples.py clean
```
and then only build when merging into master branch
There are hard copies of the graphviz and pyyaml dependencies included
in the repo. Remove these.
Sort out installation and dependency handling by writing a functional
setup.py script. Rename top level documentation. Refactor wireviz.py
slightly to allow it to run as an installed script.
# Conflicts:
# src/batch.py
# src/wireviz/batch.py
# src/wireviz/build_examples.py