From fb71c61f9dc53f9ed46a3eb86b5eabbe92e5a42e Mon Sep 17 00:00:00 2001 From: Andrew Chen Wang Date: Sun, 3 Mar 2024 15:53:16 -0500 Subject: [PATCH] Add contributing docs to README --- .gitignore | 1 + README.md | 24 +++++++++++++++++++++++- pyproject.toml | 1 + 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b30452d4..f232f5c7 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ __pycache__ *.sublime-* .venv .vscode +.idea granian/*.so target/* diff --git a/README.md b/README.md index 0bc9da6c..2ba0fcda 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ A Rust HTTP server for Python applications. The main reasons behind Granian design are: - Have a single, correct HTTP implementation, supporting versions 1, 2 (and eventually 3) -- Provide a single package for several platforms +- Provide a single package for several platforms - Avoid the usual Gunicorn + uvicorn + http-tools dependency composition on unix systems - Provide stable [performance](https://github.com/emmett-framework/granian/blob/master/benchmarks/README.md) when compared to existing alternatives @@ -215,6 +215,28 @@ Granian is currently under active development. Granian is compatible with Python 3.8 and above versions. +### Contributing + +Create a virtual environment and install: + +```shell +pip install .[hacking] +``` + +On zsh, you may need to do: `.\[hacking\]` instead of `.[hacking]` + +To finalize setup, run: + +```shell +pre-commit install +``` + +To edit rust files, first install Rust if you haven't. Then compile the project: + +```shell +maturin develop +``` + ## License Granian is released under the BSD License. diff --git a/pyproject.toml b/pyproject.toml index 98e14020..90787be7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,6 +55,7 @@ test = [ ] all = ['granian[pname,reload]'] dev = ['granian[all,lint,test]'] +hacking = ['granian[dev]', 'maturin', 'pre-commit'] [project.urls] Homepage = 'https://github.com/emmett-framework/granian'