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 9e80d8af authored by Dorian Turba's avatar Dorian Turba
Browse files

first commit

parents
No related branches found
No related tags found
No related merge requests found
Pipeline #24031 failed
stages:
- test
include:
- remote: 'https://api.r2devops.io/job/r/gitlab/dorianturba/r2devops_catalog/r2_metadata/pytest@latest.yaml'
pytest:
variables:
PYTEST_RUN_CMD: "pytest tests"
repos:
- repo: https://github.com/jackdewinter/pymarkdown
rev: v0.9.13.3
hooks:
- id: pymarkdown
# Contributing to Cookiecutter R2devops Template
## Development environment
### Quality Standards
#### Style Guide
#### Pre-commit hooks
Please use the pre-commit hooks provided in this repository to maintain consistency in
the codebase.
```bash
pip install --upgrade pip
pip install pre-commit
pre-commit install
```
You can manually run the pre-commit hooks on all files:
```bash
pre-commit autoupdate
pre-commit run --all-files
```
This will run the following hooks:
- `pymarkdown`
### Generate requirements
```shell
pip install --upgrade pip --quiet
pip install pip-tools --quiet
pip-compile --output-file=requirements/dev_requirements.txt requirements/dev_requirements.in --quiet --strip-extras
pip-compile --output-file=requirements/requirements.txt requirements/requirements.in --quiet --strip-extras
pip install -r requirements/dev_requirements.txt --quiet
```
# Cookiecutter R2devops Template
## Use the Cookiecutter Template
### Install requirements
```shell
pip install -r requirements/requirements.txt
```
{
"template_name": "First Template",
"template_slug": "{{ cookiecutter.template_name.lower().replace(' ', '_') }}",
"template_description": "A description of what the template is for.",
"template_icon": "\uD83C\uDF6A",
"template_is_public": true,
"template_label": "Utilities",
"template_license": "MIT",
"template_is_deprecated": false,
"template_stage": "jobs",
"template_script": "echo 'Hello World!'"
}
\ No newline at end of file
[tool.pymarkdown]
strict-config = true
plugins.line-length.enabled = false
-r requirements.in
pytest
pytest-cookies
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --output-file=requirements/dev_requirements.txt --strip-extras requirements/dev_requirements.in
#
arrow==1.2.3
# via cookiecutter
binaryornot==0.4.4
# via cookiecutter
certifi==2023.7.22
# via requests
chardet==5.2.0
# via binaryornot
charset-normalizer==3.2.0
# via requests
click==8.1.7
# via cookiecutter
cookiecutter==2.3.0
# via
# -r requirements/requirements.in
# pytest-cookies
idna==3.4
# via requests
iniconfig==2.0.0
# via pytest
jinja2==3.1.2
# via cookiecutter
markdown-it-py==3.0.0
# via rich
markupsafe==2.1.3
# via jinja2
mdurl==0.1.2
# via markdown-it-py
packaging==23.1
# via pytest
pluggy==1.3.0
# via pytest
pygments==2.16.1
# via rich
pytest==7.4.2
# via
# -r requirements/dev_requirements.in
# pytest-cookies
pytest-cookies==0.7.0
# via -r requirements/dev_requirements.in
python-dateutil==2.8.2
# via arrow
python-slugify==8.0.1
# via cookiecutter
pyyaml==6.0.1
# via cookiecutter
requests==2.31.0
# via cookiecutter
rich==13.5.2
# via cookiecutter
six==1.16.0
# via python-dateutil
text-unidecode==1.3
# via python-slugify
urllib3==2.0.4
# via requests
cookiecutter
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --output-file=requirements/requirements.txt --strip-extras requirements/requirements.in
#
arrow==1.2.3
# via cookiecutter
binaryornot==0.4.4
# via cookiecutter
certifi==2023.7.22
# via requests
chardet==5.2.0
# via binaryornot
charset-normalizer==3.2.0
# via requests
click==8.1.7
# via cookiecutter
cookiecutter==2.3.0
# via -r requirements/requirements.in
idna==3.4
# via requests
jinja2==3.1.2
# via cookiecutter
markdown-it-py==3.0.0
# via rich
markupsafe==2.1.3
# via jinja2
mdurl==0.1.2
# via markdown-it-py
pygments==2.16.1
# via rich
python-dateutil==2.8.2
# via arrow
python-slugify==8.0.1
# via cookiecutter
pyyaml==6.0.1
# via cookiecutter
requests==2.31.0
# via cookiecutter
rich==13.5.2
# via cookiecutter
six==1.16.0
# via python-dateutil
text-unidecode==1.3
# via python-slugify
urllib3==2.0.4
# via requests
import pytest
@pytest.fixture
def context():
return {
"template_name": "My Template",
"template_slug": "my_template",
}
def test_dal_project(cookies, context):
result = cookies.bake(extra_context=context)
assert result.exit_code == 0
assert result.exception is None
assert result.project_path.name == context["template_name"]
assert result.project_path.is_dir()
assert (result.project_path / "README.md").is_file()
assert (result.project_path / f"{context['template_slug']}.r2.yml").is_file()
assert (result.project_path / f"{context['template_slug']}.yml").is_file()
# {{ cookiecutter.template_slug }} template
## Objective
...
## How to use it
1. Include the {{ cookiecutter.template_slug }} template in your CI/CD
configuration (see quick use above).
2. 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 |
|------------|-------------|-------------|
| `VARIABLE` | ... | `"default"` |
files:
template: ../templates/{{ cookiecutter.template_slug }}/{{ cookiecutter.template_slug }}.yml
documentation: ../templates/{{ cookiecutter.template_slug }}/README.md
data:
description: "{{ cookiecutter.template_description }}"
icon: {{ cookiecutter.template_icon }}
public: {{ cookiecutter.template_is_public }}
labels:
- {{ cookiecutter.template_label }}
license: {{ cookiecutter.template_license }}
deprecated: {{ cookiecutter.template_is_deprecated }}
{{ cookiecutter.template_slug }}:
stage: {{ cookiecutter.template_stage }}
script:
- {{ cookiecutter.template_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