Skip to content

Commit b0dbc59

Browse files
committed
🚧 chore: modernize toolchain and test harness
1 parent eeb58d7 commit b0dbc59

31 files changed

+666
-1024
lines changed

.github/scripts/release-build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ for f in "$root/README.md" "$root/osc_sdk_python/VERSION"; do
3333
git add "$f"
3434
done
3535

36+
uv version $(cat VERSION)
37+
3638
# Setup git && commit
3739
git config user.name "Outscale Bot"
3840
git config user.email "[email protected]"

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
runs-on: ubuntu-24.04
1313
steps:
1414
- uses: actions/checkout@v5
15-
- name: ⬇️ Install Python
16-
uses: actions/setup-python@v6
17-
with:
18-
python-version: '3.x'
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v6
17+
- name: Set up Python
18+
run: uv python install
1919
- name: Initialize submodules
2020
run: make init
2121
- name: Build release

.github/workflows/code-check-identified.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@ jobs:
2323
uses: actions/checkout@v5
2424
- name: ⬇️ Import Outscale API description
2525
run: make init
26-
- name: ⬇️ Install Python
27-
uses: actions/setup-python@v6
28-
with:
29-
python-version: '3.x'
30-
- name: ⬇️ Install Python dependencies
31-
run: make .venv/ok
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v6
28+
- name: Set up Python
29+
run: uv python install
3230
- name: ⬇️ Build python package
3331
run: make package
3432
- name: 🧪 Run integration tests

.github/workflows/code-check.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,11 @@ jobs:
1212
- uses: actions/checkout@v5
1313
- name: Import Outscale API description
1414
run: make init
15-
- name: Install Python
16-
uses: actions/setup-python@v6
17-
with:
18-
python-version: '3.x'
19-
- name: Install Python dependencies
20-
run: make .venv/ok
21-
- name: Analysing the code with pylint
22-
run: make test-pylint
23-
- name: Security check - Bandit
24-
run: make test-bandit
25-
- name: Build python package
26-
run: make package
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v6
17+
- name: Set up Python
18+
run: uv python install
19+
- name: Analysing the code
20+
run: make test-lint
2721
- name: Run integration tests
2822
run: ./local-tests.sh

.github/workflows/publish.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ jobs:
1414
environment: publish
1515
steps:
1616
- uses: actions/checkout@v5
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v6
1719
- name: Set up Python
18-
uses: actions/setup-python@v6
19-
with:
20-
python-version: '3.x'
21-
- name: Initialize submodules
22-
run: make init
23-
- name: Build packages
24-
run: make package
25-
- uses: pypa/gh-action-pypi-publish@release/v1
20+
run: uv python install
21+
- name: Check Code
22+
run: make test
23+
- name: Build & Push packages
24+
run: make upload-package
25+
env:
26+
UV_PUBLISH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Makefile

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,30 @@ help:
55
@echo "Available targets:"
66
@echo "- package: build python package"
77
@echo "- test: run all tests"
8-
@echo "- test-pylint: check code with pylint"
9-
@echo "- test-bandit: security check with bandit"
8+
@echo "- test-lint: check code with pylint"
109
@echo "- test-int: run integration tests"
1110
@echo "- osc-api-update: update to last osc-api version"
1211
@echo "- clean: clean temp files, venv, etc"
1312

1413
.PHONY: test
15-
test: clean test-pylint test-bandit test-int package
14+
test: clean test-lint test-int package
1615
@echo "All tests: OK"
1716

18-
.PHONY: test-pylint
19-
test-pylint: .venv/ok
20-
@./scripts/test_pylint.sh
21-
22-
.PHONY: test-bandit
23-
test-bandit: .venv/ok
24-
@./scripts/test_bandit.sh
17+
.PHONY: test-lint
18+
test-lint:
19+
@uv tool run ruff check
2520

2621
.PHONY: test-int
27-
test-int: .venv/ok init
28-
./scripts/test_int.sh
22+
test-int: init
23+
@uv run pytest -s
2924

3025
.PHONY: package
31-
package: .venv/ok init
32-
@./scripts/package.sh
26+
package: init
27+
@uv build
28+
29+
.PHONY: upload-package
30+
upload-package: package
31+
@uv publish --trusted-publishing=always
3332

3433
.PHONY: osc-api-update
3534
osc-api-update:
@@ -42,9 +41,6 @@ init: osc_sdk_python/osc-api/outscale.yaml
4241
osc_sdk_python/osc-api/outscale.yaml:
4342
git submodule update --init .
4443

45-
.venv/ok:
46-
@./scripts/setup_venv.sh
47-
4844
.PHONY: clean
4945
clean:
5046
@echo cleaning...

0 commit comments

Comments
 (0)