Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace black with ruff #365

Merged
merged 120 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from 103 commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
6df20ce
ci: introduce ruff
sujuka99 Sep 26, 2023
b94737f
ci: exclude snapshots
sujuka99 Sep 26, 2023
0833e1b
ci(ruff): ignore F401 in tests/*/__init__.py
sujuka99 Sep 26, 2023
a4c92a7
ci(ruff): fix order
sujuka99 Sep 26, 2023
c8bd70c
ci(ruff): comment out rules in nursery, remove comment
sujuka99 Sep 26, 2023
c7bb733
ci(ruff): Autofix "D"
sujuka99 Sep 26, 2023
6379c78
ci(ruff): improve comments
sujuka99 Sep 26, 2023
c70873c
ci(ruff-pydocstyle): improve rule selection
sujuka99 Sep 26, 2023
738e21b
ci(ruff): autofix "D"
sujuka99 Sep 26, 2023
11a54a5
chore: fix docstrings flagged by "D"
sujuka99 Sep 26, 2023
53ba27d
ci(ruff-pyupgrade): autofix
sujuka99 Sep 26, 2023
d090ff0
chore: manually fix code flagged by "UP"
sujuka99 Sep 26, 2023
feb6df3
chore: update snapshots
sujuka99 Sep 26, 2023
cc06875
ci(ruff): add rule ignores for "B"
sujuka99 Sep 26, 2023
687f37d
ci(ruff): configure "B"
sujuka99 Sep 26, 2023
1b6e29c
chore: manually fix code flagged by "B"
sujuka99 Sep 26, 2023
1621db1
chore: fix code flagged by "INP"
sujuka99 Sep 26, 2023
d0eefab
chore(ruff): fix code flagged by "BLE"
sujuka99 Sep 26, 2023
301284e
ci(ruff-commas): autofix
sujuka99 Sep 26, 2023
c7b3251
chore(ruff-comprehensions): ignore "C408"
sujuka99 Sep 26, 2023
0c2c7c1
ci(ruff-errmsg): autofix "EM"
sujuka99 Sep 26, 2023
0160c08
ci(ruff-pie): autofix
sujuka99 Sep 26, 2023
dd29e3a
ci(ruff-pie): exclude "PIE804"
sujuka99 Sep 26, 2023
49e9e4a
ci(ruff-pytest): autofix "PT"
sujuka99 Sep 26, 2023
b93c3d8
chore(ruff-pytest): manually fix code flagged by "PT"
sujuka99 Sep 26, 2023
9a8678a
ci(ruff-raise): autofix "RSE"
sujuka99 Sep 26, 2023
f90dd22
ci(ruff-return): autofix "RET"
sujuka99 Sep 26, 2023
68b824b
ci(ruff-simplify): autofix "SIM"
sujuka99 Sep 26, 2023
57fd749
ci(ruff-type-checking): disable "TCH" temporarily
sujuka99 Sep 26, 2023
57d9b50
ci(ruff): remove "ARG"
sujuka99 Sep 26, 2023
4e2dd33
ci(ruff-pathlib): autofix "PTH"
sujuka99 Sep 26, 2023
2d8129e
chore(ruff-pathlib): manually fix code flagged by "PTH"
sujuka99 Sep 26, 2023
07bf0f4
chore(ruff-pygrep): manually fix code flagged by "PGH"
sujuka99 Sep 26, 2023
8664342
ci(ruff-pylint): autofix "PL"
sujuka99 Sep 26, 2023
0d65ea8
ci(ruff): ignore "PLW2901"
sujuka99 Sep 26, 2023
54d4b4e
chore(ruff-pylint): manually fix code flagged by "PL"
sujuka99 Sep 26, 2023
8be0263
ci(ruff-tryceratops): autofix "TRY"
sujuka99 Sep 26, 2023
e73f9ab
chore(ruff-tryceratops): manually fix code flagged by "TRY"
sujuka99 Sep 26, 2023
794c60d
chore(pre-commit): pass pre-commit checks
sujuka99 Sep 26, 2023
d3d430d
Merge remote-tracking branch 'origin/main' into ci/introduce-ruff
sujuka99 Sep 26, 2023
14c3c99
chore: lint
sujuka99 Sep 26, 2023
c272a06
ci(ruff): enable "TCH" partly
sujuka99 Sep 26, 2023
750555f
ci(ruff): enable "TCH002"
sujuka99 Sep 26, 2023
502574b
ci(ruff): configure
sujuka99 Sep 26, 2023
31cd2be
chore: remove leftover file
sujuka99 Sep 26, 2023
9d4a761
ci: update workflow
sujuka99 Sep 26, 2023
25b0c08
chore: pass tests
sujuka99 Sep 26, 2023
0b9f26c
ci(ruff-type-checking): Add "TCH001" with proper config
sujuka99 Sep 27, 2023
bdee94d
style: one-liner
sujuka99 Sep 27, 2023
847d4e9
ci(ruff): Ignore COM812
sujuka99 Sep 27, 2023
5a6c3d1
Revert "ci(ruff-commas): autofix"
sujuka99 Sep 27, 2023
1e03e1a
test: whether matcher works
sujuka99 Sep 27, 2023
2fab625
test: problem checker
sujuka99 Sep 27, 2023
e3b7122
fix: ci
sujuka99 Sep 27, 2023
884445f
ci(ruff): format output as "text" in the CI only
sujuka99 Sep 27, 2023
0eb104d
fix(ruff): pre-commit wrong arg
sujuka99 Sep 27, 2023
47b3377
fix: ruff args in pre-commit
sujuka99 Sep 27, 2023
60a500b
fix(ci): ruff pre-commit hook
sujuka99 Sep 27, 2023
571c43f
ci: attempt to fix
sujuka99 Sep 27, 2023
3283ec0
fix: problem matcher regex
sujuka99 Sep 27, 2023
6622b59
fix: regex problem matchr
sujuka99 Sep 27, 2023
797aec7
ci: only lint once with ruff
sujuka99 Sep 27, 2023
fcfbcaf
chore: lint ci
sujuka99 Sep 27, 2023
049a3db
fix(ci): deduplicate pre-commit run
sujuka99 Sep 27, 2023
5229ff1
ci: always run ruff
sujuka99 Sep 27, 2023
ed8b99d
fix(ci): windows
sujuka99 Sep 27, 2023
4a82df1
chore: lint and format
sujuka99 Sep 27, 2023
966dd85
docs: add ruff badge
sujuka99 Sep 27, 2023
2712048
ci(ruff): configure isort
sujuka99 Sep 28, 2023
22409bf
chore(ruff): remove comment
sujuka99 Sep 28, 2023
b255ea3
tests: rewrite snapshots
sujuka99 Oct 2, 2023
2b6ac1b
ci: better access to python version
sujuka99 Oct 2, 2023
d1aeac5
ci: remove ruff-ci pre-commit hook
sujuka99 Oct 2, 2023
c56ef96
ci: remove repeating repo definitions pre-commit
sujuka99 Oct 2, 2023
a2c5a7f
chore: typing
sujuka99 Oct 2, 2023
e673acc
ci: replace black with ruff
sujuka99 Oct 2, 2023
83d9b46
ci: remove black
sujuka99 Oct 2, 2023
1d7a04b
ci: update ruff
sujuka99 Oct 2, 2023
51ce484
Merge remote-tracking branch 'origin/ci/introduce-ruff' into ci/repla…
sujuka99 Oct 3, 2023
8190be7
ci: format with ruff
sujuka99 Oct 3, 2023
b07517b
Merge remote-tracking branch 'origin/main' into ci/replace-black-with…
sujuka99 Oct 21, 2023
713b6a6
chore: upgrade ruff
sujuka99 Oct 21, 2023
e138200
Merge remote-tracking branch 'origin/main' into ci/replace-black-with…
sujuka99 Oct 25, 2023
e9d351f
chore: update and configure ruff
sujuka99 Oct 25, 2023
93cf92e
ci(ruff): adjust
sujuka99 Oct 25, 2023
43cf454
ci: rename ruff lint hook
sujuka99 Oct 25, 2023
b9076e4
fix: ci
sujuka99 Oct 25, 2023
5974578
docs(dev): python code style
sujuka99 Oct 25, 2023
da136a2
style: mroe accurate order of ruff config
sujuka99 Oct 25, 2023
37e52ed
fix: docs
sujuka99 Oct 25, 2023
f6ff99e
docs: Add repository name
sujuka99 Oct 25, 2023
7e7d5e8
docs: structure, add custom admonition
sujuka99 Oct 25, 2023
9b81cfc
docs: create CONTRIBUTING.md
sujuka99 Oct 25, 2023
12616c0
ci: add script that copies contributing into docs
sujuka99 Oct 25, 2023
033ccad
ci: copy file
sujuka99 Oct 25, 2023
a938bdf
ci(dprint): ignore admonition
sujuka99 Oct 25, 2023
7e3d678
ci: format
sujuka99 Oct 25, 2023
e117d14
fix: generated doc formatting
sujuka99 Oct 25, 2023
d2c2813
docs: reword a sentence
sujuka99 Oct 25, 2023
f84641d
fix: ci
sujuka99 Oct 25, 2023
7f876c4
docs: document autogeneration
sujuka99 Oct 25, 2023
1300b4a
fix: path in generated file header
sujuka99 Oct 25, 2023
ce8afab
fix: EOF
sujuka99 Oct 26, 2023
aa8fbe5
chore: update ruff
sujuka99 Oct 31, 2023
27e5eba
style: feedback
sujuka99 Oct 31, 2023
cdc4ce6
ci(pre-commit): Run ruff only on modified files
sujuka99 Oct 31, 2023
ab52824
feat: make copying func generic, hook to copy changelog
sujuka99 Nov 2, 2023
de1346b
chore: lint and format
sujuka99 Nov 2, 2023
e04819a
refactor: add header by default
sujuka99 Nov 2, 2023
520b888
style: remove 1 newline
sujuka99 Nov 2, 2023
982a433
chore: remove space
sujuka99 Nov 2, 2023
ea75e6f
fix: avoid clash between hook and dprint
sujuka99 Nov 2, 2023
3b31813
fix: don't use binary mode
sujuka99 Nov 2, 2023
48ff29b
fix: newline problem
sujuka99 Nov 2, 2023
31fdf62
fix: copying files
sujuka99 Nov 2, 2023
ea8a49c
refactor: use symbolic links instead of scripts
sujuka99 Nov 2, 2023
dfc5824
chore: delete unused files
sujuka99 Nov 2, 2023
6e1c6ac
ci: change target path for changelog
sujuka99 Nov 2, 2023
c00d519
fix: changelog file path
sujuka99 Nov 3, 2023
bc96e7d
docs: remove leftover text, improve title
sujuka99 Nov 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ jobs:
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
poetry run pre-commit run ruff-lint --all-files --show-diff-on-failure
fi;

- name: Formatting (black)
run: poetry run pre-commit run black --all-files --show-diff-on-failure
- name: Formatting (ruff)
run: poetry run pre-commit run ruff-format --all-files --show-diff-on-failure
raminqaf marked this conversation as resolved.
Show resolved Hide resolved

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

- name: Copy contribution guide into docs
run: poetry run pre-commit run gen-docs-contributing --all-files --show-diff-on-failure

- name: Test
run: poetry run pytest tests

Expand Down
24 changes: 17 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
repos:
- repo: local
hooks:
- id: ruff
name: ruff
- id: ruff-lint
name: ruff-lint
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
- id: ruff-format
name: ruff-format
entry: ruff format .
sujuka99 marked this conversation as resolved.
Show resolved Hide resolved
args: [ --config, pyproject.toml ]
language: system
types_or: [python, pyi]
disrupted marked this conversation as resolved.
Show resolved Hide resolved
types_or: [python]
require_serial: true # run once for all files
exclude: ^tests/.*snapshots/
disrupted marked this conversation as resolved.
Show resolved Hide resolved
pass_filenames: false
- id: pyright
name: pyright
entry: pyright
Expand All @@ -38,13 +39,15 @@ repos:
types: [python]
require_serial: true
exclude: ^tests/.*snapshots/
pass_filenames: false
- id: gen-docs-env-vars
name: gen-docs-env-vars
entry: python hooks/gen_docs/gen_docs_env_vars.py
language: system
types: [python]
require_serial: true
exclude: ^tests/.*snapshots/
pass_filenames: false
- id: gen-docs-components
name: gen-docs-components
entry: python hooks/gen_docs/gen_docs_components.py
Expand All @@ -66,6 +69,13 @@ repos:
| kpops/components/.*\.py
)$
require_serial: true
- id: gen-docs-contributing
name: gen-docs-contributing
entry: python hooks/gen_docs/gen_docs_contributing.py
language: system
types: [python]
require_serial: true
pass_filenames: false
- id: dprint
name: dprint
entry: dprint fmt
Expand Down
41 changes: 41 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Contributions

**Welcome!** We are glad to have you visit our contributibg guide!
sujuka99 marked this conversation as resolved.
Show resolved Hide resolved

If you find any bugs or have suggestions for improvements, please open an [issue](https://github.com/bakdata/kpops/issues/new) and optionally a [pull request (PR)](https://github.com/bakdata/kpops/compare). In the case of a PR, we would appreciate it if you preface it with an issue outlining your goal and means of achieving it.

## Style

We advise that you stick to our `pre-commit` hooks, which you can run with `poetry run pre-commit run -a`. In order for `dprint` to work, you have to manually [install](#markdown) it locally. It will work in the CI, so it is also possible to manually carry out formatting changes flagged by `dprint` in the CI and skip installing it locally.
sujuka99 marked this conversation as resolved.
Show resolved Hide resolved

### Python

To ensure a consistent Python code style, we use [Ruff](https://docs.astral.sh/ruff/) for both linting and formatting.

**Configuration**

Our configuration can be found in [KPOps](https://github.com/bakdata/kpops)' top-level `pyproject.toml`.

**Editor integration**

Below are listed existing Ruff plugins/extensions for some of the most popular python IDEs.

- [VSCode](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff)
- [JetBrains](https://plugins.jetbrains.com/plugin/20574-ruff)

If you cannot find your Editor of choices or you want something more custom, [`ruff-lsp`](https://github.com/astral-sh/ruff-lsp) enables Ruff to be used in any editor that supports the LSP
sujuka99 marked this conversation as resolved.
Show resolved Hide resolved

### Markdown

To ensure a consistent markdown style, we use [dprint](https://dprint.dev)'s [Markdown code formatter](https://dprint.dev/plugins/markdown/).

**Configuration**

Our configuration can be found [here](https://github.com/bakdata/kpops/blob/main/dprint.json).

**Editor integration**

Below are listed existing `dprint` plugins/extensions for some of the most popular python IDEs.

- [VSCode](https://marketplace.visualstudio.com/items?itemName=dprint.dprint)
- [JetBrains](https://plugins.jetbrains.com/plugin/18192-dprint)
sujuka99 marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 4 additions & 0 deletions docs/docs/developer/auto-generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ Generated
- `pipeline-components/*\.yaml` -- All single-component pipeline definitions and one big (complete) `pipeline.yaml` that contains all of them.
- `pipeline-defaults/*\.yaml` -- All single-component defaults definitions and one big (complete) `defaults.yaml` that contains all of them.

#### [Contributing](../developer/contributing.md)

Copied from [`CONTRIBUTING.md`](https://github.com/bakdata/kpops/blob/main/CONTRIBUTING.md)

sujuka99 marked this conversation as resolved.
Show resolved Hide resolved
### [Editor integration](https://github.com/bakdata/kpops/blob/main/hooks/gen_schema.py)

#### [Schemas](https://github.com/bakdata/kpops/tree/main/docs/docs/schema)
Expand Down
43 changes: 43 additions & 0 deletions docs/docs/developer/contributing.md
sujuka99 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!-- This file is autogenerated by hooks/gen_docs/gen_docs_contributing.py. -->

# Contributions

**Welcome!** We are glad to have you visit our contributibg guide!
sujuka99 marked this conversation as resolved.
Show resolved Hide resolved

If you find any bugs or have suggestions for improvements, please open an [issue](https://github.com/bakdata/kpops/issues/new) and optionally a [pull request (PR)](https://github.com/bakdata/kpops/compare). In the case of a PR, we would appreciate it if you preface it with an issue outlining your goal and means of achieving it.

## Style

We advise that you stick to our `pre-commit` hooks, which you can run with `poetry run pre-commit run -a`. In order for `dprint` to work, you have to manually [install](#markdown) it locally. It will work in the CI, so it is also possible to manually carry out formatting changes flagged by `dprint` in the CI and skip installing it locally.

### Python

To ensure a consistent Python code style, we use [Ruff](https://docs.astral.sh/ruff/) for both linting and formatting.

**Configuration**

Our configuration can be found in [KPOps](https://github.com/bakdata/kpops)' top-level `pyproject.toml`.

**Editor integration**

Below are listed existing Ruff plugins/extensions for some of the most popular python IDEs.

- [VSCode](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff)
- [JetBrains](https://plugins.jetbrains.com/plugin/20574-ruff)

If you cannot find your Editor of choices or you want something more custom, [`ruff-lsp`](https://github.com/astral-sh/ruff-lsp) enables Ruff to be used in any editor that supports the LSP

### Markdown

To ensure a consistent markdown style, we use [dprint](https://dprint.dev)'s [Markdown code formatter](https://dprint.dev/plugins/markdown/).

**Configuration**

Our configuration can be found [here](https://github.com/bakdata/kpops/blob/main/dprint.json).

**Editor integration**

Below are listed existing `dprint` plugins/extensions for some of the most popular python IDEs.

- [VSCode](https://marketplace.visualstudio.com/items?itemName=dprint.dprint)
- [JetBrains](https://plugins.jetbrains.com/plugin/18192-dprint)
12 changes: 0 additions & 12 deletions docs/docs/developer/formatting.md

This file was deleted.

12 changes: 12 additions & 0 deletions docs/docs/developer/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Getting started

**Welcome!** We are glad to have you visit our developer guide! If you find any bugs or have suggestions for improvements, please open an [issue](https://github.com/bakdata/kpops/issues/new) and optionally a [pull request (PR)](https://github.com/bakdata/kpops/compare). In the case of a PR, we would appreciate it if you preface it with an issue outlining your goal and means of achieving it.

Find more about our code-style or insights into KPOps' code base here in our developer guide.

<!-- dprint-ignore-start -->

!!! wip "Work in progress"
The developer guide is still under construction. If you have a question left unanswered here, feel free to ask it by opening an issue.

<!-- dprint-ignore-end -->
17 changes: 17 additions & 0 deletions docs/docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

/* Color the links with the primary color */
--md-typeset-a-color: var(--md-primary-fg-color);

