Skip to content

Commit de3e34a

Browse files
committed
Update CONTRIBUTING.md
1 parent 61c10ea commit de3e34a

1 file changed

Lines changed: 34 additions & 10 deletions

File tree

CONTRIBUTING.md

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,38 +74,62 @@ On macOS, we recommend using `brew` to install Python. For Windows, we recommend
7474

7575
Before you can contribute, you will need to [fork the `sentry-python` repository](https://github.com/getsentry/sentry-python/fork). Then, clone the forked repository to your local development environment.
7676

77-
### Create a Virtual Environment
77+
78+
### Development Tooling
7879

7980
We use [uv](https://docs.astral.sh/uv/) to manage the project's virtual environment and dev dependencies. Install uv following the [official instructions](https://docs.astral.sh/uv/getting-started/installation/), then run:
8081

8182
```bash
8283
cd sentry-python
83-
8484
uv sync
8585
```
8686

87-
This creates a `uv` managed `.venv` (using the Python version pinned in `.python-version`) and installs the project's dev dependencies (tox, tox-uv, etc.) into it. It is recommended not to deal with this `.venv` manually but only through `uv`.
88-
8987
Invoke commands via `uv run <cmd>` (e.g. `uv run tox -e py3.14-common`).
9088

91-
### Install `sentry-python` in Editable Mode
89+
#### Linting / Formatting
9290

93-
Install `sentry-python` in [editable mode](https://pip.pypa.io/en/latest/topics/local-project-installs/#editable-installs). This will make any changes you make to the SDK code locally immediately effective without you having to reinstall or copy anything.
91+
We use `ruff` to lint and format our code. Use the following commands:
9492

95-
```bash
96-
pip install -e .
93+
```
94+
uv run ruff check --fix tests sentry_sdk
95+
uv run ruff format tests sentry_sdk
9796
```
9897

99-
**Hint:** Sometimes you need a sample project to run your new changes to `sentry-python`. In this case install the sample project in the same virtualenv and you should be good to go.
98+
#### Typing
99+
100+
We use `mypy` for typing our codebase. Use the following command to typecheck the source:
100101

101-
### Install Coding Style Pre-commit Hooks
102+
```
103+
uv run --group typing mypy sentry_sdk
104+
```
105+
106+
##### Install Coding Style Pre-commit Hooks
102107

103108
`pre-commit` is included in the project's dev dependencies (installed by `uv sync`). Register the git hooks with:
104109

105110
```bash
106111
uv run pre-commit install
107112
```
108113

114+
Now, pre-commit will automatically lint your changes with `ruff`.
115+
116+
117+
### Install `sentry-python` in Editable Mode
118+
119+
Install `sentry-python` in [editable mode](https://pip.pypa.io/en/latest/topics/local-project-installs/#editable-installs). This will make any changes you make to the SDK code locally immediately effective without you having to reinstall or copy anything.
120+
121+
```bash
122+
pip install -e .
123+
```
124+
125+
or
126+
127+
```bash
128+
uv add --editable .
129+
```
130+
131+
**Hint:** Sometimes you need a sample project to run your new changes to `sentry-python`. In this case install the sample project in the same virtualenv and you should be good to go.
132+
109133
That's it. You should be ready to make changes, run tests, and make commits! If you experience any problems, please don't hesitate to ping us in our [Discord Community](https://discord.com/invite/Ww9hbqr).
110134

111135
## Running Tests

0 commit comments

Comments
 (0)