From 4269b83c52cf83239c0a7ae994f021b6df2e32c8 Mon Sep 17 00:00:00 2001 From: omsherikar Date: Fri, 30 Jan 2026 00:36:13 +0530 Subject: [PATCH] release: v1.0.14 refactor cli startup and update version --- CHANGELOG.md | 8 +++- README.md | 2 +- docs/v1.0.13_RELEASE_GUIDE.md | 0 pyproject.toml | 3 +- refactron/__init__.py | 2 +- refactron/cli.py | 79 +++++++++++++++++++---------------- 6 files changed, 55 insertions(+), 39 deletions(-) create mode 100644 docs/v1.0.13_RELEASE_GUIDE.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 12bf0e4..87b3eb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,13 @@ All notable changes to Refactron will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.0.13] - 2026-01-29 +## [1.0.14] - 2026-01-30 + +### Changed +- Refactored CLI startup sequence to display animation before authentication prompt. +- Improved dependency management (added `astroid`). + +## [1.0.13] - 2026-01-30 ### Added diff --git a/README.md b/README.md index 3d1e791..de14d00 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ result.show_diff() ## Development Status -Stable release (v1.0.13). Tested on Python 3.8-3.12. +Stable release (v1.0.14). Tested on Python 3.8-3.12. - 669 tests, 78% code coverage - Validated on 10,000+ lines of production code diff --git a/docs/v1.0.13_RELEASE_GUIDE.md b/docs/v1.0.13_RELEASE_GUIDE.md new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml index c93b606..f6acb77 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "refactron" -version = "1.0.13" +version = "1.0.14" description = "Python code analysis and refactoring tool with security scanning, performance detection, and automated fixes" readme = "README.md" requires-python = ">=3.8" @@ -34,6 +34,7 @@ dependencies = [ "rich>=13.0.0", "radon>=6.0.0", "requests>=2.25.0", + "astroid>=3.0.0", ] [project.optional-dependencies] diff --git a/refactron/__init__.py b/refactron/__init__.py index 06484d1..ff2a735 100644 --- a/refactron/__init__.py +++ b/refactron/__init__.py @@ -9,7 +9,7 @@ from refactron.core.refactor_result import RefactorResult from refactron.core.refactron import Refactron -__version__ = "1.0.13" +__version__ = "1.0.14" __author__ = "Om Sherikar" __all__ = [ diff --git a/refactron/cli.py b/refactron/cli.py index 74a0e47..cab08f6 100644 --- a/refactron/cli.py +++ b/refactron/cli.py @@ -90,7 +90,7 @@ def _auth_banner(title: str) -> None: style="panel.border", box=box.ROUNDED, padding=(1, 2), - subtitle="[secondary]v1.0.13[/secondary]", + subtitle="[secondary]v1.0.14[/secondary]", subtitle_align="right", ) ) @@ -736,45 +736,54 @@ def main(ctx: click.Context) -> None: # Check authentication for all commands except login/logout exempt_commands = ["login", "logout", "auth"] - if ctx.invoked_subcommand not in exempt_commands: - creds = load_credentials() - is_authenticated = False - if creds and creds.access_token: - now = datetime.now(timezone.utc) - if not creds.expires_at or creds.expires_at > now: - is_authenticated = True + # 1. Pre-check authentication status + creds = load_credentials() + is_authenticated = False + if creds and creds.access_token: + now = datetime.now(timezone.utc) + if not creds.expires_at or creds.expires_at > now: + is_authenticated = True + + # 2. Show animation if dashboard mode OR if auth is required and missing + should_show_animation = ctx.invoked_subcommand is None or ( + ctx.invoked_subcommand not in exempt_commands and not is_authenticated + ) - if not is_authenticated: - # If it's a subcommand, we might want a slightly different message - if ctx.invoked_subcommand: - console.print( - f"\n[yellow]Authentication required to run '{ctx.invoked_subcommand}'[/yellow]" + if should_show_animation: + _run_startup_animation() + + # 3. Handle authentication requirement + if ctx.invoked_subcommand not in exempt_commands and not is_authenticated: + # If it's a subcommand, we might want a slightly different message + if ctx.invoked_subcommand: + console.print( + f"\n[yellow]Authentication required to run '{ctx.invoked_subcommand}'[/yellow]" + ) + else: + console.print(Align.center(Text("\nAuthentication Required", style="bold"))) + + if Prompt.ask("\nLog in to continue?", choices=["y", "n"], default="y") == "y": + try: + ctx.invoke( + login, + api_base_url=DEFAULT_API_BASE_URL, + no_browser=False, + timeout=300, + force=False, ) - else: - console.print(Align.center(Text("\nAuthentication Required", style="bold"))) - - if Prompt.ask("\nLog in to continue?", choices=["y", "n"], default="y") == "y": - try: - ctx.invoke( - login, - api_base_url=DEFAULT_API_BASE_URL, - no_browser=False, - timeout=300, - force=False, - ) - # Re-check credentials - creds = load_credentials() - if creds and creds.access_token: - is_authenticated = True - except SystemExit: - pass + # Re-check credentials + creds = load_credentials() + if creds and creds.access_token: + is_authenticated = True + except SystemExit: + pass - if not is_authenticated: - console.print("[dim]Exiting...[/dim]") - raise SystemExit(1) + if not is_authenticated: + console.print("[dim]Exiting...[/dim]") + raise SystemExit(1) + # 4. Handle default command (interactive dashboard) if ctx.invoked_subcommand is None: - _run_startup_animation() _run_minimal_loop(ctx) pass