Skip to content

Commit 24d7b3f

Browse files
committed
chore: Use uv, ty, and ruff tools
1 parent d86e917 commit 24d7b3f

File tree

47 files changed

+2507
-508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2507
-508
lines changed

.cspell/dictionary.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ customisation
5454
dkimpy
5555
checkmark
5656
tojson
57+
openxml
5758

5859
# Software Engineering terms
5960
bytesize
@@ -99,3 +100,5 @@ SUBM
99100
# Contributor names
100101
Marek
101102
Suchánek
103+
Kazuki
104+
Yamamoto

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true
7+
8+
[*.py]
9+
indent_style = space
10+
indent_size = 4

.github/workflows/build.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424

2525
steps:
2626
- name: Check out repository
27-
uses: actions/checkout@v4
27+
uses: actions/checkout@v6
2828

2929
- name: Set up Python
30-
uses: actions/setup-python@v5
30+
uses: actions/setup-python@v6
3131
with:
3232
python-version: 3.13
3333
cache: pip
@@ -59,15 +59,17 @@ jobs:
5959
cd packages/${{ matrix.package }}
6060
make verify
6161
62-
- name: Build package sdist
62+
- name: Build package (source distribution)
6363
run: |
6464
cd packages/${{ matrix.package }}
65-
python setup.py sdist
65+
python -m build . --sdist
66+
ls -lah dist/
6667
67-
- name: Build package bdist (wheel)
68+
- name: Build package (wheel)
6869
run: |
6970
cd packages/${{ matrix.package }}
70-
python setup.py bdist_wheel
71+
python -m build . --wheel
72+
ls -lah dist/
7173
7274
- name: Test package
7375
run: |
@@ -96,7 +98,7 @@ jobs:
9698

9799
steps:
98100
- name: Check out repository
99-
uses: actions/checkout@v4
101+
uses: actions/checkout@v6
100102
with:
101103
fetch-depth: 0
102104

@@ -197,6 +199,7 @@ jobs:
197199
lambda-docker:
198200
name: Docker (lambda)
199201
runs-on: ubuntu-latest
202+
needs: [package]
200203

201204
strategy:
202205
fail-fast: false

.github/workflows/code-style.yml

Lines changed: 56 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111

1212
steps:
1313
- name: Check out repository
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v6
1515

1616
- name: Set up Python
17-
uses: actions/setup-python@v5
17+
uses: actions/setup-python@v6
1818
with:
1919
python-version: 3.13
2020
cache: pip
@@ -60,72 +60,14 @@ jobs:
6060
flake8 packages --count --select=E9,F63,F7,F82 --show-source --statistics
6161
flake8 packages --count --max-complexity=12 --max-line-length=130 --statistics
6262
63-
# Typing checks with MyPy
64-
typing:
65-
name: Typing
66-
runs-on: ubuntu-latest
67-
68-
steps:
69-
- name: Check out repository
70-
uses: actions/checkout@v4
71-
72-
- name: Set up Python
73-
uses: actions/setup-python@v5
74-
with:
75-
python-version: 3.13
76-
cache: pip
77-
cache-dependency-path: |
78-
**/pyproject.toml
79-
**/requirements*.txt
80-
81-
- name: Create build info
82-
run: |
83-
bash scripts/build-info.sh
84-
85-
- name: Install MyPy (1.16.1)
86-
run: |
87-
python -m pip install --upgrade pip
88-
pip install mypy==1.16.1
89-
90-
- name: Install dependencies
91-
run: |
92-
ROOT=$(pwd)
93-
for package in $(ls packages); do
94-
echo "-------------------------------------------------"
95-
echo "- $package"
96-
echo "-------------------------------------------------"
97-
cd "$ROOT/packages/$package"
98-
pip install -r requirements.txt
99-
make local-deps
100-
echo "================================================="
101-
done
102-
103-
- name: Install packages
104-
run: |
105-
for package in $(ls packages); do
106-
echo "-------------------------------------------------"
107-
echo "- $package"
108-
echo "-------------------------------------------------"
109-
pip install packages/$package
110-
rm -rf packages/$package/build
111-
echo "================================================="
112-
done
113-
114-
- name: Check typing with MyPy
115-
run: |
116-
mypy --install-types \
117-
--check-untyped-defs \
118-
--non-interactive \
119-
packages/*/dsw
120-
12163
# Consistency of version tagging
12264
version:
12365
name: Version consts.py
12466
runs-on: ubuntu-latest
12567

12668
steps:
12769
- name: Check out repository
128-
uses: actions/checkout@v4
70+
uses: actions/checkout@v6
12971

13072
- name: Check dsw-data-seeder
13173
run: |
@@ -150,18 +92,18 @@ jobs:
15092
bash scripts/check-version.sh \
15193
packages/dsw-tdk/dsw/tdk/consts.py \
15294
packages/dsw-tdk/pyproject.toml
153-
95+
15496
# Pylint
15597
pylint:
15698
name: Pylint
15799
runs-on: ubuntu-latest
158100

159101
steps:
160102
- name: Check out repository
161-
uses: actions/checkout@v4
103+
uses: actions/checkout@v6
162104

163105
- name: Set up Python
164-
uses: actions/setup-python@v5
106+
uses: actions/setup-python@v6
165107
with:
166108
python-version: 3.13
167109
cache: pip
@@ -213,17 +155,16 @@ jobs:
213155

214156
steps:
215157
- name: Check out repository
216-
uses: actions/checkout@v4
158+
uses: actions/checkout@v6
217159

218160
- name: Set up Node.js
219-
uses: actions/setup-node@v4
161+
uses: actions/setup-node@v6
220162
with:
221-
node-version: '22'
163+
node-version: '24'
222164

223165
- name: Install CSpell
224166
run: |
225-
npm install -g cspell
226-
npm install -g @cspell/dict-python
167+
npm install -g cspell @cspell/dict-python
227168
228169
- name: Run CSpell
229170
run: |
@@ -237,3 +178,49 @@ jobs:
237178
packages/**/*.toml \
238179
packages/**/*.yml \
239180
packages/**/*.yaml
181+
182+
# Ruff
183+
ruff:
184+
name: Ruff
185+
runs-on: ubuntu-latest
186+
187+
steps:
188+
- name: Check out repository
189+
uses: actions/checkout@v6
190+
191+
- name: Install uv
192+
uses: astral-sh/setup-uv@v7
193+
194+
- name: Create build info
195+
run: |
196+
bash scripts/build-info.sh
197+
198+
- name: Install the project
199+
run: uv sync --locked --all-extras --all-packages --no-install-project --dev
200+
201+
- name: Run Ruff
202+
run: |
203+
uv run ruff check
204+
205+
# Ty
206+
ty:
207+
name: Ty
208+
runs-on: ubuntu-latest
209+
210+
steps:
211+
- name: Check out repository
212+
uses: actions/checkout@v6
213+
214+
- name: Install uv
215+
uses: astral-sh/setup-uv@v7
216+
217+
- name: Create build info
218+
run: |
219+
bash scripts/build-info.sh
220+
221+
- name: Install the project
222+
run: uv sync --locked --all-extras --all-packages --no-install-project --dev
223+
224+
- name: Run Ruff
225+
run: |
226+
uv run ty check

