Skip to content

Commit 37cfcab

Browse files
authored
chore: fixed formatting to make linter happy (#31)
1 parent 1ebc9e7 commit 37cfcab

File tree

14 files changed

+194
-210
lines changed

14 files changed

+194
-210
lines changed

.github/workflows/publish.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Publish
23

34
on:
@@ -12,21 +13,20 @@ jobs:
1213
matrix:
1314
python-version: ["3.12"]
1415
steps:
15-
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
16-
- name: Set up Python ${{ matrix.python-version }}
17-
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5
18-
with:
19-
python-version: ${{ matrix.python-version }}
20-
- name: Install publish dependencies
21-
run: |
22-
python -m pip install --upgrade pip
23-
pip install '.[publish]'
24-
- name: Build and test wheel
25-
run: |
26-
rm -rf dist/
27-
python -m build --sdist --wheel .
28-
twine check dist/*
29-
- name: Publish
30-
run: |
31-
twine upload --non-interactive --verbose --username __token__ --password ${{ secrets.PYPI_API_TOKEN }} dist/*
32-
16+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Install publish dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install '.[publish]'
25+
- name: Build and test wheel
26+
run: |
27+
rm -rf dist/
28+
python -m build --sdist --wheel .
29+
twine check dist/*
30+
- name: Publish
31+
run: |
32+
twine upload --non-interactive --verbose --username __token__ --password ${{ secrets.PYPI_API_TOKEN }} dist/*

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ src/beku_stackabletech.egg-info
77
examples/suites/tests/_work
88
# pixi environments
99
.pixi
10-

CHANGELOG.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,20 @@ All notable changes to this project will be documented in this file.
2323

2424
- Replace os fs separator ("/") in test case names with underscore ("_") ([#8])
2525

26-
[#7]: https://github.com/stackabletech/beku.py/pull/7)
27-
[#8]: https://github.com/stackabletech/beku.py/pull/8)
26+
[#7]: https://github.com/stackabletech/beku.py/pull/7
27+
[#8]: https://github.com/stackabletech/beku.py/pull/8
2828

2929
## [0.0.8] - 2023-07-01
3030

31-
- Bugfix: apply multiple patches sequentially to a single test
31+
- Bugfix: apply multiple patches sequentially to a single test ([#6])
3232

33-
[#6]: https://github.com/stackabletech/beku.py/pull/6)
33+
[#6]: https://github.com/stackabletech/beku.py/pull/6
3434

3535
## [0.0.7] - 2023-06-26
3636

3737
- Add support for Kuttl test suites and improve CI ([#4])
3838

39-
[#4]: https://github.com/stackabletech/beku.py/pull/4)
39+
[#4]: https://github.com/stackabletech/beku.py/pull/4
4040

4141
## [0.0.6] - 2023-06-21
4242

beku.nix

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{ python3, runCommand, lib }:
22
let
3-
# I wish there was a better way. If the command fails, it is very hard to see
3+
# I wish there was a better way. If the command fails, it is very hard to see
44
# that the problem is here. Perhaps there is some way to evaluate it in python
55
# and reference __version__ directly?
66
version = builtins.readFile (runCommand "foo" { src = [ ./src ]; } ''
@@ -31,5 +31,3 @@ python3.pkgs.buildPythonApplication {
3131
pyyaml
3232
];
3333
}
34-
35-

examples/suites/tests/templates/kuttl/commons/health.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
import time
66

77
if __name__ == "__main__":
8-
log_level = 'DEBUG'
9-
logging.basicConfig(
10-
level=log_level, format='%(asctime)s %(levelname)s: %(message)s', stream=sys.stdout)
8+
log_level = "DEBUG"
9+
logging.basicConfig(level=log_level, format="%(asctime)s %(levelname)s: %(message)s", stream=sys.stdout)
1110

1211
url = "http://airflow-webserver-default:8080/api/v1/health"
1312
count = 0
@@ -20,17 +19,15 @@
2019
if code == 200:
2120
break
2221
else:
23-
print(
24-
f"Got non 200 status code [{code}], retrying attempt no [{count}] ....")
22+
print(f"Got non 200 status code [{code}], retrying attempt no [{count}] ....")
2523
except requests.exceptions.Timeout:
2624
print(f"Connection timed out, retrying attempt no [{count}] ....")
2725
except requests.ConnectionError as e:
2826
print(f"Connection Error: {str(e)}")
2927
except requests.RequestException as e:
3028
print(f"General Error: {str(e)}")
3129
except Exception as e:
32-
print(
33-
f"General error occurred {str(e)}, retrying attempt no [{count}] ....")
30+
print(f"General error occurred {str(e)}, retrying attempt no [{count}] ....")
3431

3532
# Wait a little bit before retrying
3633
time.sleep(1)

examples/suites/tests/templates/kuttl/commons/metrics.py

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,29 @@ def exception_handler(exception_type, exception, traceback):
1313

1414

1515
def assert_metric(role, metric):
16-
response = requests.get(f'http://airflow-{role}-default:9102/metrics')
17-
assert response.status_code == 200, \
18-
f"Metrics could not be retrieved from the {role}."
19-
assert metric in response.text, \
20-
f"The {role} metrics do not contain the metric {metric}."
16+
response = requests.get(f"http://airflow-{role}-default:9102/metrics")
17+
assert response.status_code == 200, f"Metrics could not be retrieved from the {role}."
18+
assert metric in response.text, f"The {role} metrics do not contain the metric {metric}."
2119

2220

2321
# Trigger a DAG run to create metrics
24-
dag_id = 'example_trigger_target_dag'
25-
dag_conf = {'message': "Hello World"}
22+
dag_id = "example_trigger_target_dag"
23+
dag_conf = {"message": "Hello World"}
2624

27-
rest_url = 'http://airflow-webserver-default:8080/api/v1'
28-
auth = ('airflow', 'airflow')
25+
rest_url = "http://airflow-webserver-default:8080/api/v1"
26+
auth = ("airflow", "airflow")
2927

3028
# allow a few moments for the DAGs to be registered to all roles
3129
time.sleep(10)
3230

33-
response = requests.patch(
34-
f'{rest_url}/dags/{dag_id}', auth=auth, json={'is_paused': False})
35-
response = requests.post(
36-
f'{rest_url}/dags/{dag_id}/dagRuns', auth=auth, json={'conf': dag_conf})
31+
response = requests.patch(f"{rest_url}/dags/{dag_id}", auth=auth, json={"is_paused": False})
32+
response = requests.post(f"{rest_url}/dags/{dag_id}/dagRuns", auth=auth, json={"conf": dag_conf})
3733

3834
assert response.status_code == 200, "DAG run could not be triggered."
3935

4036
# Wait for the metrics to be consumed by the statsd-exporter
4137
time.sleep(4)
4238

43-
assert_metric('scheduler', 'airflow_scheduler_heartbeat')
44-
assert_metric('webserver', 'airflow_task_instance_created_BashOperator')
45-
assert_metric('worker', 'airflow_ti_successes')
39+
assert_metric("scheduler", "airflow_scheduler_heartbeat")
40+
assert_metric("webserver", "airflow_task_instance_created_BashOperator")
41+
assert_metric("worker", "airflow_ti_successes")

examples/suites/tests/templates/kuttl/logging/test_log_aggregation.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
def check_processed_events():
66
response = requests.post(
7-
'http://airflow-vector-aggregator:8686/graphql',
7+
"http://airflow-vector-aggregator:8686/graphql",
88
json={
9-
'query': """
9+
"query": """
1010
{
1111
transforms(first:100) {
1212
nodes {
@@ -20,22 +20,20 @@ def check_processed_events():
2020
}
2121
}
2222
"""
23-
}
23+
},
2424
)
2525

26-
assert response.status_code == 200, \
27-
'Cannot access the API of the vector aggregator.'
26+
assert response.status_code == 200, "Cannot access the API of the vector aggregator."
2827

2928
result = response.json()
3029

31-
transforms = result['data']['transforms']['nodes']
30+
transforms = result["data"]["transforms"]["nodes"]
3231
for transform in transforms:
33-
processedEvents = transform['metrics']['processedEventsTotal']['processedEventsTotal']
34-
componentId = transform['componentId']
35-
assert processedEvents > 0, \
36-
f'No events were processed in "{componentId}".'
32+
processedEvents = transform["metrics"]["processedEventsTotal"]["processedEventsTotal"]
33+
componentId = transform["componentId"]
34+
assert processedEvents > 0, f'No events were processed in "{componentId}".'
3735

3836

39-
if __name__ == '__main__':
37+
if __name__ == "__main__":
4038
check_processed_events()
41-
print('Test successful!')
39+
print("Test successful!")
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
"""Example DAG returning the current date"""
2+
23
from datetime import datetime, timedelta
34

45
from airflow import DAG
56
from airflow.operators.bash import BashOperator
67

78

89
with DAG(
9-
dag_id='date_demo',
10-
schedule_interval='0-59 * * * *',
10+
dag_id="date_demo",
11+
schedule_interval="0-59 * * * *",
1112
start_date=datetime(2021, 1, 1),
1213
catchup=False,
1314
dagrun_timeout=timedelta(minutes=5),
14-
tags=['example'],
15+
tags=["example"],
1516
params={},
1617
) as dag:
17-
1818
run_this = BashOperator(
19-
task_id='run_every_minute',
20-
bash_command='date',
19+
task_id="run_every_minute",
20+
bash_command="date",
2121
)

examples/suites/tests/templates/kuttl/mount-dags-gitsync/date_dag_metrics.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,27 @@ def exception_handler(exception_type, exception, traceback):
1313

1414

1515
def assert_metric(role, metric):
16-
response = requests.get(f'http://airflow-{role}-default:9102/metrics')
17-
assert response.status_code == 200, \
18-
f"Metrics could not be retrieved from the {role}."
19-
assert metric in response.text, \
20-
f"The {role} metrics do not contain the metric {metric}."
16+
response = requests.get(f"http://airflow-{role}-default:9102/metrics")
17+
assert response.status_code == 200, f"Metrics could not be retrieved from the {role}."
18+
assert metric in response.text, f"The {role} metrics do not contain the metric {metric}."
2119

2220

2321
# Trigger a DAG run to create metrics
24-
dag_id = 'date_demo'
22+
dag_id = "date_demo"
2523

26-
rest_url = 'http://airflow-webserver-default:8080/api/v1'
27-
auth = ('airflow', 'airflow')
24+
rest_url = "http://airflow-webserver-default:8080/api/v1"
25+
auth = ("airflow", "airflow")
2826

2927
# allow a few moments for the DAGs to be registered to all roles
3028
time.sleep(10)
3129

32-
response = requests.patch(
33-
f'{rest_url}/dags/{dag_id}', auth=auth, json={'is_paused': False})
34-
response = requests.post(
35-
f'{rest_url}/dags/{dag_id}/dagRuns', auth=auth, json={})
30+
response = requests.patch(f"{rest_url}/dags/{dag_id}", auth=auth, json={"is_paused": False})
31+
response = requests.post(f"{rest_url}/dags/{dag_id}/dagRuns", auth=auth, json={})
3632

3733
assert response.status_code == 200, "DAG run could not be triggered."
3834

3935
# Wait for the metrics to be consumed by the statsd-exporter
4036
time.sleep(4)
4137

42-
assert_metric('scheduler', 'airflow_scheduler_heartbeat')
43-
assert_metric('worker', 'airflow_ti_successes')
38+
assert_metric("scheduler", "airflow_scheduler_heartbeat")
39+
assert_metric("worker", "airflow_ti_successes")

src/beku/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Package entry point."""
2+
23
import sys
34
from .main import main
45

0 commit comments

Comments
 (0)