From f68e62202d77fb4dc5a3f71c2930022f5c65e8f2 Mon Sep 17 00:00:00 2001 From: Max Pfeiffer Date: Sat, 23 Sep 2023 12:54:19 +0200 Subject: [PATCH] Added isort and badges for readme --- .pre-commit-config.yaml | 5 +++++ README.md | 3 +++ poetry.lock | 2 +- tests/build_image/conftest.py | 11 ++++------- tests/conftest.py | 4 ++-- tests/publish_image/conftest.py | 3 ++- tests/utils.py | 2 +- 7 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 666b77f..9015384 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,6 +10,11 @@ repos: rev: 23.9.1 hooks: - id: black + - repo: https://github.com/pycqa/isort + rev: 5.12.0 + hooks: + - id: isort + name: isort (python) - repo: local hooks: - id: pylint diff --git a/README.md b/README.md index 98a8a02..381e657 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/) +[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) +[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/) [![codecov](https://codecov.io/gh/max-pfeiffer/python-poetry/branch/main/graph/badge.svg?token=WQI2SJJLZN)](https://codecov.io/gh/max-pfeiffer/python-poetry) ![pipeline workflow](https://github.com/max-pfeiffer/python-poetry/actions/workflows/pipeline.yml/badge.svg) ![Docker Image Size (latest semver)](https://img.shields.io/docker/image-size/pfeiffermax/python-poetry?sort=semver) diff --git a/poetry.lock b/poetry.lock index 081e692..3fbf338 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1367,4 +1367,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "3.9.*" -content-hash = "eea508e719a632e4f4bebf664898e3165f9a0e0aedac4c06d74cb57b48ba83ab" +content-hash = "9437d9c529d9e8309000a4199963880ccdfb37427bac2c5da65ef810dc42e557" diff --git a/tests/build_image/conftest.py b/tests/build_image/conftest.py index 5fe723b..eb3b123 100644 --- a/tests/build_image/conftest.py +++ b/tests/build_image/conftest.py @@ -1,15 +1,12 @@ +from os import getenv from time import sleep + import pytest from python_on_whales import Builder, DockerClient -from build.utils import get_image_reference -from tests.constants import ( - CONTEXT, - REGISTRY_PASSWORD, - REGISTRY_USERNAME, -) +from build.utils import get_image_reference +from tests.constants import CONTEXT, REGISTRY_PASSWORD, REGISTRY_USERNAME from tests.registry_container import DockerRegistryContainer -from os import getenv @pytest.fixture(scope="package") diff --git a/tests/conftest.py b/tests/conftest.py index 65ed777..f243e98 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,7 +1,7 @@ -import pytest -from python_on_whales import DockerClient, Builder from random import randrange +import pytest +from python_on_whales import Builder, DockerClient from semver import VersionInfo diff --git a/tests/publish_image/conftest.py b/tests/publish_image/conftest.py index e4f7036..250e8ab 100644 --- a/tests/publish_image/conftest.py +++ b/tests/publish_image/conftest.py @@ -1,6 +1,7 @@ +from os import getenv + import pytest from click.testing import CliRunner -from os import getenv @pytest.fixture(scope="package") diff --git a/tests/utils.py b/tests/utils.py index 94fe2b7..3c92249 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,8 +1,8 @@ from dataclasses import dataclass +from pathlib import Path from docker_image import reference from python_on_whales import DockerClient -from pathlib import Path @dataclass