.github/workflows/lambda.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717

1818
steps:
1919
- name: Check out repository
20-
uses: actions/checkout@v4
20+
uses: actions/checkout@v6
2121

2222
- name: Set up Python
23-
uses: actions/setup-python@v5
23+
uses: actions/setup-python@v6
2424
with:
2525
python-version: 3.13
2626
cache: pip
@@ -73,7 +73,7 @@ jobs:
7373
ZIP: packages/dsw-${{ matrix.package }}/${{ matrix.package }}-lambda.zip
7474

7575
- name: Create artifact
76-
uses: actions/upload-artifact@v4
76+
uses: actions/upload-artifact@v6
7777
with:
7878
name: ${{ matrix.package }}-lambda.zip
7979
path: packages/dsw-${{ matrix.package }}/${{ matrix.package }}-lambda.zip

.github/workflows/release-package.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222

2323
steps:
2424
- name: Check out repository
25-
uses: actions/checkout@v4
25+
uses: actions/checkout@v6
2626

2727
- name: Set up Python
28-
uses: actions/setup-python@v5
28+
uses: actions/setup-python@v6
2929
with:
3030
python-version: 3.13
3131
cache: pip
@@ -73,10 +73,10 @@ jobs:
7373

7474
steps:
7575
- name: Check out repository
76-
uses: actions/checkout@v4
76+
uses: actions/checkout@v6
7777

7878
- name: Set up Python
79-
uses: actions/setup-python@v5
79+
uses: actions/setup-python@v6
8080
with:
8181
python-version: 3.13
8282
cache: pip

.github/workflows/security.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
steps:
2424
- name: Checkout repository
25-
uses: actions/checkout@v4
25+
uses: actions/checkout@v6
2626

2727
- name: Create build info
2828
run: |

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222

2323
steps:
2424
- name: Check out repository
25-
uses: actions/checkout@v4
25+
uses: actions/checkout@v6
2626

2727
- name: Set up Python
28-
uses: actions/setup-python@v5
28+
uses: actions/setup-python@v6
2929
with:
3030
python-version: ${{ matrix.python-version }}
3131
cache: pip

.github/workflows/translations.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010

1111
steps:
1212
- name: Check out repository
13-
uses: actions/checkout@v4
13+
uses: actions/checkout@v6
1414

1515
- name: Set up Python
16-
uses: actions/setup-python@v5
16+
uses: actions/setup-python@v6
1717
with:
1818
python-version: 3.13
1919
cache: pip
@@ -41,7 +41,7 @@ jobs:
4141
make pot
4242
4343
- name: Upload POT files
44-
uses: actions/upload-artifact@v4
44+
uses: actions/upload-artifact@v6
4545
with:
4646
name: mail-pot-files
4747
path: |

packages/dsw-command-queue/dsw/command_queue/command_queue.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import select
77
import signal
88

9-
import func_timeout # type: ignore
9+
import func_timeout
1010
import psycopg
1111
import psycopg.generators
1212
import tenacity
@@ -110,7 +110,7 @@ def run(self):
110110
LOG.info('Preparing to listen to command queue (issuing LISTEN)')
111111
queue_conn = self.db.conn_queue
112112
queue_conn.connection.execute(
113-
query=self.queries.query_listen(),
113+
query=self.queries.query_listen().encode(),
114114
)
115115
queue_conn.listening = True
116116
LOG.info('Listening to notifications in command queue')

0 commit comments

Comments
 (0)