Skip to content

Commit

Permalink
Revert "Introduce ruff (#363)"
Browse files Browse the repository at this point in the history
This reverts commit 74dd373
  • Loading branch information
sujuka99 authored and irux committed Oct 18, 2023
1 parent c228fef commit ac9a01c
Show file tree
Hide file tree
Showing 56 changed files with 339 additions and 441 deletions.
17 changes: 0 additions & 17 deletions .github/ruff-matcher.json

This file was deleted.

Empty file removed .github/scripts/__init__.py
Empty file.
20 changes: 10 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,11 @@ jobs:
- name: Install dependencies
run: poetry install --no-interaction

- name: Lint (ruff)
shell: bash
run: |
if [[ "$RUNNER_OS" == "Linux" && "${{ matrix.python-version }}" == "3.10" ]]
then
echo "::add-matcher::.github/ruff-matcher.json"
poetry run ruff check . --config pyproject.toml --output-format text --no-fix
else
poetry run pre-commit run ruff --all-files --show-diff-on-failure
fi;
- name: Lint (flake8)
run: poetry run pre-commit run flake8 --all-files --show-diff-on-failure

- name: Order of imports (isort)
run: poetry run pre-commit run isort --all-files --show-diff-on-failure

- name: Formatting (black)
run: poetry run pre-commit run black --all-files --show-diff-on-failure
Expand All @@ -64,6 +59,11 @@ jobs:
- name: Generate pipeline definitions
run: poetry run pre-commit run gen-docs-components --all-files --show-diff-on-failure

# TODO: enable when PEP 604 incompatibilty is in typer is resolved https://github.com/tiangolo/typer/issues/348
# See https://github.com/tiangolo/typer/pull/522
# - name: Syntax (pyupgrade)
# run: poetry run pre-commit run --hook-stage manual pyupgrade --all-files

- name: Test
run: poetry run pytest tests

