Refactor client and models for improved DX and reliability - #1
Conversation
- Implemented default timeout and timeout configuration in client. - Added usage examples to all public methods. - Explicitly defined public API using `__all__`. - Exported main classes and models in `__init__.py`. - Added tests for timeout logic and exports. - Relaxed Python version requirement to >=3.12. Co-authored-by: dcode <171574+dcode@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
The uv installer installed the binary to `~/.local/bin` instead of `~/.cargo/bin`. Updated the workflow to use the correct path. Co-authored-by: dcode <171574+dcode@users.noreply.github.com>
The `uv.lock` file was still set to require Python >=3.14, causing the CI to fail on Python 3.12 (and 3.13). Updated the lockfile to match `pyproject.toml` (>=3.12). Co-authored-by: dcode <171574+dcode@users.noreply.github.com>
dcode
left a comment
There was a problem hiding this comment.
See inline comments. Also please fix linting errors.
| Temperatures, | ||
| ) | ||
|
|
||
| __version__ = importlib.metadata.version("prusa-connect") |
There was a problem hiding this comment.
we should remove this in favor of __version__.py now that I've adapted the hatch version <foo> update and sync scheme.
There was a problem hiding this comment.
Agreed. I have updated __init__.py to import __version__ directly from .__version__ instead of using importlib.metadata.
| PrusaNetworkError, | ||
| ) | ||
| from prusa_connect.models import Camera, File, Job, Printer, Team | ||
| from .__version__ import __version__ |
There was a problem hiding this comment.
Use absolute imports for clarity
There was a problem hiding this comment.
Good catch. I've updated the import to use the absolute path prusa_connect.__version__ for better clarity.
- Updated `src/prusa_connect/__init__.py` to import `__version__` from `.__version__` instead of using `importlib.metadata`. - Updated `src/prusa_connect/client.py` to use absolute import for `__version__`. Co-authored-by: dcode <171574+dcode@users.noreply.github.com>
Refactor client and models for improved DX and reliability
__all__.__init__.py.PR created automatically by Jules for task 948830101214304348 started by @dcode