mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-04-25 00:12:35 +02:00
Expanded a bit on the installation of the project.
This commit is contained in:
parent
d48201595f
commit
82979b1981
118
CONTRIBUTING.md
118
CONTRIBUTING.md
@ -1,70 +1,74 @@
|
|||||||
# Contribution guidelines
|
# Contribution guidelines
|
||||||
|
|
||||||
|
## Dev Setup
|
||||||
|
|
||||||
## Code style
|
- [Install Python 3.11](https://www.python.org/downloads/release/python-3111/)
|
||||||
|
- [Install Poetry](https://python-poetry.org/docs/#installation)
|
||||||
We defined to use the following formats:
|
- [Install GiT](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
|
||||||
- Whitespace Formatting by [Black](https://github.com/psf/black)
|
- [Configure GiT](https://support.atlassian.com/bitbucket-cloud/docs/configure-your-dvcs-username-for-commits/)
|
||||||
- Docstrings Style see the examples provided by [sphinx napoleon](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html) Types in the docstrings are optional but should be consistent per module.
|
- [Generate an SSH Key](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) & [Add SSH Key to GitHub](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account)
|
||||||
- Import Order by [isort](https://pycqa.github.io/isort/)
|
- [Clone the Project (IDE Specific)](https://docs.github.com/de/repositories/creating-and-managing-repositories/cloning-a-repository)
|
||||||
- Strict Typing of function headers see the examples provided by the [mypy](https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html) documentation.
|
- [Install the python Project](https://python-poetry.org/docs/basic-usage/#installing-dependencies)
|
||||||
|
- [Install pre-commit](https://pre-commit.com/#install)
|
||||||
## Language
|
|
||||||
|
|
||||||
We decided to use english on everything close to code but will write longer texts that are not close to the code in german.
|
|
||||||
|
|
||||||
## Pre-Commit installation
|
|
||||||
|
|
||||||
- clone the project
|
|
||||||
- install the following python package:
|
|
||||||
- `pre-commit`
|
|
||||||
|
|
||||||
- execute the command `pre-commit install` to insert the git githook into your local repository.
|
|
||||||
- for more information read [Python Pre-Commit](https://pre-commit.com/)
|
|
||||||
- the following code format rules are so enforced:
|
|
||||||
- Whitespace formatierung:
|
|
||||||
- Python-[Black](https://github.com/psf/black)
|
|
||||||
- leading whitespace in all files
|
|
||||||
- Auto format: yaml, toml, ini
|
|
||||||
- Import norm by:
|
|
||||||
- [isort](https://pycqa.github.io/isort/)
|
|
||||||
- absolut module path
|
|
||||||
- Validierung:
|
|
||||||
- yaml, toml, json, xml
|
|
||||||
- Secret detection
|
|
||||||
- python normen ([pep8](https://peps.python.org/pep-0008/)) with [flake8](https://flake8.pycqa.org/en/latest/)
|
|
||||||
- type checking with ([mypy](https://github.com/python/mypy))
|
|
||||||
|
|
||||||
- Install [Python 3.11](https://www.python.org/downloads/release/python-3111/)
|
|
||||||
- Install Poetry
|
|
||||||
```
|
|
||||||
pip install poetry
|
|
||||||
```
|
|
||||||
- Install dependencies
|
|
||||||
```
|
|
||||||
poetry install
|
|
||||||
```
|
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
### Connection strings
|
### Connection strings
|
||||||
|
|
||||||
Create a `secrets.json` in the root of this repo with the following structure (values to be replaces by desired config):
|
Create a `secrets.json` in the root of this repo with the following structure (values to be replaces by desired config):
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"postgres": {
|
"postgres": {
|
||||||
"username": "postgres",
|
"username": "postgres",
|
||||||
"password": "postgres",
|
"password": "postgres",
|
||||||
"host": "localhost",
|
"host": "localhost",
|
||||||
"database": "postgres",
|
"database": "postgres",
|
||||||
"port": 5432
|
"port": 5432
|
||||||
},
|
},
|
||||||
"mongo": {
|
"mongo": {
|
||||||
"username": "username",
|
"username": "username",
|
||||||
"password": "password",
|
"password": "password",
|
||||||
"host": "localhost",
|
"host": "localhost",
|
||||||
"database": "transparenzregister",
|
"database": "transparenzregister",
|
||||||
"port": 27017
|
"port": 27017
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Example usage see [connector.py](./src/aki_prj23_transparenzregister/utils/postgres/connector.py)
|
Example usage see [connector.py](./src/aki_prj23_transparenzregister/utils/postgres/connector.py)
|
||||||
|
|
||||||
|
## Code style
|
||||||
|
|
||||||
|
We defined to use the following formats:
|
||||||
|
|
||||||
|
- Whitespace Formatting by [Black](https://github.com/psf/black)
|
||||||
|
- Docstrings Style see the examples provided
|
||||||
|
by [sphinx napoleon](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html) Types in the
|
||||||
|
docstrings are optional but should be consistent per module.
|
||||||
|
- Import Order by [isort](https://pycqa.github.io/isort/)
|
||||||
|
- Strict Typing of function headers see the examples provided by
|
||||||
|
the [mypy](https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html) documentation.
|
||||||
|
|
||||||
|
## Language
|
||||||
|
|
||||||
|
We decided to use english on everything close to code but will write longer texts that are not close to the code in
|
||||||
|
german.
|
||||||
|
|
||||||
|
## Pre-Commit Usage
|
||||||
|
|
||||||
|
- the following code format rules are so enforced:
|
||||||
|
- Whitespace formatting:
|
||||||
|
- Python-[Black](https://github.com/psf/black)
|
||||||
|
- leading whitespace in all files
|
||||||
|
- Auto format: yaml, toml, ini
|
||||||
|
- Import norm by:
|
||||||
|
- [isort](https://pycqa.github.io/isort/)
|
||||||
|
- absolut module path
|
||||||
|
- Validation:
|
||||||
|
- yaml, toml, json, xml
|
||||||
|
- Secret detection
|
||||||
|
- python norms ([pep8](https://peps.python.org/pep-0008/))
|
||||||
|
with [ruff](https://github.com/astral-sh/ruff)
|
||||||
|
- type checking with ([mypy](https://github.com/python/mypy))
|
||||||
|
- for more information read [Python Pre-Commit](https://pre-commit.com/)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user