|
2 | 2 |
|
3 | 3 | We're happy that you are interested in contributing to pyElli! |
4 | 4 |
|
5 | | -There are several ways of contributing to pyElli. |
6 | | -The easiest is reporting issues or starting discussions. |
7 | | -If you want to dive deeper feel free to open a pull request or contact us |
8 | | -if you need some help. |
9 | | -We're eager to help you if you want to contribute code to pyElli even if you feel |
10 | | -you don't bring a lot of knowledge (yet). We are happy to assist. |
| 5 | +You can contribute by reporting issues, starting discussions or open pull requests yourself |
| 6 | +to contribute code directly. |
| 7 | +In case you need help don't hesitate to ask for it. |
11 | 8 |
|
12 | 9 | ## Reporting an Issue |
13 | 10 |
|
14 | 11 | If you are encountering problems with pyElli or have a feature request |
15 | | -please open an issue at our [Github Issues Page](https://github.com/PyEllips/pyElli/issues). |
| 12 | +open an issue at pyElli's [Github Issues Page](https://github.com/PyEllips/pyElli/issues). |
16 | 13 |
|
17 | | -Please try to provide a minimal example for reproducing the issue. |
18 | | -This makes it a lot easier for the developers to work on the problem. |
| 14 | +Ideally, you'll provide a minimal example to reproduce the issue. |
| 15 | +This will make it a lot easier to work on the problem. |
19 | 16 |
|
20 | 17 | If you are not entirely sure whether the problem you're encountering is actually a bug |
21 | | -or if you want to discuss some feature ideas feel free to post on our [Github Discussion Page](https://github.com/orgs/PyEllips/discussions) |
| 18 | +or if you want to discuss some feature ideas feel free to post on pyElli's [Github Discussion Page](https://github.com/orgs/PyEllips/discussions) |
22 | 19 |
|
23 | 20 | ## Making a Pull Request |
24 | 21 |
|
| 22 | +In case you want to contribute your own code to pyElli you can open a pull request. |
| 23 | +To do this you need to fork pyElli first and create the pull request from your fork. |
| 24 | +[Github's excellent documentation on the topic](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) will be helpful if you need help to create a fork. |
| 25 | + |
| 26 | +### Setting up the repository and development environment |
| 27 | + |
| 28 | +First, clone the repo to start working on the code. |
| 29 | +Replace `https://github.com/PyEllips/pyElli` with the url of your fork. |
| 30 | + |
25 | 31 | ```sh |
26 | 32 | git clone --recurse-submodules https://github.com/PyEllips/pyElli |
27 | 33 | cd pyElli |
28 | 34 | ``` |
29 | 35 |
|
| 36 | +In the next step we install the package in development mode. |
| 37 | +We recommend using [uv](https://docs.astral.sh/uv/), which will manage a dedicated python |
| 38 | +virtual environment for the project. |
| 39 | +However, any virtual environment should work. |
| 40 | + |
| 41 | +=== "uv" |
| 42 | + |
| 43 | + ```sh |
| 44 | + uv sync --extra dev --extra docs --extra fitting |
| 45 | + ``` |
| 46 | + |
30 | 47 | === "pip" |
31 | 48 |
|
32 | 49 | ```sh |
33 | 50 | pip install -e '.[dev,docs,fitting] |
34 | 51 | ``` |
35 | 52 |
|
| 53 | +Now you're ready to make your changes to the code. |
| 54 | + |
| 55 | +### Testing |
| 56 | + |
| 57 | +Before opening a pull request please ensure that the tests pass and the code passes |
| 58 | +the linting checks and is formatted properly. |
| 59 | +We use the tool [ruff](https://docs.astral.sh/ruff/) to check linting and formatting |
| 60 | +and [pytest](https://docs.pytest.org/en/stable/) for testing. |
| 61 | + |
36 | 62 | === "uv" |
37 | 63 |
|
38 | 64 | ```sh |
39 | | - uv sync --extra dev --extra docs --extra fitting |
| 65 | + uv run pytest |
| 66 | + uv run ruff check . |
| 67 | + uv run ruff format . |
| 68 | + ``` |
| 69 | + |
| 70 | +=== "pip" |
| 71 | + |
| 72 | + ```sh |
| 73 | + pytest |
| 74 | + ruff check . |
| 75 | + ruff format . |
40 | 76 | ``` |
0 commit comments