Skip to content

Commit

Permalink
Release v0.3.0
Browse files Browse the repository at this point in the history
- Wider Python version support:
  - Lowered minimum Python version requirement to 3.8.
  - Uses `sys.setprofile` for Python 3.8~3.11 and `sys.monitoring` for 3.12+.
- Enhanced tracing logic to handle top-level external calls after imports:
  - Now checks caller frames to start tracing even if the first external function call occurs right after imports.
- Verbose mode improvements:
  - `-v` now traces standard library functions in addition to built-ins, providing more detailed insights.
- Added new examples:
  - `requests_example.py` and `torch_example.py` demonstrate tracing external libraries.
- Various code refinements and bug fixes:
  - Consolidated tracing logic and removed redundant code.
  - Improved path normalization and encoding handling for cross-platform consistency.
  • Loading branch information
kangtegong committed Dec 19, 2024
1 parent 434337c commit a06bbbf
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog

## [0.3.0] - 2024-12-19

### Added
- New Examples:
- `examples/requests_example.py`: Demonstrates tracing HTTP requests made via `requests.get()`.
- `examples/torch_example.py`: Demonstrates tracing with the `torch` library.
- Enhanced Tracing Logic:
- Introduced logic to detect if an external function call is triggered by user script code beyond the import phase.
- Verbose mode (`-v`) now also traces standard library functions, not just built-ins.

### Changed
- ★ Support Python Version 3.8+ (Wider Python Version Support):
- Lowered the minimum required Python version from 3.12 to 3.8. On Python 3.8~3.11, `sys.setprofile` is used; on 3.12 and above, `sys.monitoring` is used.
- CI Configuration:
- Simplified GitHub Actions CI matrix to use only `ubuntu-latest` for testing, removing Windows and macOS from the test matrix.
- Codebase Refinements:
- Consolidated and refactored the tracing logic to be more maintainable.
- Merged `PyftraceBase` into `tracer.py` and refactored engines (`pyftrace_monitoring.py`, `pyftrace_setprofile.py`) to import from it directly.

### Fixed
- Top-level External Calls:
- Fixed an issue where top-level external library calls would not appear in the trace because tracing started only after a call in the user script.
- Now caller frames are checked: if the calling frame belongs to the user script after imports, tracing starts immediately.
- Normalization of Paths and Encodings:
- Ensured consistent path normalization and line ending handling.

---

## [0.2.0] - 2024-11-11

### Added
Expand Down
2 changes: 1 addition & 1 deletion pyftrace/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.2.0"
__version__ = "0.3.0"

from .tracer import get_tracer

Expand Down

0 comments on commit a06bbbf

Please sign in to comment.