Skip to content

Commit ec54cbb

Browse files
Psycojokerhoh
authored andcommitted
feat: add yamlfix
1 parent 7b86ff6 commit ec54cbb

File tree

6 files changed

+22
-39
lines changed

6 files changed

+22
-39
lines changed

.github/dependabot.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
---
12
version: 2
23
updates:
3-
- package-ecosystem: "pip"
4-
directory: "/"
5-
schedule:
6-
interval: "weekly"
4+
- package-ecosystem: "pip"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"

.github/workflows/build-wheels.yml

+4-15
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,62 @@
1+
---
12
name: Build source and wheel packages
2-
33
on:
44
push:
55
branches:
66
- main
77
pull_request:
88
branches:
99
- main
10-
1110
jobs:
1211
build:
1312
strategy:
1413
fail-fast: false
1514
matrix:
1615
os: [macos-13, macos-14, ubuntu-22.04, ubuntu-24.04]
1716
runs-on: ${{ matrix.os }}
18-
1917
steps:
2018
- uses: actions/checkout@v4
21-
2219
- name: Workaround github issue https://github.com/actions/runner-images/issues/7192
2320
if: startsWith(matrix.os, 'ubuntu-')
2421
run: sudo echo RESET grub-efi/install_devices | sudo debconf-communicate grub-pc
25-
2622
- name: Set up Python
2723
if: startsWith(matrix.os, 'macos')
2824
uses: actions/setup-python@v2
2925
with:
3026
python-version: 3.12
31-
3227
- name: Cache dependencies
3328
uses: actions/cache@v4
3429
with:
3530
path: ~/.cache/pip
3631
key: ${{ runner.os }}-build-wheels-${{ hashFiles('pyproject.toml') }}
3732
restore-keys: |
3833
${{ runner.os }}-build-wheels-
39-
4034
- name: Install required system packages for macOS
4135
if: startsWith(matrix.os, 'macos-')
4236
run: |
4337
brew update
4438
brew tap cuber/homebrew-libsecp256k1
4539
brew install libsecp256k1
46-
4740
- name: Install required system packages only for Ubuntu Linux
4841
if: startsWith(matrix.os, 'ubuntu-')
4942
run: |
5043
sudo apt-get update
5144
sudo apt-get -y upgrade
5245
sudo apt-get install -y libsecp256k1-dev
53-
5446
- name: Install Hatch
5547
run: |
5648
python3 -m venv /tmp/venv
5749
/tmp/venv/bin/python3 -m pip install --upgrade hatch
58-
5950
- name: Build source and wheel packages
6051
run: |
6152
/tmp/venv/bin/python3 -m hatch build
62-
6353
- name: Install the Python wheel
6454
run: |
6555
/tmp/venv/bin/python3 -m pip install dist/aleph_sdk_python-*.whl
66-
67-
- name: Install/upgrade `setuptools`
56+
- name: Install `setuptools` on systems where it is missing by default
6857
run: /tmp/venv/bin/python3 -m pip install --upgrade setuptools
69-
58+
if: matrix.os == 'ubuntu-24.04'
7059
- name: Import and use the package
71-
run: |
60+
run: |-
7261
/tmp/venv/bin/python3 -c "import aleph.sdk"
7362
/tmp/venv/bin/python3 -c "from aleph.sdk.chains.ethereum import get_fallback_account; get_fallback_account()"

.github/workflows/code-quality.yml

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,30 @@
1+
---
12
name: Test code quality
2-
33
on:
44
push:
55
pull_request:
66
branches:
77
- main
8-
98
jobs:
109
code-quality:
1110
runs-on: ubuntu-24.04
12-
1311
steps:
1412
- uses: actions/checkout@v4
15-
1613
- name: Workaround github issue https://github.com/actions/runner-images/issues/7192
1714
run: sudo echo RESET grub-efi/install_devices | sudo debconf-communicate grub-pc
18-
1915
- name: Install system dependencies
2016
run: |
2117
sudo apt-get install -y python3-pip libsecp256k1-dev
22-
2318
- name: Cache dependencies
2419
uses: actions/cache@v4
2520
with:
2621
path: ~/.cache/pip
2722
key: ${{ runner.os }}-code-quality-${{ hashFiles('pyproject.toml') }}
2823
restore-keys: |
2924
${{ runner.os }}-code-quality-
30-
3125
- name: Install python dependencies
3226
run: |
3327
python3 -m venv /tmp/venv
3428
/tmp/venv/bin/pip install hatch
35-
3629
- name: Run Hatch lint
3730
run: /tmp/venv/bin/hatch run linting:all

