Skip to content

Commit ca047f1

Browse files
authored
Update standards and guidelines (#47)
Signed-off-by: Rémy Greinhofer <[email protected]>
1 parent 7829840 commit ca047f1

File tree

5 files changed

+53
-41
lines changed

5 files changed

+53
-41
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ Provide a link to a live example, or an unambiguous set of steps to
3232
reproduce this bug. Include code to reproduce, if relevant.
3333
-->
3434

35-
1. 2. 3.
35+
1.
36+
2.
37+
3.
3638

3739
## Context
3840

content/CONTRIBUTING.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,16 @@ the repository of the project you are working on.
2727
- Commit messages should follow best practices, including explaining the context
2828
of the problem and how it was solved, including in caveats or follow up
2929
changes required. They should tell the story of the change and provide readers
30-
understanding of what led to it. Please refer to [How to Write a Git
31-
Commit Message] for more details.
32-
- If your [pull request] is a work in progress, create it as a [draft pull request].
33-
- Any [pull request] inactive for 28 days will be automatically closed. If you need
34-
more time to work on it, ask maintainers, to add the appropriate label to it. Use
35-
the `@` mention in the comments.
36-
- Unless explicitly asked, [pull request] which don't pass all the CI checks will
37-
not be reviewed. Use the `@` mention in the comments to ask maintainers to help
38-
you.
30+
understanding of what led to it. Please refer to [How to Write a Git Commit
31+
Message] for more details.
32+
- If your [pull request] is a work in progress, create it as a [draft pull
33+
request].
34+
- Any [pull request] inactive for 28 days will be automatically closed. If you
35+
need more time to work on it, ask maintainers, to add the appropriate label to
36+
it. Use the `@` mention in the comments.
37+
- Unless explicitly asked, [pull request] which don't pass all the CI checks
38+
will not be reviewed. Use the `@` mention in the comments to ask maintainers
39+
to help you.
3940

4041
## Commit example
4142

content/_index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ for the bike industry working to make bicycling safe, convenient, and fun for
1010
people of all ages and abilities. The [Bicycle Network Analysis], a.k.a. the
1111
BNA, is open source software that assesses the quality and connectivity of bike
1212
networks in cities. The [BNA] is an integral part of PeopleForBikes’ [City
13-
Ratings] program, which measures progress towards building great cities for bikes,
14-
shares best practices, and engages more people in bike advocacy.
13+
Ratings] program, which measures progress towards building great cities for
14+
bikes, shares best practices, and engages more people in bike advocacy.
1515

1616
**BNA Mechanics** is the technical group developing the [BNA]. We aim to
1717
simplify and automate tasks to help our advocates focus on what they do best:

content/guidelines.md

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,10 @@ projects.
7171
- Use linters with default configurations
7272
- Unless there is an absolute need for a change
7373

74-
## APIs
74+
## REST APIs
7575