Expand Down
31 changes: 23 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,43 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--settings", "setup.cfg"]
exclude: ^tests/.*snapshots/
- repo: local
hooks:
- id: ruff
name: ruff
entry: ruff check .
args: [ --config, pyproject.toml, --fix, --show-fixes, --exit-non-zero-on-fix ]
language: system
types_or: [python]
require_serial: true # run once for all files
pass_filenames: false
- id: black
name: black
entry: black
language: system
types_or: [python, pyi]
require_serial: true # run once for all files
exclude: ^tests/.*snapshots/
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: flake8
args: ["--config", "setup.cfg"]
exclude: ^tests/.*snapshots/
- repo: local
hooks:
- id: pyright
name: pyright
entry: pyright
language: system
types: [python]
require_serial: true # run once for all files
exclude: ^tests/.*snapshots/
- repo: https://github.com/asottile/pyupgrade
rev: v3.1.0
hooks:
- id: pyupgrade
stages: [manual]
args: ["--py310-plus"]
exclude: ^tests/.*snapshots/
- repo: local
hooks:
- id: gen-schema
name: gen-schema
entry: python hooks/gen_schema.py
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[![Build status](https://github.com/bakdata/kpops/actions/workflows/ci.yaml/badge.svg)](https://github.com/bakdata/kpops/actions/workflows/ci.yaml)
[![pypi](https://img.shields.io/pypi/v/kpops.svg)](https://pypi.org/project/kpops)
[![versions](https://img.shields.io/pypi/pyversions/kpops.svg)](https://github.com/bakdata/kpops)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![license](https://img.shields.io/github/license/bakdata/kpops.svg)](https://github.com/bakdata/kpops/blob/main/LICENSE)

## Key features
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/schema/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$ref": "#/definitions/PipelineConfig",
"definitions": {
"HelmConfig": {
"description": "Global Helm configuration.",
"description": "Global Helm configuration",
"properties": {
"api_version": {
"description": "Kubernetes API version used for Capabilities.APIVersions",
Expand Down
44 changes: 22 additions & 22 deletions docs/docs/schema/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"definitions": {
"FromSection": {
"additionalProperties": false,
"description": "Holds multiple input topics.",
"description": "Holds multiple input topics",
"properties": {
"components": {
"additionalProperties": {
Expand All @@ -28,7 +28,7 @@
},
"FromTopic": {
"additionalProperties": false,
"description": "Input topic.",
"description": "Input topic",
"properties": {
"role": {
"description": "Custom identifier belonging to a topic; define only if `type` is `pattern` or `None`",
Expand All @@ -48,7 +48,7 @@
"type": "object"
},
"HelmRepoConfig": {
"description": "Helm repository configuration.",
"description": "Helm repository configuration",
"properties": {
"repo_auth_flags": {
"allOf": [
Expand Down Expand Up @@ -85,7 +85,7 @@
"type": "object"
},
"InputTopicTypes": {
"description": "Input topic types.\n\nINPUT (input topic), PATTERN (extra-topic-pattern or input-topic-pattern)",
"description": "Input topic types\n\nINPUT (input topic), PATTERN (extra-topic-pattern or input-topic-pattern)",
"enum": [
"input",
"pattern"
Expand All @@ -97,7 +97,7 @@
"additionalProperties": {
"type": "string"
},
"description": "Settings specific to Kafka Connectors.",
"description": "Settings specific to Kafka Connectors",
"properties": {
"connector.class": {
"title": "Connector.Class",
Expand All @@ -111,7 +111,7 @@
"type": "object"
},
"KafkaSinkConnector": {
"description": "Kafka sink connector model.",
"description": "Kafka sink connector model",
"properties": {
"app": {
"allOf": [
Expand Down Expand Up @@ -183,7 +183,7 @@
},
"type": {
"default": "kafka-sink-connector",
"description": "Kafka sink connector model.",
"description": "Kafka sink connector model",
"enum": [
"kafka-sink-connector"
],
Expand All @@ -206,7 +206,7 @@
"type": "object"
},
"KafkaSourceConnector": {
"description": "Kafka source connector model.",
"description": "Kafka source connector model",
"properties": {
"app": {
"allOf": [
Expand Down Expand Up @@ -283,7 +283,7 @@
},
"type": {
"default": "kafka-source-connector",
"description": "Kafka source connector model.",
"description": "Kafka source connector model",
"enum": [
"kafka-source-connector"
],
Expand Down Expand Up @@ -384,13 +384,13 @@
"type": "object"
},
"KubernetesAppConfig": {
"description": "Settings specific to Kubernetes Apps.",
"description": "Settings specific to Kubernetes Apps",
"properties": {},
"title": "KubernetesAppConfig",
"type": "object"
},
"OutputTopicTypes": {
"description": "Types of output topic.\n\nOUTPUT (output topic), ERROR (error topic)",
"description": "Types of output topic\n\nOUTPUT (output topic), ERROR (error topic)",
"enum": [
"output",
"error"
Expand All @@ -399,7 +399,7 @@
"type": "string"
},
"ProducerApp": {
"description": "Producer component.\nThis producer holds configuration to use as values for the streams bootstrap producer helm chart. Note that the producer does not support error topics.",
"description": "Producer component\nThis producer holds configuration to use as values for the streams bootstrap producer helm chart. Note that the producer does not support error topics.",
"properties": {
"app": {
"allOf": [
Expand Down Expand Up @@ -462,7 +462,7 @@
},
"type": {
"default": "producer-app",
"description": "Producer component.\nThis producer holds configuration to use as values for the streams bootstrap producer helm chart. Note that the producer does not support error topics.",
"description": "Producer component\nThis producer holds configuration to use as values for the streams bootstrap producer helm chart. Note that the producer does not support error topics.",
"enum": [
"producer-app"
],
Expand All @@ -485,7 +485,7 @@
"type": "object"
},
"ProducerStreamsConfig": {
"description": "Kafka Streams settings specific to Producer.",
"description": "Kafka Streams settings specific to Producer",
"properties": {
"brokers": {
"description": "Brokers",
Expand Down Expand Up @@ -519,7 +519,7 @@
"type": "object"
},
"ProducerValues": {
"description": "Settings specific to producers.",
"description": "Settings specific to producers",
"properties": {
"nameOverride": {
"description": "Override name with this value",
Expand All @@ -543,7 +543,7 @@
"type": "object"
},
"RepoAuthFlags": {
"description": "Authorisation-related flags for `helm repo`.",
"description": "Authorisation-related flags for `helm repo`",
"properties": {
"ca_file": {
"description": "Path to CA bundle file to verify certificates of HTTPS-enabled servers",
Expand Down Expand Up @@ -578,7 +578,7 @@
"type": "object"
},
"StreamsApp": {
"description": "StreamsApp component that configures a streams bootstrap app.",
"description": "StreamsApp component that configures a streams bootstrap app",
"properties": {
"app": {
"allOf": [
Expand Down Expand Up @@ -645,7 +645,7 @@
},
"type": {
"default": "streams-app",
"description": "StreamsApp component that configures a streams bootstrap app.",
"description": "StreamsApp component that configures a streams bootstrap app",
"enum": [
"streams-app"
],
Expand All @@ -668,7 +668,7 @@
"type": "object"
},
"StreamsAppAutoScaling": {
"description": "Kubernetes Event-driven Autoscaling config.",
"description": "Kubernetes Event-driven Autoscaling config",
"properties": {
"consumerGroup": {
"description": "Name of the consumer group used for checking the offset on the topic and processing the related lag.",
Expand Down Expand Up @@ -771,7 +771,7 @@
"type": "object"
},
"StreamsConfig": {
"description": "Streams Bootstrap streams section.",
"description": "Streams Bootstrap streams section",
"properties": {
"brokers": {
"description": "Brokers",
Expand Down Expand Up @@ -854,7 +854,7 @@
"type": "object"
},
"ToSection": {
"description": "Holds multiple output topics.",
"description": "Holds multiple output topics",
"properties": {
"models": {
"additionalProperties": {
Expand All @@ -880,7 +880,7 @@
},
"TopicConfig": {
"additionalProperties": false,
"description": "Configure an output topic.",
"description": "Configure an output topic",
"properties": {
"configs": {
"additionalProperties": {
Expand Down
2 changes: 1 addition & 1 deletion hooks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""KPOps pre-commit hooks."""
"""KPOps pre-commit hooks"""
from pathlib import Path

PATH_ROOT = Path(__file__).parents[1]
2 changes: 1 addition & 1 deletion hooks/gen_docs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class IterableStrEnum(str, Enum):
"""Polyfill that also introduces dict-like behavior.
"""Polyfill that also introduces dict-like behavior
Introduces constructors that return a ``Iterator`` object
either containing all items, only their names or their values.
Expand Down
4 changes: 2 additions & 2 deletions hooks/gen_schema.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Generates the stock KPOps editor integration schemas."""
"""Generates the stock KPOps editor integration schemas"""
from contextlib import redirect_stdout
from io import StringIO
from pathlib import Path
Expand All @@ -10,7 +10,7 @@


def gen_schema(scope: SchemaScope):
"""Generate the specified schema and save it to a file.
"""Generates the specified schema and saves it to a file.
The file is located in docs/docs/schema and is named ``<scope.value>.json``
Expand Down
Loading

0 comments on commit ac9a01c

Please sign in to comment.