Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 50a3fc87 authored by Dorian Turba's avatar Dorian Turba
Browse files

update all README.md to add variables

parent 21f38581
No related branches found
No related tags found
No related merge requests found
Pipeline #23673 passed
......@@ -2,13 +2,13 @@ stages:
- templates
include:
- local: 'templates/python/partial/python_install/python_install.yml'
- local: 'templates/python/testing/pytest/pytest.yml'
- local: 'templates/python/code_quality/flake8/flake8.yml'
- local: 'templates/python/code_quality/black/black.yml'
- local: 'templates/python/code_quality/isort/isort.yml'
- local: 'templates/python/code_quality/mypy/mypy.yml'
- local: 'templates/python/code_quality/ruff/ruff.yml'
- local: 'templates/python/partial/python_install/python_install.yml'
- local: 'templates/python/testing/pytest/pytest.yml'
- local: 'templates/python/code_quality/flake8/flake8.yml'
- local: 'templates/python/code_quality/black/black.yml'
- local: 'templates/python/code_quality/isort/isort.yml'
- local: 'templates/python/code_quality/mypy/mypy.yml'
- local: 'templates/python/code_quality/ruff/ruff.yml'
python_install:
extends:
......@@ -18,7 +18,7 @@ python_install:
PROJECT_PATH: "tests/python_install_project"
PYTHON_SETUP: "pip install ${PROJECT_PATH}"
script:
- !reference [.python_install, script]
- !reference [ .python_install, script ]
only:
changes:
- .gitlab-ci.yml
......@@ -28,7 +28,7 @@ python_install:
pytest:
stage: templates
needs: ["python_install"]
needs: [ "python_install" ]
variables:
PROJECT_PATH: "tests/pytest_project"
PYTHON_SETUP: "pip install ${PROJECT_PATH}[TESTS]"
......@@ -41,7 +41,7 @@ pytest:
flake8:
stage: templates
needs: ["python_install"]
needs: [ "python_install" ]
variables:
PROJECT_PATH: "tests/flake8_project"
only:
......@@ -53,7 +53,7 @@ flake8:
black:
stage: templates
needs: ["python_install"]
needs: [ "python_install" ]
variables:
PROJECT_PATH: "tests/black_project"
only:
......@@ -66,7 +66,7 @@ black:
isort:
stage: templates
needs: ["python_install"]
needs: [ "python_install" ]
variables:
PROJECT_PATH: "tests/isort_project"
only:
......@@ -78,7 +78,7 @@ isort:
mypy:
stage: templates
needs: ["python_install"]
needs: [ "python_install" ]
variables:
PROJECT_PATH: "tests/mypy_project"
only:
......@@ -90,7 +90,7 @@ mypy:
ruff:
stage: templates
needs: ["python_install"]
needs: [ "python_install" ]
variables:
PROJECT_PATH: "tests/ruff_project"
only:
......
......@@ -12,6 +12,14 @@ style guide. Black is configured with `--check --diff --quiet` rules.
3. If you need to customize the job, check
the [jobs customization](https://docs.r2devops.io/get-started/use-templates/#job-templates-customization).
## Variables
| Name | Description | Default |
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------|
| `PROJECT_PATH` | The path to the project root directory. | `"."` |
| `IMAGE_TAG` | The default tag for the docker image. See [Python Docker Official Image](https://hub.docker.com/_/python) for supported tags and respective Dockerfile links. | `"latest"` |
| `PYTHON_SETUP` | Bash commands to setup your python environment. | `"pip install black"` |
## Global Configuration of Black
To add configuration to `black` shared with any other usage of black (such as manual run,
......
## Objective
Run [Flake8](https://flake8.pycqa.org/en/latest/) and its plugins on your Python code to ensure it adheres to PEP8
standards and to detect various errors such as syntax errors, semantic errors, and complex code.
Run [Flake8](https://flake8.pycqa.org/en/latest/) and its plugins on your Python code to
ensure it adheres to PEP8
standards and to detect various errors such as syntax errors, semantic errors, and
complex code.
Flake8 is a Python tool that glues together pycodestyle, pyflakes, and McCabe.
## How to use it
1. Configure the `.flake8` file in your repository's root directory with your desired rules.
1. Configure the `.flake8` file in your repository's root directory with your desired
rules.
2. Include the flake8 template in your CI/CD configuration (see quick use above).
3. If you need to customize the job, check
the [jobs customization](https://docs.r2devops.io/get-started/use-templates/#job-templates-customization).
## Variables
| Name | Description | Default |
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------|
| `PROJECT_PATH` | The path to the project root directory. | `"."` |
| `IMAGE_TAG` | The default tag for the docker image. See [Python Docker Official Image](https://hub.docker.com/_/python) for supported tags and respective Dockerfile links. | `"latest"` |
| `PYTHON_SETUP` | Bash commands to setup your python environment. | `"pip install flake8"` |
## Global Configuration of Flake8
To add configuration to `flake8` shared with any other usage of flake8 (such as manual run,
To add configuration to `flake8` shared with any other usage of flake8 (such as manual
run,
pre-commit, etc), you can use `.flake8` configuration file. Learn more
about [flake8 configuration](https://flake8.pycqa.org/en/latest/user/configuration.html) files.
about [flake8 configuration](https://flake8.pycqa.org/en/latest/user/configuration.html)
files.
## Add a [![Flake8](https://img.shields.io/badge/Linter-Flake8-blue)](https://flake8.pycqa.org/) badge to your project README.md
To display the use of Flake8 in your project, you can add the following badge to your README.md:
To display the use of Flake8 in your project, you can add the following badge to your
README.md:
```markdown
[![Flake8](https://img.shields.io/badge/Linter-Flake8-blue)](https://flake8.pycqa.org/)
......
......@@ -12,6 +12,14 @@ your code remains clean and readable.
3. If you need to customize the job, check
the [jobs customization](https://docs.r2devops.io/get-started/use-templates/#job-templates-customization).
## Variables
| Name | Description | Default |
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------|
| `PROJECT_PATH` | The path to the project root directory. | `"."` |
| `IMAGE_TAG` | The default tag for the docker image. See [Python Docker Official Image](https://hub.docker.com/_/python) for supported tags and respective Dockerfile links. | `"latest"` |
| `PYTHON_SETUP` | Bash commands to setup your python environment. | `"pip install isort"` |
## Global Configuration of isort
To add configuration to `isort` shared with any other usage of isort (such as manual run,
......
......@@ -12,6 +12,14 @@ types of variables, function return values, and more.
3. If you need to customize the job, check
the [jobs customization](https://docs.r2devops.io/get-started/use-templates/#job-templates-customization).
## Variables
| Name | Description | Default |
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------|
| `PROJECT_PATH` | The path to the project root directory. | `"."` |
| `IMAGE_TAG` | The default tag for the docker image. See [Python Docker Official Image](https://hub.docker.com/_/python) for supported tags and respective Dockerfile links. | `"latest"` |
| `PYTHON_SETUP` | Bash commands to setup your python environment. | `"pip install mypy"` |
## Global Configuration of mypy
To add configuration to `mypy` shared with any other usage of mypy (such as manual run, pre-commit,
......
......@@ -11,6 +11,14 @@ various syntax and stylistic errors.
3. If you need to customize the job, refer to
the [jobs customization](https://docs.r2devops.io/get-started/use-templates/#job-templates-customization)
documentation.
4.
## Variables
| Name | Description | Default |
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------|
| `PROJECT_PATH` | The path to the project root directory. | `"."` |
| `IMAGE_TAG` | The default tag for the docker image. See [Python Docker Official Image](https://hub.docker.com/_/python) for supported tags and respective Dockerfile links. | `"latest"` |
| `PYTHON_SETUP` | Bash commands to setup your python environment. | `"pip install ruff"` |
### Global Configuration of Ruff
......
......@@ -13,12 +13,12 @@ consistent configuration across CI jobs that rely on a python environment.
## Variables
| Name | Description | Default |
|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|
| `PROJECT_PATH` | The path to the project root directory. | `"."` |
| `REQUIREMENTS_FILE` | the path to the requirements file. | `"${PROJECT_PATH}/requirements.txt"` |
| `IMAGE_TAG` | The default tag for the docker image. See [Python Docker Official Image](https://hub.docker.com/_/python) for supported tags and respective Dockerfile links | `"latest"` |
| `PYTHON_SETUP` | Bash commands to setup your python environment. Default rely on `requirements.txt` to install all dependencies. | `"pip install -r ${PROJECT_PATH}/requirements.txt"` |
| Name | Description | Default |
|--------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------|
| `PROJECT_PATH` | The path to the project root directory. | `"."` |
| `REQUIREMENTS_FILE_PATH` | the path to the requirements file. | `"${PROJECT_PATH}/requirements.txt"` |
| `IMAGE_TAG` | The default tag for the docker image. See [Python Docker Official Image](https://hub.docker.com/_/python) for supported tags and respective Dockerfile links. | `"latest"` |
| `PYTHON_SETUP` | Bash commands to setup your python environment. Default rely on `requirements.txt` to install all dependencies. | `"pip install -r ${REQUIREMENTS_FILE_PATH}"` |
## Example of use
......
......@@ -14,12 +14,13 @@ automation, modular fixtures, parameterized testing, and many other features.
## Variables
| Name | Description | Default |
|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|
| `PROJECT_PATH` | The path to the project root directory. | `"."` |
| `IMAGE_TAG` | The default tag for the docker image. See [Python Docker Official Image](https://hub.docker.com/_/python) for supported tags and respective Dockerfile links | `"latest"` |
| `PYTHON_SETUP` | Bash commands to setup your python environment. Default rely on `requirements.txt` to install project and test dependencies. | `"pip install -r ${PROJECT_PATH}/requirements.txt"` |
| `PYTEST_RUN_CMD` | Bash command to run pytest. | `"pytest ${PROJECT_PATH}"` |
| Name | Description | Default |
|--------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------|
| `PROJECT_PATH` | The path to the project root directory. | `"."` |
| `REQUIREMENTS_FILE_PATH` | the path to the requirements file. | `"${PROJECT_PATH}/requirements.txt"` |
| `IMAGE_TAG` | The default tag for the docker image. See [Python Docker Official Image](https://hub.docker.com/_/python) for supported tags and respective Dockerfile links. | `"latest"` |
| `PYTHON_SETUP` | Bash commands to setup your python environment. Default rely on `requirements.txt` to install all dependencies. | `"pip install -r ${REQUIREMENTS_FILE_PATH}"` |
| `PYTEST_RUN_CMD` | Bash command to run pytest. | `"pytest ${PROJECT_PATH}"` |
## Global Configuration of pytest
......
......@@ -6,7 +6,6 @@ pytest:
- .python_install
stage: test
variables:
PYTHON_SETUP: "pip install -r ${PROJECT_PATH}/requirements.txt"
PYTEST_RUN_CMD: "pytest ${PROJECT_PATH}"
script:
- !reference [.python_install, script]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment