8000 ci(format): update isort, pyink for use within uv · d33bs/adk-python@79a472c · GitHub
[go: up one dir, main page]

Skip to content

Commit 79a472c

Browse files
committed
ci(format): update isort, pyink for use within uv
1 parent c04adaa commit 79a472c

File tree

4 files changed

+7377
-28
lines changed

4 files changed

+7377
-28
lines changed

.github/workflows/isort.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ jobs:
3535
with:
3636
python-version: '3.x'
3737

38-
- name: Install isort
39-
run: |
40-
pip install isort
38+
- name: Install uv
39+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
4140

4241
- name: Run isort on changed files
4342
id: run_isort
@@ -52,15 +51,15 @@ jobs:
5251
5352
# Run isort --check
5453
set +e
55-
isort --check $CHANGED_FILES
54+
uv run isort --check $CHANGED_FILES
5655
RESULT=$?
5756
set -e
5857
if [ $RESULT -ne 0 ]; then
5958
echo ""
6059
echo "❌ isort check failed!"
6160
echo "👉 To fix import order, run locally:"
6261
echo ""
63-
echo " isort $FORMATTED_FILES"
62+
echo " uv run isort $FORMATTED_FILES"
6463
echo ""
6564
exit $RESULT
6665
fi

.github/workflows/pyink.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ jobs:
3535
with:
3636
python-version: '3.x'
3737

38-
- name: Install pyink
39-
run: |
40-
pip install pyink
38+
- name: Install uv
39+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
4140

4241
- name: Run pyink on changed files
4342
id: run_pyink
@@ -52,15 +51,15 @@ jobs:
5251
5352
# Run pyink --check
5453
set +e
55-
pyink --check --diff --config pyproject.toml $CHANGED_FILES
54+
uv run pyink --check --diff --config pyproject.toml $CHANGED_FILES
5655
RESULT=$?
5756
set -e
5857
if [ $RESULT -ne 0 ]; then
5958
echo ""
6059
echo "❌ Pyink formatting check failed!"
6160
echo "👉 To fix formatting, run locally:"
6261
echo ""
63-
echo " pyink --config pyproject.toml $FORMATTED_FILES"
62+
echo " uv run pyink --config pyproject.toml $FORMATTED_FILES"
6463
echo ""
6564
exit $RESULT
6665
fi

autoformat.sh

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,53 +15,41 @@
1515

1616
# Autoformat ADK codebase.
1717

18-
if ! command -v isort & 8000 > /dev/null
19-
then
20-
echo "isort not found, refer to CONTRIBUTING.md to set up dev environment first."
21-
exit
22-
fi
23-
24-
if ! command -v pyink &> /dev/null
25-
then
26-
echo "pyink not found, refer to CONTRIBUTING.md to set up dev environment first."
27-
exit
28-
fi
29-
3018
echo '---------------------------------------'
3119
echo '| Organizing imports for src/...'
3220
echo '---------------------------------------'
3321

34-
isort src/
22+
uv run isort src/
3523
echo 'All done! ✨ 🍰 ✨'
3624

3725
echo '---------------------------------------'
3826
echo '| Organizing imports for tests/...'
3927
echo '---------------------------------------'
4028

41-
isort tests/
29+
uv run isort tests/
4230
echo 'All done! ✨ 🍰 ✨'
4331

4432
echo '---------------------------------------'
4533
echo '| Organizing imports for contributing/...'
4634
echo '---------------------------------------'
4735

48-
isort contributing/
36+
uv run isort contributing/
4937
echo 'All done! ✨ 🍰 ✨'
5038

5139
echo '---------------------------------------'
5240
echo '| Auto-formatting src/...'
5341
echo '---------------------------------------'
5442

55-
find -L src/ -type f -name "*.py" -exec pyink --config pyproject.toml {} +
43+
find -L src/ -type f -name "*.py" -exec uv run pyink --config pyproject.toml {} +
5644

5745
echo '---------------------------------------'
5846
echo '| Auto-formatting tests/...'
5947
echo '---------------------------------------'
6048

61-
find -L tests/ -type f -name "*.py" -exec pyink --config pyproject.toml {} +
49+
find -L tests/ -type f -name "*.py" -exec uv run pyink --config pyproject.toml {} +
6250

6351
echo '---------------------------------------'
6452
echo '| Auto-formatting contributing/...'
6553
echo '---------------------------------------'
6654

67-
find -L contributing/ -type f -name "*.py" -exec pyink --config pyproject.toml {} +
55+
find -L contributing/ -type f -name "*.py" -exec uv run pyink --config pyproject.toml {} +

0 commit comments

Comments
 (0)
0