Skip to content

0.8.40b1

Choose a tag to compare

@fern-api fern-api released this 16 May 17:27
· 8 commits to master since this release
60fee63
Fix/consistent path normalization (#73)

* 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