From 20798ee699c3150c18d19c533d86f27d7386d278 Mon Sep 17 00:00:00 2001 From: Mantas Date: Fri, 8 May 2020 16:32:13 +0300 Subject: [PATCH 1/3] Check if list of file globs matches at least one file When given glob does not match any files, pyan3 exits without telling anything and generated an empty graph. That might be confusing, when an incorrect file path is given. To avoid confusion, added additional check if glob matches at least one file. Now it works like this: > pyan3 --dot -f /tmp/graph.dot does/not/exist.py Usage: pyan3 FILENAME... [--dot|--tgf|--yed] pyan3: error: No files found matching given glob: does/not/exist.py --- pyan/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyan/main.py b/pyan/main.py index e78e17c..7c7e275 100644 --- a/pyan/main.py +++ b/pyan/main.py @@ -80,6 +80,8 @@ def main(): filenames = [fn2 for fn in args for fn2 in glob(fn)] if len(args) == 0: parser.error('Need one or more filenames to process') + if len(args) > 0 and len(filenames) == 0: + parser.error('No files found matching given glob: %s' % ' '.join(args)) if options.nested_groups: options.grouped = True From 550e4e6864fa726ed770dd6a47482607465888f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Eduardo=20Montenegro=20Cavalcanti=20de=20Olive?= =?UTF-8?q?ira?= Date: Mon, 18 May 2020 15:08:13 -0300 Subject: [PATCH 2/3] Renames pyan.py for pyan3 --- visualize_pyan_architecture.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/visualize_pyan_architecture.sh b/visualize_pyan_architecture.sh index f7471c4..6fa76db 100755 --- a/visualize_pyan_architecture.sh +++ b/visualize_pyan_architecture.sh @@ -1,4 +1,4 @@ #!/bin/bash echo -ne "Pyan architecture: generating architecture.{dot,svg}\n" -./pyan.py pyan/*.py --no-defines --uses --colored --annotate --dot -V >architecture.dot 2>architecture.log +./pyan3 pyan/*.py --no-defines --uses --colored --annotate --dot -V >architecture.dot 2>architecture.log dot -Tsvg architecture.dot >architecture.svg From e32f400871c26f1670d55c2881917b5a6b8b2045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Eduardo=20Montenegro=20Cavalcanti=20de=20Olive?= =?UTF-8?q?ira?= Date: Mon, 18 May 2020 15:14:00 -0300 Subject: [PATCH 3/3] Adds wheel to the setup requirement --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7368d51..34f8123 100644 --- a/setup.py +++ b/setup.py @@ -136,7 +136,7 @@ setup( # See # http://setuptools.readthedocs.io/en/latest/setuptools.html # - setup_requires=[], + setup_requires=["wheel"], install_requires=[], provides=["pyan"],