Skip to content

Commit c056a1b

Browse files
add Development section to README and update contribution guide
1 parent b1c1af1 commit c056a1b

File tree

3 files changed

+88
-30
lines changed

3 files changed

+88
-30
lines changed

CONTRIBUTING.md

Lines changed: 77 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,106 @@
22

33
All contributions are welcome! Besides code contributions, this includes things like documentation improvements, bug reports, and feature requests.
44

5-
You should first check if there is a [GitHub issue](https://github.com/joshuadavidthomas/django-bird/issues) already open or related to what you would like to contribute. If there is, please comment on that issue to let others know you are working on it. If there is not, please open a new issue to discuss your contribution.
5+
You should first check if there is a [GitHub issue](https://github.com/joshuadavidthomas/django-github-app/issues) already open or related to what you would like to contribute. If there is, please comment on that issue to let others know you are working on it. If there is not, please open a new issue to discuss your contribution.
66

77
Not all contributions need to start with an issue, such as typo fixes in documentation or version bumps to Python or Django that require no internal code changes, but generally, it is a good idea to open an issue first.
88

99
We adhere to Django's Code of Conduct in all interactions and expect all contributors to do the same. Please read the [Code of Conduct](https://www.djangoproject.com/conduct/) before contributing.
1010

11-
## Setup
11+
### Requirements
12+
13+
- [uv](https://github.com/astral-sh/uv) - Modern Python toolchain that handles:
14+
- Python version management and installation
15+
- Virtual environment creation and management
16+
- Fast, reliable dependency resolution and installation
17+
- Reproducible builds via lockfile
18+
- [direnv](https://github.com/direnv/direnv) (Optional) - Automatic environment variable loading
19+
- [just](https://github.com/casey/just) (Optional) - Command runner for development tasks
20+
21+
### `Justfile`
22+
23+
The repository includes a `Justfile` that provides all common development tasks with a consistent interface. Running `just` without arguments shows all available commands and their descriptions:
24+
25+
```bash
26+
$ just
27+
# or explicitly
28+
$ just --list --list-submodules
29+
<!-- [[[cog
30+
import subprocess
31+
import cog
32+
33+
output_raw = subprocess.run(['just', '--list', '--list-submodules'], stdout=subprocess.PIPE)
34+
output_list = output_raw.stdout.decode('utf-8').split('\n')
35+
36+
for i, line in enumerate(output_list):
37+
if not line:
38+
continue
39+
cog.out(line)
40+
if i < len(output_list):
41+
cog.out('\n')
42+
]]] -->
43+
Available recipes:
44+
bootstrap
45+
coverage *ARGS
46+
lint
47+
lock *ARGS
48+
manage *COMMAND
49+
test *ARGS
50+
testall *ARGS
51+
types *ARGS
52+
docs:
53+
build LOCATION="docs/_build/html" # Build documentation using Sphinx
54+
serve PORT="8000" # Serve documentation locally
55+
<!-- [[[end]]] -->
56+
```
1257
13-
The following setup steps assume you are using a Unix-like operating system, such as Linux or macOS, and that you have a [supported](https://django-bird.readthedocs.io/#requirements) version of Python installed. If you are using Windows, you will need to adjust the commands accordingly. If you do not have Python installed, you can visit [python.org](https://www.python.org/) for instructions on how to install it for your operating system.
58+
All commands below will contain the full command as well as its `just` counterpart.
1459
15-
1. Fork the repository and clone it locally.
16-
2. Create a virtual environment and activate it. You can use whatever tool you prefer for this. Below is an example using the Python standard library's `venv` module:
60+
## Setup
1761
18-
```shell
19-
python -m venv venv
20-
source venv/bin/activate
21-
```
62+
The following instructions will use `uv` and assume a Unix-like operating system (Linux or macOS).
2263
23-
3. Install `django-bird` and the `dev` dependencies in editable mode:
64+
Windows users will need to adjust commands accordingly, though the core workflow remains the same.
65+
Alternatively, any Python package manager that supports installing from `pyproject.toml` ([PEP 621](https://peps.python.org/pep-0621/)) can be used. If not using `uv`, ensure you have Python installed from [python.org](https://www.python.org/).
2466
25-
```shell
26-
python -m pip install --editable '.[dev]'
27-
# or using [just](#just)
67+
1. Fork the repository and clone it locally.
68+
2. Use `uv` too bootstrap your development environment:
69+
70+
```bash
71+
uv python install
72+
uv sync --locked
73+
# or
2874
just bootstrap
2975
```
3076
31-
## Testing
77+
This will install the correct Python version, create and configure a virtual environment, and install all dependencies.
78+
79+
## Tests
3280
33-
We use [`pytest`](https://docs.pytest.org/) for testing and [`nox`](https://nox.thea.codes/) to run the tests in multiple environments.
81+
The project uses [`pytest`](https://docs.pytest.org/) for testing and [`nox`](https://nox.thea.codes/) to run the tests in multiple environments.
3482
3583
To run the test suite against the default versions of Python (lower bound of supported versions) and Django (lower bound of LTS versions), run:
3684
37-
```shell
38-
python -m nox --session "test"
39-
# or using [just](#just)
85+
```bash
86+
uv run nox --session test
87+
# or
4088
just test
4189
```
4290
43-
To run the test suite against all supported versions of Python and Django, run:
91+
To run the test suite against the entire matrix of supported versions of Python and Django, run:
4492
45-
```shell
46-
python -m nox --session "tests"
47-
# or using [just](#just)
93+
```bash
94+
uv run nox --session tests
95+
# or
4896
just testall
4997
```
5098
51-
## `just`
52-
53-
[`just`](https://github.com/casey/just) is a command runner that is used to run common commands, similar to `make` or `invoke`. A `Justfile` is provided at the base of the repository, which contains commands for common development tasks, such as running the test suite or linting.
54-
55-
To see a list of all available commands, ensure `just` is installed and run the following command at the base of the repository:
99+
Both can be passed additional arguments that will be provided to pytest:
56100
57-
```shell
58-
just
101+
```bash
102+
uv run nox --session test -- -v --last-failed
103+
uv run nox --session tests -- --failed-first --maxfail=1
104+
# or
105+
just test -v --last-failed
106+
just testall --failed-first --maxfail=1
59107
```

Justfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ mod docs ".just/documentation.just"
55

66
[private]
77
default:
8-
@just --list
8+
@just --list --list-submodules
9+
10+
[private]
11+
cog:
12+
uv run --with cogapp cog -r CONTRIBUTING.md
913

1014
[private]
1115
fmt:

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,12 @@ GITHUB_APP = {
390390
391391
Secret used to verify webhook payloads from GitHub.
392392
393+
## Development
394+
395+
For detailed instructions on setting up a development environment and contributing to this project, see [CONTRIBUTING.md](CONTRIBUTING.md).
396+
397+
For release procedures, see [RELEASING.md](RELEASING.md).
398+
393399
## License
394400
395401
django-github-app is licensed under the MIT license. See the [`LICENSE`](LICENSE) file for more information.

0 commit comments

Comments
 (0)