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

test isort template

parent 6a35b2a5
No related branches found
No related tags found
No related merge requests found
Pipeline #22072 passed
......@@ -5,6 +5,7 @@ include:
- 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'
pytest:
stage: templates
......@@ -38,3 +39,15 @@ black:
- pyproject.toml
- templates/python/code_quality/black/**/*
- tests/black_project/**/*
isort:
stage: templates
variables:
PROJECT_PATH: "tests/isort_project"
only:
changes:
- .gitlab-ci.yml
- pyproject.toml
- templates/python/code_quality/isort/**/*
- tests/isort_project/**/*
......@@ -7,7 +7,7 @@ black:
variables:
IMAGE_TAG: !reference [.python_install, variables, IMAGE_TAG]
PROJECT_PATH: "."
PYTHON_SETUP: "pip install ${PROJECT_PATH}[QUALITY]"
PYTHON_SETUP: "pip install black"
script:
- !reference [.python_install, script]
- black ${PROJECT_PATH} --check --diff --quiet
......
......@@ -7,7 +7,7 @@ flake8:
variables:
IMAGE_TAG: !reference [.python_install, variables, IMAGE_TAG]
PROJECT_PATH: "."
PYTHON_SETUP: "pip install ${PROJECT_PATH}[QUALITY]"
PYTHON_SETUP: "pip install flake8"
script:
- !reference [.python_install, script]
- flake8 ${PROJECT_PATH} -v
......
include:
- remote: 'https://api.r2devops.io/job/r/gitlab/dorianturba/r2devops_catalog/python_install@latest.yaml'
isort:
image: python:latest
image: python:${IMAGE_TAG}
stage: code_quality
variables:
IMAGE_TAG: !reference [.python_install, variables, IMAGE_TAG]
PROJECT_PATH: "."
PYTHON_SETUP: "pip install isort"
script:
- python --version # Debug
- python -m venv venv --upgrade-deps || python -m venv venv # upgrade-deps is not supported before 3.9
- source venv/bin/activate
- pip install isort
- isort . --diff
- !reference [.python_install, script]
- isort . --check-only --verbose
only:
changes:
- ./**/*.py
- ${PROJECT_PATH}/**/*.py
- .gitlab-ci.yml
- pyproject.toml
- ${PROJECT_PATH}/pyproject.toml
......@@ -9,8 +9,3 @@ authors = [
{ name = "Author Name", email = "author.name@example.com" },
]
description = "A description of what the package is for."
[project.optional-dependencies]
QUALITY = [
"black",
]
......@@ -9,8 +9,3 @@ authors = [
{ name = "Author Name", email = "author.name@example.com" },
]
description = "A description of what the package is for."
[project.optional-dependencies]
QUALITY = [
"flake8",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "isort_project"
version = "0.1.0"
authors = [
{ name = "Author Name", email = "author.name@example.com" },
]
description = "A description of what the package is for."
from isort_project.a_module import foobar
from isort_project.main import main
from isort_project.z_module import barfoo
__all__ = ["main", "foobar", "barfoo"]
def foobar():
...
"""Sample main module."""
def main() -> bool:
"""Sample main function."""
print("Hello, world!")
return True
if __name__ == "__main__":
main()
def barfoo():
...
\ No newline at end of file
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