Skip to content

Python SDK: Developer Experience and Development Environment Improvements #3750

Description

@mmmmxa

Description

The current documentation and testing configurations in Python SDK have a number of problems:

  • README file doesn't offer a reliable and easy to follow guide for development workflow. We are presented with a list of commands that get some of the jobs done, some of them with side effects. More on that in next items.
  • Using uv run without --no-sync is performing implicit syncing that overwrites the installation made by maturin develop, reverting the newest changes that were just introduced by installing the package via maturin develop.
  • Command to generate stubs is not documented.
  • Formatting commands required for the hooks to let your commits and pushes through specifically for Python code are not documented.
  • Docker compose and the Dockerfile seem to not have been updated in a while. Iggy server build is failing without seccomp:unconfined option, the overall compose command is failing due to problems with connectivity between containers, how this connectivity is established or checked (I'm still in the process of figuring all the root issues out here).
  • Dockerfile can be improved by adding caching and other changes.
  • Any other fixes for the development features that Python SDK is providing but which actually don't work out of the box.

In general, this set of changes is intended to make sure that a developer can follow the instructions which cover all necessary steps and all of which work as intended and serve a clear purpose.

Affected area / component

Python SDK

Proposed solution

  • Provide a development workflow in README, covering all steps of developing every feature and providing commands that are most reliable and easiest to use. Important action items as a part of this:
    • Add --no-sync to some uv run commands to get rid of undesired side effects.
    • Document the command to generate stubs
    • Provide ruff formatting commands that are required by hooks.
  • Update docker-related files to make sure docker-compose runs tests out of the box.
    • Improve test Dockerfile by switching to Rust-based image, installing uv and a specific python version. This will pin specific versions as arguments and will allow to perform checks for different python or rust versions if needed. Add caching for uv and --locked option for the uv sync so that specifically the container build could trigger a developer to intentionally update the lock file. (The latter is subject to change in the process of developing the workflow).
    • Fix issues with entrypoint script of the image and / or the configurations inside of the docker-compose file (there are interconnected and present as a group of issues).
    • Resolve the problem that test_tls.py introduces -- to be updated
  • Any other fixes for the development features that Python SDK is providing but which actually don't work out of the box and / or for the documentation.

I have already implemented almost all of these locally and the list may grow further as I discover the algorithm that gets a developer through the whole development process without issues.

Alternatives considered

No response

Contribution

  • I'm willing to submit a pull request to implement this feature

Good first issue

  • I think this could be a good first issue for a new contributor

Metadata

Metadata

Assignees

Labels

pythonPull requests that update Python code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions