Skip to content

Commit 3f079ea

Browse files
chore: test pipeline
1 parent 1700081 commit 3f079ea

File tree

6 files changed

+30
-16
lines changed

6 files changed

+30
-16
lines changed

.github/workflows/test.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,46 @@ name: Testing
33
on:
44
pull_request:
55
push:
6-
branch:
7-
- main
6+
branches:
7+
- main
8+
tags:
9+
- "*.*.*"
810

911
jobs:
1012
linting:
1113
runs-on: ubuntu-latest
1214
steps:
13-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v5
1416

15-
- uses: actions/setup-python@v5
17+
- uses: actions/setup-python@v6
1618
with:
17-
python-version: '3.14'
19+
python-version: "3.14"
1820

1921
- uses: actions/cache@v4
2022
with:
2123
path: ~/.cache/pip
2224
key: ${{ runner.os }}-pip
2325
restore-keys: ${{ runner.os }}-pip
2426

25-
- uses: chartboost/ruff-action@v1
26-
with:
27-
args: 'format --check'
27+
- uses: astral-sh/ruff-action@v3
28+
- run: ruff check --fix
29+
- run: ruff format
30+
2831
test:
2932
needs: linting
3033
strategy:
3134
fail-fast: true
3235
matrix:
33-
os: [ "ubuntu-latest", "macos-latest" ]
34-
python-version: [ "3.12" ]
36+
os: ["ubuntu-latest", "macos-latest"]
37+
python-version: ["3.14"]
3538
runs-on: ${{ matrix.os }}
3639
steps:
3740
- name: Check out repository
38-
uses: actions/checkout@v4
41+
uses: actions/checkout@v5
3942

4043
- name: Set up python ${{ matrix.python-version }}
4144
id: setup-python
42-
uses: actions/setup-python@v5
45+
uses: actions/setup-python@v6
4346
with:
4447
python-version: ${{ matrix.python-version }}
4548

src/cloudsnake/cli/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def version_cmd():
3737
)
3838
)
3939

40+
4041
@app.callback()
4142
def entrypoint(
4243
ctx: typer.Context,
@@ -60,7 +61,7 @@ def entrypoint(
6061
),
6162
):
6263
"""
63-
Entry point for the cloudsnake CLI.
64+
Entry point for the cloudsnake CLI.
6465
"""
6566
logger = init_logger(log_level.value)
6667
logger.info("Initializing cloudsnake 🐍☁")

src/cloudsnake/cli/ssm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
EC2_RUNNING_FILTER = "Name=instance-state-name,Values=running"
88

9-
EC2_INSTANCE_SELECTOR_QUERY = "[].{TargetId: InstanceId, Name: Tags[?Key=='Name'].Value | [0]}"
9+
EC2_INSTANCE_SELECTOR_QUERY = (
10+
"[].{TargetId: InstanceId, Name: Tags[?Key=='Name'].Value | [0]}"
11+
)
1012

1113
ssm = typer.Typer(
1214
no_args_is_help=True,

src/cloudsnake/sdk/ec2.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ def describe_ec2_instances(self) -> Any:
3434
if iid:
3535
self.instances[iid] = instance
3636

37-
return jmespath.search(self.query, list(self.instances.values())) if self.query else list(self.instances.values())
37+
return (
38+
jmespath.search(self.query, list(self.instances.values()))
39+
if self.query
40+
else list(self.instances.values())
41+
)
3842

3943
except ClientError as err:
4044
self.log.error(

src/cloudsnake/sdk/session.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ def __init__(self, profile: Optional[str] = None, region: str = "us-east-1"):
1313
self.region = region
1414

1515
if not self.profile:
16-
self.log.warning("No AWS profile provided, falling back to environment defaults")
16+
self.log.warning(
17+
"No AWS profile provided, falling back to environment defaults"
18+
)
1719

1820
self.log.debug(f"SessionWrapper(profile={self.profile}, region={self.region})")
1921

src/cloudsnake/tui.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"green": "#008000",
1515
}
1616

17+
1718
class Tui:
1819
def __init__(self):
1920
"""
@@ -25,6 +26,7 @@ def __init__(self):
2526
self.color_list = list(colors_hex.values())
2627

2728
# Get colors from https://rich.readthedocs.io/en/stable/appendix/colors.html
29+
2830
@staticmethod
2931
def get_instance_names(data):
3032
return [f"{item['Name']} ({item['TargetId']})" for item in data]

0 commit comments

Comments
 (0)