From 2a01fa7074d05702392a6b1eb20aa231cca7ad10 Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 31 Jan 2024 10:53:26 +0100 Subject: [PATCH 1/4] print relative path not absolute path in logo cmd --- nf_core/__main__.py | 2 +- nf_core/create_logo.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nf_core/__main__.py b/nf_core/__main__.py index 7970c34081..23ad27e3a0 100644 --- a/nf_core/__main__.py +++ b/nf_core/__main__.py @@ -2068,7 +2068,7 @@ def logo(logo_text, dir, name, theme, width, format, force): if dir == ".": dir = Path.cwd() logo_path = create_logo(logo_text, dir, name, theme, width, format, force) - log.info(f"Created logo: [magenta]{logo_path}[/]") + log.info(f"Created logo: [magenta]{logo_path.relative_to(Path.cwd())}[/]") except UserWarning as e: log.error(e) sys.exit(1) diff --git a/nf_core/create_logo.py b/nf_core/create_logo.py index 4dfebd3712..e06755c81f 100644 --- a/nf_core/create_logo.py +++ b/nf_core/create_logo.py @@ -104,7 +104,7 @@ def create_logo( # Save img.save(logo_path, "PNG") - log.debug(f"Saved logo to: {logo_path}") + log.debug(f"Saved logo to: '{logo_path.relative_to(Path.cwd())}'") # Return the logo return logo_path From 16af00517260c797d7437ccdb7108755b0cf1a8f Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 31 Jan 2024 10:54:12 +0100 Subject: [PATCH 2/4] remove rich debugs logs from verbose mode --- nf_core/__main__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nf_core/__main__.py b/nf_core/__main__.py index 23ad27e3a0..3d85e79b46 100644 --- a/nf_core/__main__.py +++ b/nf_core/__main__.py @@ -174,6 +174,10 @@ def nf_core_cli(ctx, verbose, hide_progress, log_file): ) ) + # don't show rich debug logging in verbose mode + rich_logger = logging.getLogger("rich") + rich_logger.setLevel(logging.INFO) + # Set up logs to a file if we asked for one if log_file: log_fh = logging.FileHandler(log_file, encoding="utf-8") From a31c04fdcafc0d4226dcf6b6d1c0e5d9fca1250f Mon Sep 17 00:00:00 2001 From: mashehu Date: Wed, 31 Jan 2024 10:58:25 +0100 Subject: [PATCH 3/4] handle relative paths more gracefully --- nf_core/__main__.py | 7 ++++++- nf_core/create_logo.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/nf_core/__main__.py b/nf_core/__main__.py index 3d85e79b46..a39c3cf732 100644 --- a/nf_core/__main__.py +++ b/nf_core/__main__.py @@ -2072,7 +2072,12 @@ def logo(logo_text, dir, name, theme, width, format, force): if dir == ".": dir = Path.cwd() logo_path = create_logo(logo_text, dir, name, theme, width, format, force) - log.info(f"Created logo: [magenta]{logo_path.relative_to(Path.cwd())}[/]") + # Print path to logo relative to current working directory + try: + logo_path = Path(logo_path).relative_to(Path.cwd()) + except ValueError: + logo_path = Path(logo_path) + log.info(f"Created logo: [magenta]{logo_path}[/]") except UserWarning as e: log.error(e) sys.exit(1) diff --git a/nf_core/create_logo.py b/nf_core/create_logo.py index e06755c81f..1e96b7032c 100644 --- a/nf_core/create_logo.py +++ b/nf_core/create_logo.py @@ -104,7 +104,7 @@ def create_logo( # Save img.save(logo_path, "PNG") - log.debug(f"Saved logo to: '{logo_path.relative_to(Path.cwd())}'") + log.debug(f"Saved logo to: '{logo_path}'") # Return the logo return logo_path From c2eb9ac70dee6bff02bb1437ce49d0a68c66561f Mon Sep 17 00:00:00 2001 From: nf-core-bot Date: Wed, 31 Jan 2024 10:00:10 +0000 Subject: [PATCH 4/4] [automated] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfa98d16e5..5014bc9e16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - Update pre-commit hook astral-sh/ruff-pre-commit to v0.1.15 ([#2705](https://github.com/nf-core/tools/pull/2705)) - fix changelog titles ([#2708](https://github.com/nf-core/tools/pull/2708)) +- Print relative path not absolute path in logo cmd log output ([#2709](https://github.com/nf-core/tools/pull/2709)) ## [v2.12 - Aluminium Wolf](https://github.com/nf-core/tools/releases/tag/2.11) - [2024-01-29]