--md-admonition-icon--wip: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m13.78 15.3 6 6 2.11-2.16-6-6-2.11 2.16m3.72-5.2c-.39 0-.81-.05-1.14-.19L4.97 21.25l-2.11-2.11 7.41-7.4L8.5 9.96l-.72.7-1.45-1.41v2.86l-.7.7-3.52-3.56.7-.7h2.81l-1.4-1.41 3.56-3.56a2.976 2.976 0 0 1 4.22 0L9.89 5.74l1.41 1.4-.71.71 1.79 1.78 1.82-1.88c-.14-.33-.2-.75-.2-1.12a3.49 3.49 0 0 1 3.5-3.52c.59 0 1.11.14 1.58.42L16.41 6.2l1.5 1.5 2.67-2.67c.28.47.42.97.42 1.6 0 1.92-1.55 3.47-3.5 3.47Z"/></svg>')
raminqaf marked this conversation as resolved.
Show resolved Hide resolved
}

.md-typeset .md-button, .md-button--primary {
Expand All @@ -22,3 +24,18 @@
.md-typeset .md-button:hover, .md-button--primary:hover {
border-color: white;
}

.md-typeset .admonition.wip,
.md-typeset details.wip {
border-color: rgb(160, 45, 0);
}
.md-typeset .wip > .admonition-title,
.md-typeset .wip > summary {
background-color: rgb(255, 195, 172);
}
.md-typeset .wip > .admonition-title::before,
.md-typeset .wip > summary::before {
background-color: rgb(255, 77, 6);
sujuka99 marked this conversation as resolved.
Show resolved Hide resolved
-webkit-mask-image: var(--md-admonition-icon--wip);
mask-image: var(--md-admonition-icon--wip);
}
7 changes: 5 additions & 2 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
site_name: KPOps
repo_url: https://github.com/bakdata/kpops/
site_url: https://bakdata.github.io/kpops/
repo_name: KPOps
repo_url: https://github.com/bakdata/kpops/
remote_branch: gh-pages
copyright: Copyright &copy; 2023 bakdata

Expand Down Expand Up @@ -111,5 +112,7 @@ nav:
- CI integration:
- GitHub Actions: user/references/ci-integration/github-actions.md
- Developer Guide:
- Getting Started: developer/getting-started.md
- Contributing: developer/contributing.md
- Code base:
- Auto generation: developer/auto-generation.md
- Formatting: developer/formatting.md
4 changes: 1 addition & 3 deletions hooks/gen_docs/gen_docs_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,7 @@ def get_sections(component_name: str, *, exist_changes: bool) -> KpopsComponent:
]
component_sections_not_inherited: list[
str
] = DEFAULTS_PIPELINE_COMPONENT_DEPENDENCIES[
component_file_name
] # type: ignore [reportGeneralTypeIssues]
] = DEFAULTS_PIPELINE_COMPONENT_DEPENDENCIES[component_file_name] # type: ignore [reportGeneralTypeIssues]
return KpopsComponent(component_sections, component_sections_not_inherited)


