Skip to content

Commit 082c2f9

Browse files
authored
feat: add contribution guidelines (#25)
1 parent a89e6ae commit 082c2f9

File tree

4 files changed

+84
-1
lines changed

4 files changed

+84
-1
lines changed

.github/pull_request_template.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!-- pyml disable-next-line first-line-heading -->
2+
## What I'm changing
3+
4+
- <!-- a list of changes, including any issues this might close or reference -->
5+
6+
## How I did it
7+
8+
- <!-- more detail on decisions and choices -->
9+
10+
## Checklist
11+
12+
- [ ] Tests pass: `uv run pytest`
13+
- [ ] Checks pass: `uv run pre-commit --all-files`
14+
- [ ] CHANGELOG is updated (if necessary)

CONTRIBUTING.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Contributing
2+
3+
First, thanks for contributing to **pystapi**!
4+
The [README](./README.md#development) as instructions on setting up your development environment, which is a great place to start.
5+
6+
## Repository organization
7+
8+
**pystapi** is a "monorepo", meaning that it contains several sub-projects.
9+
Each project has it's own `pyproject.toml` file, README, CHANGELOG, tests, and more.
10+
Development dependencies should be specified at the top-level `pyproject.toml` file, as tests are intended to be run for the entire repository at once.
11+
12+
## Branches
13+
14+
We have a single primary development branch, **main**.
15+
Releases are cut from this branch by tags.
16+
Tags are named to identify which project they are releasing, e.g. a **stapi-pydantic** tag might look like `stapi-pydantic/v0.1.2`.
17+
If necessary, long-lived release branches are used to manage non-breaking changes and fixes, e.g. a `stapi-pydantic/v0.1` branch to handle any bugfixes that need to be backported to the v0.1 lineage of the project after **main** has incorporated breaking changes.
18+
19+
## Testing
20+
21+
We use [pytest](https://docs.pytest.org).
22+
Tests should be written in the "pytest style", i.e. free functions.
23+
24+
Good:
25+
26+
```python
27+
def test_foo() -> None:
28+
assert 1 == 1
29+
```
30+
31+
Bad:
32+
33+
```python
34+
class FooTest(unittest.TestCase):
35+
def test_foo(self) -> None:
36+
assert 1 == 1
37+
```
38+
39+
## Static typing
40+
41+
We use [mypy](https://mypy-lang.org/) for static typing.
42+
When possible, projects work in `strict` mode, meaning that type checking is strongly enforced.
43+
Some projects are not quite ready for `strict` mode, but we want to get them there.
44+
45+
## Lints and checks
46+
47+
We use [pre-commit](https://pre-commit.com/).
48+
If you want to run checks on every commit:
49+
50+
```shell
51+
uv run pre-commit install
52+
```
53+
54+
If you ever need to disable **pre-commit** when committing use `--no-verify`:
55+
56+
```shell
57+
git commit --no-verify
58+
```
59+
60+
## Submitting changes
61+
62+
Open a [pull request](https://github.com/stapi-spec/pystapi/pulls) with your changes, and fill out the provided template.
63+
It's not required, but it's helpful if you name your pull request in the [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/) style, as the pull request titles are the eventual commit title for your changes (we use squash-and-merge).
64+
A **pystapi** maintainer will review your PR and request any changes.
65+
Once approved, if you have the permissions you can merge your PR ... if you don't, a maintainer will.
66+
67+
If your PR is not ready for review, but you'd like some feedback on it anyways, open it as a draft.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ If you don't want to type `uv run` all the time:
3030
source .venv/bin/activate
3131
```
3232

33+
See our [contribution guidelines](./CONTRIBUTING.md) for information on contributing any changes, fixes, or features.
34+
3335
### stapi-fastapi server
3436

3537
A minimal test implementation is provided in [stapi-fastapi/tests/application.py](stapi-fastapi/tests/application.py).

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ module = "pygeofilter.parsers.*"
7070
ignore_missing_imports = true
7171

7272
[tool.pymarkdown]
73-
plugins.md013.line_length = 120
73+
plugins.md013.enabled = false # @gadomski likes to do one-line-per-sentence in markdown
7474
plugins.md024.enabled = false # duplicate headers in changelog
7575

7676
[tool.coverage.report]

0 commit comments

Comments
 (0)