You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set contributor expectations for a zero-dependency ASGI library
CONTRIBUTING.md is rewritten from scratch for this project. It
explains the zero-dependency constraint, how tests work at the raw
ASGI protocol level, and what "tight and atomic" means for AI-
assisted contributions. Installation docs trimmed to the three
commands people actually run.
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
3
+
Staticware is about 270 lines of production code. You can read the entire middleware in one sitting, and that's intentional. Contributions that keep the project small and focused are the ones that land.
4
4
5
-
You can contribute in many ways:
5
+
## Understanding the Project
6
6
7
-
## Types of Contributions
7
+
Before contributing, read `src/staticware/middleware.py`. The whole thing. It's two classes, a couple of helpers, and zero runtime dependencies. The zero-dependency constraint is a design choice: every ASGI framework already has enough dependencies. Staticware should not add to the pile.
8
8
9
-
### Report Bugs
9
+
The test suite at `tests/test_staticware.py` talks directly to the ASGI protocol. Tests construct scope dicts, call the middleware, and collect `send()` messages. No framework test client, no HTTP library. If you're adding a feature, your test should work at the same level.
10
10
11
-
Report bugs at https://github.com/feldroy/staticware/issues.
11
+
## What We're Looking For
12
12
13
-
If you are reporting a bug, please include:
13
+
Bug reports, test cases, docs improvements, and features that fit the project's scope. File issues and pull requests at https://github.com/feldroy/staticware/issues.
14
14
15
-
- Your operating system name and version.
16
-
- Any details about your local setup that might be helpful in troubleshooting.
17
-
- Detailed steps to reproduce the bug.
15
+
If you're proposing a feature, open an issue first. Describe what it does and why it belongs in a static file middleware. Not everything does, and that's fine.
18
16
19
-
### Fix Bugs
17
+
##AI Contributions
20
18
21
-
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants to implement it.
19
+
AI-assisted contributions are welcome. AI-generated slop is not.
22
20
23
-
### Implement Features
21
+
If you use an AI tool to write code for this project, you are responsible for every line it produces. Review it the way you'd review a junior developer's pull request: check the logic, verify the tests actually test what they claim, and make sure the commit messages explain the why, not just the what.
24
22
25
-
Look through the GitHub issues for features. Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it.
23
+
Specific expectations:
26
24
27
-
### Write Documentation
25
+
-**Tight.** No boilerplate, no placeholder comments, no "Replace this with..." stubs. If the AI generated scaffolding, strip it before submitting.
26
+
-**Atomic.** One logical change per commit. If your PR touches the middleware and the docs and the CI config, those should be separate commits with separate messages.
27
+
-**Tested.** Red/green TDD: write a failing test, then write the code that makes it pass. If you can't write the failing test first, you probably don't understand the change well enough yet.
28
28
29
-
Staticware could always use more documentation, whether as part of the official docs, in docstrings, or even on the web in blog posts, articles, and such.
This starts a local server at http://localhost:8000 with live reload. Edit files in `docs/` or add docstrings to your code (the API reference page is auto-generated).
38
-
39
-
### Submit Feedback
40
-
41
-
The best way to send feedback is to file an issue at https://github.com/feldroy/staticware/issues.
42
-
43
-
If you are proposing a feature:
44
-
45
-
- Explain in detail how it would work.
46
-
- Keep the scope as narrow as possible, to make it easier to implement.
47
-
- Remember that this is a volunteer-driven project, and that contributions are welcome :)
48
-
49
-
## Get Started!
50
-
51
-
Ready to contribute? Here's how to set up `staticware` for local development.
Run the full quality suite (format, lint, type check, test):
74
38
75
-
5. When you're done making changes, check that your changes pass linting and the tests:
76
-
77
-
```sh
78
-
just qa
79
-
```
39
+
```sh
40
+
just qa
41
+
```
80
42
81
-
Or run the tests alone:
43
+
Run tests alone:
82
44
83
-
```sh
84
-
just test
85
-
```
86
-
87
-
6. Commit your changes and push your branch to GitHub:
45
+
```sh
46
+
just test
47
+
```
88
48
89
-
```sh
90
-
git add .
91
-
git commit -m "Your detailed description of your changes."
92
-
git push origin name-of-your-bugfix-or-feature
93
-
```
49
+
Preview docs locally:
94
50
95
-
7. Submit a pull request through the GitHub website.
51
+
```sh
52
+
just docs-serve
53
+
```
96
54
97
55
## Pull Request Guidelines
98
56
99
-
Before you submit a pull request, check that it meets these guidelines:
100
-
101
-
1. The pull request should include tests.
102
-
2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.md.
103
-
3. The pull request should work for Python 3.12, 3.13, and 3.14. Tests run in GitHub Actions on every pull request to the main branch, make sure that the tests pass for all supported Python versions.
104
-
105
-
## Tips
106
-
107
-
To run a subset of tests:
108
-
109
-
```sh
110
-
uv run pytest tests/
111
-
```
57
+
1. Include tests. The coverage threshold is 90% and the project currently sits at 98%.
58
+
2. If you add functionality, update the docs and the README features list.
59
+
3. Tests must pass on Python 3.12, 3.13, and 3.14. CI runs automatically on every PR.
112
60
113
-
## Releasing a New Version
61
+
## Releasing
114
62
115
-
1.**Bump the version** and **write the changelog:**
63
+
1. Bump the version:
116
64
```bash
117
65
uv version <version># or: uv version --bump minor
118
66
```
119
-
Then write `CHANGELOG/<version>.md`. See previous entries for the format.
120
-
2.**Commit:**
67
+
Then write `CHANGELOG/<version>.md`.
68
+
2. Commit:
121
69
```bash
122
70
git add pyproject.toml uv.lock CHANGELOG/
123
71
git commit -m "Release <version>"
124
72
```
125
-
3.**Tag and push:**
73
+
3. Tag and push:
126
74
```bash
127
75
just tag
128
76
```
129
-
This creates an annotated `v*` tag from the version in `pyproject.toml`
130
-
and pushes the commit and tag to GitHub.
131
-
4.**Wait for the publish workflow.** The tag triggers `.github/workflows/publish.yml`,
132
-
which builds the package, generates SLSA provenance attestations, and publishes
133
-
to PyPI via trusted publishing.
134
-
5.**Create the GitHub Release:**
77
+
4. Wait for the publish workflow to build, attest, and publish to PyPI.
78
+
5. Create the GitHub Release:
135
79
```bash
136
80
gh release create v<version> --verify-tag \
137
81
--title "Staticware <version>" \
@@ -140,4 +84,4 @@ uv run pytest tests/
140
84
141
85
## Code of Conduct
142
86
143
-
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
87
+
This project follows the [Contributor Code of Conduct](CODE_OF_CONDUCT.md).
0 commit comments