-
-
Notifications
You must be signed in to change notification settings - Fork 4
feat(py-client): Set up testing, formatters, linters, CI #152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
pyproject.toml
Outdated
| url = "https://pypi.devinfra.sentry.io/simple" | ||
| default = true | ||
| [tool.uv] | ||
| required-version = "==0.9.3" |
There was a problem hiding this comment.
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.
| [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 |
There was a problem hiding this comment.
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.
| "pytest>=8.3.3", | ||
| "mypy>=1.17.1", | ||
| "ruff>=0.14.2", |
There was a problem hiding this comment.
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.
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.