.github/workflows/pr-rating.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1+
---
12
name: PR Difficulty Rating Action
2-
33
permissions:
44
pull-requests: write
5-
65
on:
76
pull_request:
87
types: [opened, reopened, ready_for_review]
9-
108
jobs:
119
difficulty-rating:
1210
runs-on: ubuntu-latest

.github/workflows/pytest.yml

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
---
12
name: Test/Coverage with Python
2-
33
on:
44
push:
55
pull_request:
@@ -10,37 +10,31 @@ on:
1010
# in order to catch when unfrozen dependency updates
1111
# break the use of the library.
1212
- cron: '4 0 * * *'
13-
1413
jobs:
1514
tests:
1615
strategy:
1716
fail-fast: false
1817
matrix:
19-
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
18+
python-version: ["3.9", "3.10", "3.11", "3.12"]
2019
os: [ubuntu-22.04, ubuntu-24.04]
2120
runs-on: ${{ matrix.os }}
22-
2321
steps:
2422
- uses: actions/checkout@v4
2523
- uses: actions/setup-python@v5
2624
with:
2725
python-version: ${{ matrix.python-version }}
28-
2926
- run: |
3027
sudo apt-get update
3128
sudo apt-get install -y python3-pip libsodium-dev
32-
3329
- run: |
3430
python3 -m venv /tmp/venv
3531
/tmp/venv/bin/python -m pip install --upgrade pip hatch coverage
36-
3732
- run: |
3833
/tmp/venv/bin/pip freeze
3934
/tmp/venv/bin/hatch run testing:pip freeze
4035
/tmp/venv/bin/hatch run testing:test
41-
4236
- run: /tmp/venv/bin/hatch run testing:cov
43-
37+
if: matrix.python-version == '3.11'
4438
- uses: codecov/[email protected]
4539
with:
4640
token: ${{ secrets.CODECOV_TOKEN }}

pyproject.toml

+8
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ dependencies = [
154154
"ruff==0.4.8",
155155
"isort==5.13.2",
156156
"pyproject-fmt==2.2.1",
157+
"yamlfix==1.16.1",
157158
]
158159
[tool.hatch.envs.linting.scripts]
159160
typing = "mypy --config-file=pyproject.toml {args:} ./src/ ./tests/ ./examples/"
@@ -162,12 +163,14 @@ style = [
162163
"black --check --diff {args:} ./src/ ./tests/ ./examples/",
163164
"isort --check-only --profile black {args:} ./src/ ./tests/ ./examples/",
164165
"pyproject-fmt --check pyproject.toml",
166+
"yamlfix --check .",
165167
]
166168
fmt = [
167169
"black {args:} ./src/ ./tests/ ./examples/",
168170
"ruff check --fix {args:.} ./src/ ./tests/ ./examples/",
169171
"isort --profile black {args:} ./src/ ./tests/ ./examples/",
170172
"pyproject-fmt pyproject.toml",
173+
"yamlfix .",
171174
"style",
172175
]
173176
all = [
@@ -248,3 +251,8 @@ follow_imports = "silent"
248251
# Miscellaneous strictness flags
249252
# Allows variables to be redefined with an arbitrary type, as long as the redefinition is in the same block and nesting level as the original definition.
250253
allow_redefinition = true
254+
255+
256+
[tool.yamlfix]
257+
sequence_style = "keep_style"
258+
preserve_quotes = true

0 commit comments

Comments
 (0)