Skip to content

Conversation

@lcian
Copy link
Member

@lcian lcian commented Oct 29, 2025

Description

Sets up standard testing, linting and formatting for the Python client.

Checks can be ran locally using pre-commit as well as in CI.

Part of the setup has been adapted from https://github.com/getsentry/golden-path-example-python/tree/main.

Next steps

Add actual client implementation.

@lcian lcian marked this pull request as ready for review October 29, 2025 10:08
@lcian lcian requested a review from a team as a code owner October 29, 2025 10:08
pyproject.toml Outdated
url = "https://pypi.devinfra.sentry.io/simple"
default = true
[tool.uv]
required-version = "==0.9.3"
Copy link
Member Author

@lcian lcian Oct 29, 2025

Choose a reason for hiding this comment

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

We can use this so that action-setup-uv picks up the version from here, instead of repeating it multiple times in the CI yaml.
It still should be kept in sync with devenv/config.ini though.

Comment on lines 23 to 33
[tool.ruff.lint]
select = ["E", "F", "I", "UP"] # pycodestyle, pyflakes, isort, pyupgrade

[tool.mypy]
no_implicit_reexport = true
warn_unreachable = true
warn_unused_ignores = true
warn_redundant_casts = true
local_partial_types = true
disallow_any_generics = true
disallow_untyped_defs = true
Copy link
Member Author

@lcian lcian Oct 29, 2025

Choose a reason for hiding this comment

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

This configuration must be kept here in the root dir.
This is because, if we run e.g. uv run mypy from the root dir, it will not know that there's a config in subdir/pyproject.toml, it will only try to read it from the pyproject.toml in the root dir.

The alternative to this is to keep the config in the subdir, and have CI and pre-commit always cd into the subdir so that the tool picks up the correct config.

Comment on lines +17 to +19
"pytest>=8.3.3",
"mypy>=1.17.1",
"ruff>=0.14.2",
Copy link
Member Author

@lcian lcian Oct 29, 2025

Choose a reason for hiding this comment

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

These could be moved to the subdir with no problem as our uv sync would take care of installing them anyway.
The annoyance still stands with their configuration though (see comment below).
I just put them here as to me it makes sense to have tool + version + configuration in the same file.

@lcian lcian requested a review from jan-auer October 29, 2025 16:51
@lcian lcian merged commit a020ebb into main Oct 29, 2025
16 checks passed
@lcian lcian deleted the lcian/feat/python-client-devsetup branch October 29, 2025 17:08
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.

4 participants