You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix: improve path handling in sync client pull operation
* Improve and make path handling more consistent in call and log overloads
* refactor(tests): update normalize_path test to cover strip_extension parameter
* fix: improve path validation for SDK calls
- Enhance safety in path extension handling
- Fix path validation tests to work with actual error messages
- Prioritize extension validation over other path format issues
- Ensure consistent error handling across prompt and agent clients
* feat: add path utils for centralized path validation
* Further refined path handling and added more tests
* refactor: use pytest tmp_path fixture to isolate test file operations
This change:
- Replaces hardcoded directories with pytest's tmp_path fixture
- Eliminates filesystem pollution between tests
- Enables safe test parallelization
- Improves path validation and error messages
- Removes redundant cleanup code
- Makes tests follow pytest best practices
* test: fix type errors in local file operations test by using proper ChatMessageParams type
* docs(cli): clarify SyncClient log level control and OpenTelemetry isolation
* refactor: simplified path processing to use pathlib where possible
* docs: improve comment clarity
* test: improve path normalization tests with parametrize and edge cases
* docs: clarify pull_file docstring with failure example
* docs: expand normalize_path docstring with usage and examples
- Add detailed explanation of function's purpose and usage contexts\n- Document rationale for stripping leading/trailing slashes\n- Add comprehensive examples for different path formats\n- Reference SyncClient.pull usage for context
* refactor: SyncClient -> FileSyncer
* fix(sync): Convert base_dir to string in FileSyncer fixture
* fix(dosc): correct logger namespace reference
* docs: Improve error messages and comments in FileSyncer
* refactor(test): use pytest.mark.parametrize for path validation tests
Consolidate the three similar test loops (extension paths, slash paths, and combined paths)
into a single parametrized test. This reduces code duplication while making test cases
more maintainable and test output more descriptive.
- Replace repetitive test loops with @pytest.mark.parametrize
- Use descriptive test IDs for better test output
- Group test cases by type with clear comments
- Make parameter names more explicit (path_generator, test_case_description)
* fix(test): use proper typing.Callable for path generator
Copy file name to clipboardExpand all lines: src/humanloop/cli/__main__.py
+9-3Lines changed: 9 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@
9
9
fromdotenvimportload_dotenv
10
10
11
11
fromhumanloopimportHumanloop
12
-
fromhumanloop.sync.sync_clientimportSyncClient
12
+
fromhumanloop.sync.file_syncerimportFileSyncer
13
13
14
14
# Set up logging
15
15
logger=logging.getLogger(__name__)
@@ -154,6 +154,7 @@ def cli(): # Does nothing because used as a group for other subcommands (pull,
154
154
"-p",
155
155
help="Path in the Humanloop workspace to pull from (file or directory). You can pull an entire directory (e.g. 'my/directory') "
156
156
"or a specific file (e.g. 'my/directory/my_prompt.prompt'). When pulling a directory, all files within that directory and its subdirectories will be included. "
157
+
"Paths should not contain leading or trailing slashes. "
157
158
"If not specified, pulls from the root of the remote workspace.",
158
159
default=None,
159
160
)
@@ -218,7 +219,12 @@ def pull(
218
219
219
220
Currently only supports syncing Prompt and Agent files. Other file types will be skipped."""
220
221
client=get_client(api_key, env_file, base_url)
221
-
sync_client=SyncClient(
222
+
# Although pull() is available on the Humanloop client, we instantiate FileSyncer separately to control its log level.
223
+
# This allows CLI users to toggle between detailed logging (--verbose) and minimal output without affecting the
224
+
# main Humanloop client logger. The FileSyncer uses its own logger namespace (humanloop.sdk.file_syncer), making this
225
+
# modification isolated from the client's OpenTelemetry setup. This client instance is short-lived and only
226
+
# exists for the duration of the CLI command execution.
0 commit comments