Skip to content

Refactor client and models for improved DX and reliability - #1

Merged
dcode merged 4 commits into
mainfrom
refactor-client-dx-improvements-948830101214304348
Feb 1, 2026
Merged

Refactor client and models for improved DX and reliability#1
dcode merged 4 commits into
mainfrom
refactor-client-dx-improvements-948830101214304348

Conversation

@dcode

@dcode dcode commented Feb 1, 2026

Copy link
Copy Markdown
Owner

Refactor client and models for improved DX and reliability

  • 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.

PR created automatically by Jules for task 948830101214304348 started by @dcode

- 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>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules Bot and others added 2 commits February 1, 2026 07:06
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 dcode left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comments. Also please fix linting errors.

Comment thread src/prusa_connect/__init__.py Outdated
Temperatures,
)

__version__ = importlib.metadata.version("prusa-connect")

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should remove this in favor of __version__.py now that I've adapted the hatch version <foo> update and sync scheme.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I have updated __init__.py to import __version__ directly from .__version__ instead of using importlib.metadata.

Comment thread src/prusa_connect/client.py Outdated
PrusaNetworkError,
)
from prusa_connect.models import Camera, File, Job, Printer, Team
from .__version__ import __version__

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use absolute imports for clarity

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@dcode
dcode merged commit 5ef6ff7 into main Feb 1, 2026
0 of 2 checks passed
@dcode
dcode deleted the refactor-client-dx-improvements-948830101214304348 branch February 12, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant