From b717b6224bf9e5fd585ff6b0bed77b3333ad2a68 Mon Sep 17 00:00:00 2001 From: 0x26res Date: Tue, 19 Sep 2023 22:33:32 +0200 Subject: [PATCH] Add developer page (#41) --- docs/development.md | 68 +++++++++++++++++++++++++++++++++++++++++++++ mkdocs.yml | 16 +++++++++++ pyproject.toml | 13 ++++----- 3 files changed, 89 insertions(+), 8 deletions(-) create mode 100644 docs/development.md diff --git a/docs/development.md b/docs/development.md new file mode 100644 index 0000000..f36b92e --- /dev/null +++ b/docs/development.md @@ -0,0 +1,68 @@ + +# Development + +## Set up + +```shell +python3 -m venv --clear venv +source venv/bin/activate +poetry self add "poetry-dynamic-versioning[plugin]" +poetry install +pre-commit install +``` + +## Testing + + +To run tests fast: +```shell +pytest -n auto tests +``` + +To Get coverage: +```shell +coverage run --branch --include "./beavers/*" -m pytest tests +coverage report --show-missing +``` + +## Generating the change log + +We use [git-change-log](https://pawamoy.github.io/git-changelog/usage/) to generate our CHANGELOG.md + +Please follow the [basic convention](https://pawamoy.github.io/git-changelog/usage/#basic-convention) for commit message. + +To update the change log, run: +```shell +git-changelog -io CHANGELOG.md +``` + +## New Release + +For new release, first prepare the change log, push and merge it. +```shell +git-changelog -bio CHANGELOG.md`` +``` + +Then tag and push: +```shell +git tag vX.X.X +git push origin vX.X.X +``` + +Lastly on github, go to tags and create a release. +The CI will deploy to pypi automatically from then. + +## Testing the documentation + +```shell +mkdocs serve --livereload --watch=./ +``` + +## Updating dependencies + +- For the repo `poetry lock` +- For the doc: `(cd docs/; pip-compile ./requirements.in > ./requirements.txt)` + +## Resources + +The repo set up is inspired by this [guide](https://mathspp.com/blog/how-to-create-a-python-package-in-2022) diff --git a/mkdocs.yml b/mkdocs.yml index 78a4cae..cb630cc 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -42,3 +42,19 @@ markdown_extensions: - md_in_html extra: project_name: "beavers" + + +nav: + - Home: + - index.md + - Concepts: + - concepts/1_dag.md + - concepts/2_advanced.md + - concepts/3_replay.md + - concepts/4_kafka.md + - API Reference: + - reference/engine.md + - reference/kafka.md + - reference/replay.md + - install.md + - development.md diff --git a/pyproject.toml b/pyproject.toml index 43d1b77..355dd06 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,23 +31,20 @@ black = "^22.10.0" coverage = ">=6.5.0" flake8 = ">=5.0.4" isort = ">=5.10.1" -mkdocs = ">=1.5.3" pip-tools = "^6.12.1" pre-commit = ">=2.20.0" pylint = ">=2.15.0" pytest = ">=7.2.0" click = ">=8.1.7" -mkdocs-material = ">=9.3.2" -mkdocstrings = { version = ">=0.21.2", extras = ['python'] } mock = "*" -git-changelog = "^2.2.0" +git-changelog = ">=2.2.0" [tool.poetry.group.docs.dependencies] markdown-include = "*" -mkdocs = "*" -mkdocs-material = "*" +mkdocs = ">=1.5.3" mkdocs-material-extensions = "*" -mkdocstrings = {version = "*", extras = ['python']} +mkdocs-material = ">=9.3.2" +mkdocstrings = { version = ">=0.21.2", extras = ["python"] } pymdown-extensions = "*" @@ -56,7 +53,7 @@ requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"] build-backend = "poetry_dynamic_versioning.backend" [tool.black] -target-version = ['py310'] +target-version = ["py310"] exclude = "venv/|tox/" [tool.isort]