Skip to content
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

Update CONTRIBUTING.md #216

Merged
merged 2 commits into from
Jun 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 34 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
We recommend working on a feature branch and pull request from there.

## Create a feature branch
## Requirements

- `poetry`,
- `PyCharm` (recommended).

## Creating a feature branch

Make sure your environment contains all the updated versions of the dependencies.

Expand All @@ -20,13 +25,11 @@ $ git checkout develop
$ git fetch origin
$ git pull
$ git branch <feature branch name>

```

## Before creating the pull request

Make sure the tests and the following linters pass.

From a `poetry` shell (started from an OpenSquirrel checkout):

```
Expand All @@ -35,3 +38,31 @@ $ mypy . --strict
$ poetry run isort .
$ poetry run black .
```

## Setting the Python interpreter (PyCharm)

You can choose the Python interpreter from the `poetry` environment.

- Go to `Settings` > `Project: OpenSquirrel` > `Python Interpreter`.
- Click on `Add Interpeter`, and then select `Add Local Interpreter`.
- Select `Poetry Environment`, and then `Existing environment`.
- Click on `...` to navigate to the `Interpreter` binary.

## Running/Debugging tests (PyCharm)

To run/debug all tests:

- Right-click on the `test` folder of the Project tree.
- Click `Run 'pytest' in test` or `Debug 'pytest' in test`.

This will also create a `Run/Debug Configuration`.

### Troubleshooting

If breakpoints are not hit during debugging:

- Go to `Run/Debug Configurations`.
- Add `--no-cov` in the `Additional arguments` text box.

This issue may be due to the code coverage module _hijacking_ the tracing mechanism
(check [this link](https://stackoverflow.com/a/56235965/260313) for a more detailed explanation).
Loading