Skip to content

Commit 53bdacc

Browse files
committed
Move tests to internal directory; remove metadata handler; remove progress spinner
1 parent 5be41cb commit 53bdacc

File tree

19 files changed

+25
-355
lines changed

19 files changed

+25
-355
lines changed

.fernignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ src/humanloop/cli
1818

1919
## Tests
2020

21-
tests
21+
tests/internal
2222

2323
## CI
2424

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ authors = []
88
# The metadata here is used during development but not published to PyPI
99
[tool.poetry]
1010
name = "humanloop"
11-
version = "0.8.36b1"
11+
version = "0.8.36b2"
1212
description = "Humanloop Python SDK"
1313
readme = "README.md"
1414
authors = []

src/humanloop/cli/__main__.py

Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from humanloop import Humanloop
1010
from humanloop.sync.sync_client import SyncClient
1111
from datetime import datetime
12-
from humanloop.cli.progress import progress_context
1312

1413
# Set up logging
1514
logger = logging.getLogger(__name__)
@@ -166,12 +165,7 @@ def pull(
166165
click.echo(click.style(f"Path: {path or '(root)'}", fg=INFO_COLOR))
167166
click.echo(click.style(f"Environment: {environment or '(default)'}", fg=INFO_COLOR))
168167

169-
if verbose:
170-
# Don't use the spinner in verbose mode as the spinner and sync client logging compete
171-
successful_files = sync_client.pull(path, environment)
172-
else:
173-
with progress_context("Pulling files..."):
174-
successful_files = sync_client.pull(path, environment)
168+
successful_files = sync_client.pull(path, environment)
175169

176170
# Get metadata about the operation
177171
metadata = sync_client.metadata.get_last_operation()
@@ -201,56 +195,7 @@ def pull(
201195
click.echo(click.style(f" ✗ {file}", fg=ERROR_COLOR))
202196
if metadata.get('error'):
203197
click.echo(click.style(f"\nError: {metadata['error']}", fg=ERROR_COLOR))
204-
205-
def format_timestamp(timestamp: str) -> str:
206-
"""Format timestamp to a more readable format."""
207-
try:
208-
dt = datetime.fromisoformat(timestamp.replace('Z', '+00:00'))
209-
return dt.strftime('%Y-%m-%d %H:%M:%S')
210-
except (ValueError, AttributeError):
211-
return timestamp
212-
213-
@cli.command()
214-
@click.option(
215-
"--oneline",
216-
is_flag=True,
217-
help="Display history in a single line per operation",
218-
)
219-
@handle_sync_errors
220-
@common_options
221-
def history(api_key: Optional[str], env_file: Optional[str], base_dir: str, base_url: Optional[str], oneline: bool):
222-
"""Show sync operation history."""
223-
client = get_client(api_key, env_file, base_url)
224-
sync_client = SyncClient(client, base_dir=base_dir)
225-
226-
history = sync_client.metadata.get_history()
227-
if not history:
228-
click.echo(click.style("No sync operations found in history.", fg=WARNING_COLOR))
229-
return
230-
231-
if not oneline:
232-
click.echo(click.style("Sync Operation History:", fg=INFO_COLOR))
233-
click.echo(click.style("======================", fg=INFO_COLOR))
234-
235-
for op in history:
236-
if oneline:
237-
# Format: timestamp | operation_type | path | environment | duration_ms | status
238-
status = click.style("✓", fg=SUCCESS_COLOR) if not op['failed_files'] else click.style("✗", fg=ERROR_COLOR)
239-
click.echo(f"{format_timestamp(op['timestamp'])} | {op['operation_type']} | {op['path'] or '(root)'} | {op['environment'] or '-'} | {op['duration_ms']}ms | {status}")
240-
else:
241-
click.echo(click.style(f"\nOperation: {op['operation_type']}", fg=INFO_COLOR))
242-
click.echo(f"Timestamp: {format_timestamp(op['timestamp'])}")
243-
click.echo(f"Path: {op['path'] or '(root)'}")
244-
if op['environment']:
245-
click.echo(f"Environment: {op['environment']}")
246-
click.echo(f"Duration: {op['duration_ms']}ms")
247-
if op['successful_files']:
248-
click.echo(click.style(f"Successfully {op['operation_type']}ed {len(op['successful_files'])} file{'' if len(op['successful_files']) == 1 else 's'}", fg=SUCCESS_COLOR))
249-
if op['failed_files']:
250-
click.echo(click.style(f"Failed to {op['operation_type']}ed {len(op['failed_files'])} file{'' if len(op['failed_files']) == 1 else 's'}", fg=ERROR_COLOR))
251-
if op['error']:
252-
click.echo(click.style(f"Error: {op['error']}", fg=ERROR_COLOR))
253-
click.echo(click.style("----------------------", fg=INFO_COLOR))
198+
254199

255200
if __name__ == "__main__":
256201
cli()

src/humanloop/cli/progress.py

Lines changed: 0 additions & 120 deletions
This file was deleted.

src/humanloop/sync/metadata_handler.py

Lines changed: 0 additions & 125 deletions
This file was deleted.

0 commit comments

Comments
 (0)