Skip to content

Commit c254ea0

Browse files
authored
Add a warning on invalid authorization (#58)
* Add a warning on invalid authorization * Integrate auth warning into auth.require_auth * Bump version to 0.1.8
1 parent 228836a commit c254ea0

7 files changed

Lines changed: 26 additions & 14 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.12.2
3+
rev: v0.12.3
44
hooks:
55
- id: ruff
66
types_or: [ python, pyi ]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "rml"
3-
version = "0.1.7"
3+
version = "0.1.8"
44
description = "CLI for Recurse ML"
55
readme = "README.md"
66
authors = [

src/rml/__init__.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,10 @@ def make_tar(
227227
),
228228
)
229229
def post_check(
230-
archive_filename: str, archive_path: Path, target_filenames: list[str], **kwargs
230+
archive_filename: str,
231+
archive_path: Path,
232+
target_filenames: list[str],
233+
**kwargs,
231234
) -> dict[str, Any]:
232235
api_key = get_env_value(RECURSE_API_KEY_NAME)
233236

@@ -311,15 +314,14 @@ def analyze(
311314
console.print(Text("✨ No changes found in the specified files! ✨"))
312315
return
313316

314-
if len(changed_target_filenames) != len(target_paths):
315-
target_file_paths = filter(lambda path: path.is_file(), target_paths)
316-
skipped_target_paths = list(
317-
filter(
318-
lambda path: str(path) not in changed_target_filenames,
319-
target_file_paths,
320-
)
317+
target_file_paths = filter(lambda path: path.is_file(), target_paths)
318+
skipped_target_paths = list(
319+
filter(
320+
lambda path: str(path) not in changed_target_filenames,
321+
target_file_paths,
321322
)
322-
323+
)
324+
if len(skipped_target_paths) > 0:
323325
if markdown:
324326
print(
325327
f"Skipping {len(skipped_target_paths)} unchanged files: {', '.join(str(p) for p in skipped_target_paths)}"

src/rml/auth.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import asyncio
2-
import sys
32
from functools import wraps
43
from typing import Optional
54

@@ -196,8 +195,10 @@ def wrapper(*args, **kwargs):
196195
if not (SKIP_AUTH or is_authenticated()):
197196
auth_result = asyncio.run(authenticate_with_github(console=console))
198197
render_auth_result(auth_result, console=console)
198+
""" TODO (Armin): Uncomment this on 21/07/2025
199199
if auth_result.status != AuthStatus.SUCCESS:
200200
sys.exit(1)
201+
"""
201202

202203
return f(*args, **kwargs)
203204

src/rml/package_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
ENV_FILE_PATH = PROJECT_ROOT / ".env.rml"
1717
RECURSE_API_KEY_NAME = "RECURSE_API_KEY"
1818

19-
SKIP_AUTH = True
19+
SKIP_AUTH = False

src/rml/ui.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,18 @@ def render_auth_result(result: AuthResult, console: Console) -> None:
350350
if result.status == AuthStatus.SUCCESS:
351351
console.print("[bold green]✅ Authentication successful![/bold green]")
352352
elif result.status == AuthStatus.PLAN_REQUIRED:
353+
console.print("[bold] ⚠️ You need to purchase a plan on the marketplace[/bold]")
354+
console.print(" 📦 https://github.com/marketplace/recurse-ml")
355+
console.print(
356+
"[dim]Free CLI access will terminate on 21/07/2025.[/dim]"
357+
"[dim]Our GH App will remain free for open source projects.[/dim]"
358+
)
359+
console.print()
360+
""" TODO (Armin): Uncomment this on 21/07/2025
353361
console.print(
354362
"[bold yellow]⚠️ To use rml, please purchase a plan at https://github.com/marketplace/recurse-ml and run `rml auth login` again.[/bold yellow]"
355363
)
364+
"""
356365
else:
357366
console.print(
358367
f"[bold red]❌ Authentication failed {'(' + result.message + ')' if result.message else ''}[/bold red]"

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)