Expand Down
21 changes: 21 additions & 0 deletions hooks/gen_docs/gen_docs_contributing.py
sujuka99 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""Copies ``CONTROBUTING.md`` from root to the docs."""
sujuka99 marked this conversation as resolved.
Show resolved Hide resolved
import shutil
from pathlib import Path
from tempfile import TemporaryFile

KPOPS_ROOT = Path(__file__).parents[2].resolve()
SOURCE = KPOPS_ROOT / "CONTRIBUTING.md"
DEST = KPOPS_ROOT / "docs/docs/developer/contributing.md"
HEADER = f"<!-- This file is autogenerated by {Path(__file__).relative_to(KPOPS_ROOT)}. -->\n\n".encode()

# Copy `CONTRIBUTING.md` into the equivalent file in the docs,
# adding a comment at the top which notes that the file is generated
with (
TemporaryFile() as file_header,
DEST.open("w+b") as file_dest,
SOURCE.open("rb") as file_source,
):
file_header.write(HEADER)
file_header.seek(0)
shutil.copyfileobj(file_header, file_dest)
shutil.copyfileobj(file_source, file_dest)
16 changes: 4 additions & 12 deletions kpops/cli/main.py
sujuka99 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,7 @@ def generate(
return pipeline


@app.command(
help="Deploy pipeline steps"
) # pyright: ignore[reportGeneralTypeIssues] https://github.com/rec/dtyper/issues/8
@app.command(help="Deploy pipeline steps") # pyright: ignore[reportGeneralTypeIssues] https://github.com/rec/dtyper/issues/8
def deploy(
pipeline_path: Path = PIPELINE_PATH_ARG,
components_module: Optional[str] = COMPONENTS_MODULES,
Expand All @@ -296,9 +294,7 @@ def deploy(
component.deploy(dry_run)


@app.command(
help="Destroy pipeline steps"
) # pyright: ignore[reportGeneralTypeIssues] https://github.com/rec/dtyper/issues/8
@app.command(help="Destroy pipeline steps") # pyright: ignore[reportGeneralTypeIssues] https://github.com/rec/dtyper/issues/8
def destroy(
pipeline_path: Path = PIPELINE_PATH_ARG,
components_module: Optional[str] = COMPONENTS_MODULES,
Expand All @@ -320,9 +316,7 @@ def destroy(
component.destroy(dry_run)


@app.command(
help="Reset pipeline steps"
) # pyright: ignore[reportGeneralTypeIssues] https://github.com/rec/dtyper/issues/8
@app.command(help="Reset pipeline steps") # pyright: ignore[reportGeneralTypeIssues] https://github.com/rec/dtyper/issues/8
def reset(
pipeline_path: Path = PIPELINE_PATH_ARG,
components_module: Optional[str] = COMPONENTS_MODULES,
Expand All @@ -345,9 +339,7 @@ def reset(
component.reset(dry_run)


@app.command(
help="Clean pipeline steps"
) # pyright: ignore[reportGeneralTypeIssues] https://github.com/rec/dtyper/issues/8
@app.command(help="Clean pipeline steps") # pyright: ignore[reportGeneralTypeIssues] https://github.com/rec/dtyper/issues/8
def clean(
pipeline_path: Path = PIPELINE_PATH_ARG,
components_module: Optional[str] = COMPONENTS_MODULES,
Expand Down
Loading
Loading