76-
- We follow the [jsonapi.org] specification.
77-
- When in doubt, or if something is unclear in the [jsonapi.org] specification,
78-
refer to the [GitHub REST API] documentation for a well thought real life
79-
example.
76+
- We try to follow the [GitHub REST API] documentation and the [jsonapi.org]
77+
specification for error management.
8078
- Zalando provides very good
8179
[RESTful API Guidelines](https://opensource.zalando.com/restful-api-guidelines/)
8280
worth following
@@ -85,19 +83,11 @@ projects.
8583

8684
### Project management
8785

88-
- [poetry]: Python project management de facto standard
86+
- [uv]: The future of Python project management
8987

9088
We recommend using [just] for managing administration tasks, but for more
9189
complex scenarios [invoke] is an acceptable replacement.
9290

93-
### Poetry settings
94-
95-
Each project must create a local virtual environment at its root :
96-
97-
```bash
98-
poetry config virtualenvs.in-project true --local
99-
```
100-
10191
### pyproject.toml
10292

10393
Describes special sections to add to the `pyproject.toml` configuration file.
@@ -138,10 +128,10 @@ addopts = "-p no:warnings --cov-report term-missing --cov-report html --xdoctest
138128
To quickly start a project, run the following commands:
139129

140130
```bash
141-
export POETRY_PROJECT=my-project
142-
poetry new ${POETRY_PROJECT}
143-
cd ${POETRY_PROJECT}
144-
poetry add -G dev \
131+
export PYTHON_PROJECT=my-project
132+
uv init ${PYTHON_PROJECT}
133+
cd ${PYTHON_PROJECT}
134+
uv add --dev \
145135
bpython \
146136
furo\
147137
isort \
@@ -159,6 +149,11 @@ poetry add -G dev \
159149
xdoctest
160150
```
161151

152+
### Legacy
153+
154+
- [poetry]: Python project management de facto standard
155+
- This project was replaced by the team in January 2025.
156+
162157
### Libraries
163158

164159
#### Production
@@ -207,12 +202,16 @@ poetry add -G dev \
207202
- [axum]: asynchronous HTTP server framework
208203
- [color-eyre]: error report handler
209204
- [clap]: elegant CLI
205+
- [chrono]: full-featured datetime library
210206
- [indicatif]: progress reporting
207+
- [progenitor]: OpenAPI client generator
211208
- [reqwest]: asynchronous HTTP client
212209
- [serde]: serialization/deserialization framework
213210
- [seaorm]: async & dynamic ORM
214211
- [tokio]: asynchronous runtime
215212
- [tracing.rs]: a scoped, structured logging and diagnostics system
213+
- [utoipa]: simple, fast, code first and compile time generated OpenAPI
214+
documentation
216215

217216
## Shell
218217

@@ -225,7 +224,8 @@ poetry add -G dev \
225224

226225
## Tooling
227226

228-
- [just]: General purpose task runner
227+
- [just]: general purpose task runner
228+
- [hyperfine]: benchmark compiled binaries
229229

230230
## Web
231231

@@ -255,14 +255,12 @@ Add the new `font-faces` to `styles/globals.css`:
255255

256256
@font-face {
257257
font-family: "Dharma Gothic E";
258-
src: url("../public/fonts/Dharma Type - DharmaGothicE-ExBold.otf")
259-
format("opentype");
258+
src: url("../public/fonts/Dharma Type - DharmaGothicE-ExBold.otf") format("opentype");
260259
}
261260

262261
@font-face {
263262
font-family: "Dharma Gothic E";
264-
src: url("../public/fonts/Dharma Type - DharmaGothicE-ExLight.otf")
265-
format("opentype");
263+
src: url("../public/fonts/Dharma Type - DharmaGothicE-ExLight.otf") format("opentype");
266264
}
267265
```
268266

@@ -298,6 +296,7 @@ Here are the components collection that have been selected by the team:
298296
[aiohttp]: https://docs.aiohttp.org/en/stable/
299297
[clap]: https://clap.rs/
300298
[color-eyre]: https://github.com/yaahc/color-eyre
299+
[chrono]: https://github.com/chronotope/chrono
301300
[furo]: https://pradyunsg.me/furo
302301
[indicatif]: https://github.com/mitsuhiko/indicatif
303302
[invoke]: https://www.pyinvoke.org
@@ -307,6 +306,7 @@ Here are the components collection that have been selected by the team:
307306
[myst-parser]: https://myst-parser.readthedocs.io/en/latest
308307
[next.js]: https://nextjs.org/docs
309308
[poetry]: https://python-poetry.org
309+
[progenitor]: https://github.com/oxidecomputer/progenitor
310310
[pydantic]: https://pydantic-docs.helpmanual.io
311311
[pytest-cov]: https://github.com/pytest-dev/pytest-cov
312312
[pytest-mock]: https://github.com/pytest-dev/pytest-mock
@@ -330,11 +330,14 @@ Here are the components collection that have been selected by the team:
330330
[tokio]: https://tokio.rs
331331
[typer]: https://typer.tiangolo.com
332332
[typescript]: https://www.typescriptlang.org
333+
[uv]: https://docs.astral.sh/uv/
334+
[utoipa]: https://github.com/juhaku/utoipa
333335
[xdoctest]: https://github.com/Erotemic/xdoctest
334336

335337
<!-- Tooling -->
336338

337339
[just]: https://github.com/casey/just
340+
[hyperfine]: https://github.com/sharkdp/hyperfine
338341

339342
<!-- General links -->
340343

content/standards.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,14 @@ and natural to build high quality deliverables.
8383
example of how to automate maintenance tasks.
8484
- Non trivial commands must be backed by scripts (instead of being written
8585
inline).
86-
- Start designing API specification before implementation (i.e. design first
86+
- Implement REST APIs from business requirements, and document them using the
87+
[OpenAPI 3+ specification](https://swagger.io/specification/) (i.e. code first
8788
approach)
88-
- Use the [OpenAPI 3+ specification](https://swagger.io/specification/)
89+
- Generate the [OpenAPI 3+ specification] from the server
90+
- Generate the clients from the [OpenAPI 3+ specification] for any language
91+
needed.
92+
- Clients must be 100% generated, although they might be **extended** if
93+
needed.
8994

9095
### Continuous Integration
9196

@@ -159,8 +164,8 @@ type of work being done:
159164

160165
Default: [MIT]
161166

162-
For most substantial [BNA Mechanics] open source software projects, there's a simple
163-
default answer: [MIT].
167+
For most substantial [BNA Mechanics] open source software projects, there's a
168+
simple default answer: [MIT].
164169

165170
[MIT] is the
166171
[most popular license](https://github.com/blog/1964-open-source-license-usage-on-github-com)
@@ -422,7 +427,7 @@ Initialize the project, depending on the programming language:
422427

423428
- Rust: `cargo init`
424429
- Python:
425-
`poetry init --name "${PFB_REPO}" --description "${PFB_REPO_DESCRIPTION}"`
430+
`uv init --name "${PFB_REPO}" --description "${PFB_REPO_DESCRIPTION}"`
426431

427432
Add a `README.md` and the appropriate `.gitignore` file:
428433

@@ -513,8 +518,9 @@ gh repo archive -y
513518

514519
[bna mechanics]: https://peopleforbikes.github.io
515520
[calver]: https://calver.org/
516-
[cc0-1.0]: https://choosealicense.com/licenses/cc0-1.0/
517521
[cc-by-4.0]: https://creativecommons.org/licenses/by/4.0/deed.en
522+
[cc0-1.0]: https://choosealicense.com/licenses/cc0-1.0/
518523
[github]: http://github.com
519524
[mit]: https://choosealicense.com/licenses/mit/
525+
[openapi 3+ specification]: https://swagger.io/specification/
520526
[the team]: mailto:[email protected]

0 commit comments

Comments
 (0)