Skip to content

Commit b67ae44

Browse files
Thomas Rabaixrande
authored andcommitted
fix(import): fix import usage
1 parent f95156b commit b67ae44

File tree

4 files changed

+85
-39
lines changed

4 files changed

+85
-39
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,35 @@ jobs:
2323
with:
2424
python-version: ${{ matrix.python-version }}
2525

26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v4
28+
with:
29+
enable-cache: true
30+
cache-dependency-glob: "pyproject.toml"
31+
2632
- name: Install dependencies
2733
run: |
28-
python -m pip install --upgrade pip
29-
pip install -e ".[dev]"
30-
pip install sphinx
34+
uv sync --extra dev
35+
uv pip install sphinx
3136
3237
3338
- name: Run linting (flake8)
3439
run: |
35-
make lint
40+
uv run make lint
3641
3742
- name: Run core tests
3843
run: |
3944
# Run core tests only (excluding extra modules)
40-
python -m unittest discover -s tests -p "test_*.py" -v | grep -v "extra\." || true
45+
uv run python -m unittest discover -s tests -p "test_*.py" -v | grep -v "extra\." || true
4146
4247
- name: Run tests without mypy
4348
run: |
4449
# Run make test but ignore mypy failures
45-
flake8 ioc/ tests/
46-
python -m unittest discover -s tests -p "test_*.py" 2>&1 | grep -v "extra\." || echo "Some tests may require optional dependencies"
47-
sphinx-build -nW -b html -d docs/_build/doctrees docs docs/_build/html || true
50+
uv run flake8 ioc/ tests/
51+
uv run python -m unittest discover -s tests -p "test_*.py" 2>&1 | grep -v "extra\." || echo "Some tests may require optional dependencies"
52+
uv run sphinx-build -nW -b html -d docs/_build/doctrees docs docs/_build/html || true
4853
4954
- name: Run tests with type checking (optional)
5055
run: |
51-
make test-strict || echo "Type checking found issues (this is optional)"
56+
uv run make test-strict || echo "Type checking found issues (this is optional)"
5257
continue-on-error: true

.github/workflows/release.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,21 @@ jobs:
2323
with:
2424
python-version: '3.11'
2525

26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v4
28+
with:
29+
enable-cache: true
30+
cache-dependency-glob: "pyproject.toml"
31+
2632
- name: Install build dependencies
2733
run: |
28-
python -m pip install --upgrade pip
29-
pip install build twine
34+
uv pip install build twine
3035
3136
- name: Build package
3237
run: |
33-
python -m build
38+
uv run python -m build
3439
3540
- name: Check package
3641
run: |
37-
twine check dist/*
42+
uv run twine check dist/*
3843

.github/workflows/test-matrix.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,27 @@ jobs:
3030
with:
3131
python-version: ${{ matrix.python-version }}
3232

33+
- name: Install uv
34+
uses: astral-sh/setup-uv@v4
35+
with:
36+
enable-cache: true
37+
cache-dependency-glob: "pyproject.toml"
38+
3339
- name: Install core dependencies
3440
run: |
35-
python -m pip install --upgrade pip
36-
pip install -e .
41+
uv sync
3742
3843
- name: Run core tests
3944
run: |
40-
python -m unittest discover -s tests/ioc_test -p "test_*.py" -v
45+
uv run python -m unittest discover -s tests/ioc_test -p "test_*.py" -v
4146
4247
- name: Install dev dependencies
4348
run: |
44-
pip install -e ".[dev]"
49+
uv sync --extra dev
4550
4651
- name: Run linting
4752
run: |
48-
flake8 ioc/ tests/
53+
uv run flake8 ioc/ tests/
4954
5055
- name: Summary
5156
if: always()

.github/workflows/tests.yml

Lines changed: 52 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,23 @@ jobs:
2121
with:
2222
python-version: ${{ matrix.python-version }}
2323

24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v4
26+
with:
27+
enable-cache: true
28+
cache-dependency-glob: "pyproject.toml"
29+
2430
- name: Install dependencies
2531
run: |
26-
python -m pip install --upgrade pip
27-
pip install -e ".[dev]"
32+
uv sync --extra dev
2833
2934
- name: Run flake8
3035
run: |
31-
flake8 ioc/ tests/
36+
uv run flake8 ioc/ tests/
3237
3338
- name: Run mypy (optional)
3439
run: |
35-
mypy ioc/ || true
40+
uv run mypy ioc/ || true
3641
continue-on-error: true
3742

3843
test-core:
@@ -49,15 +54,20 @@ jobs:
4954
with:
5055
python-version: ${{ matrix.python-version }}
5156

57+
- name: Install uv
58+
uses: astral-sh/setup-uv@v4
59+
with:
60+
enable-cache: true
61+
cache-dependency-glob: "pyproject.toml"
62+
5263
- name: Install core dependencies
5364
run: |
54-
python -m pip install --upgrade pip
55-
pip install -e .
65+
uv sync
5666
5767
- name: Run core tests (excluding extras)
5868
run: |
5969
# Run only core tests, excluding extra package tests
60-
python -m unittest discover -s tests -p "test_*.py" -v 2>&1 | grep -v "extra\." | tee test_output.txt
70+
uv run python -m unittest discover -s tests -p "test_*.py" -v 2>&1 | grep -v "extra\." | tee test_output.txt
6171
6272
# Check results
6373
if grep -q "FAILED" test_output.txt; then
@@ -86,10 +96,15 @@ jobs:
8696
with:
8797
python-version: ${{ matrix.python-version }}
8898

99+
- name: Install uv
100+
uses: astral-sh/setup-uv@v4
101+
with:
102+
enable-cache: true
103+
cache-dependency-glob: "pyproject.toml"
104+
89105
- name: Install dependencies with ${{ matrix.extras }}
90106
run: |
91-
python -m pip install --upgrade pip
92-
pip install -e ".[${{ matrix.extras }}]"
107+
uv sync --extra ${{ matrix.extras }}
93108
94109
- name: Check if extras tests exist and dependencies are available
95110
id: check_tests
@@ -132,7 +147,7 @@ jobs:
132147
- name: Run tests for ${{ matrix.extras }}
133148
if: steps.check_tests.outputs.should_run == 'true'
134149
run: |
135-
python -m unittest discover -s $(echo "${{ matrix.test_module }}" | tr '.' '/') -p "test_*.py" -v
150+
uv run python -m unittest discover -s $(echo "${{ matrix.test_module }}" | tr '.' '/') -p "test_*.py" -v
136151
continue-on-error: true
137152

138153
test-all-extras:
@@ -149,10 +164,15 @@ jobs:
149164
with:
150165
python-version: ${{ matrix.python-version }}
151166

167+
- name: Install uv
168+
uses: astral-sh/setup-uv@v4
169+
with:
170+
enable-cache: true
171+
cache-dependency-glob: "pyproject.toml"
172+
152173
- name: Install all dependencies
153174
run: |
154-
python -m pip install --upgrade pip
155-
pip install -e ".[flask,jinja2,redis,dev]"
175+
uv sync --extra flask --extra jinja2 --extra redis --extra dev
156176
157177
- name: Create smart test runner
158178
run: |
@@ -222,7 +242,7 @@ jobs:
222242
223243
- name: Run all tests with smart error handling
224244
run: |
225-
python smart_test_runner.py
245+
uv run python smart_test_runner.py
226246
227247
docs:
228248
runs-on: ubuntu-latest
@@ -235,15 +255,20 @@ jobs:
235255
with:
236256
python-version: '3.11'
237257

258+
- name: Install uv
259+
uses: astral-sh/setup-uv@v4
260+
with:
261+
enable-cache: true
262+
cache-dependency-glob: "pyproject.toml"
263+
238264
- name: Install dependencies
239265
run: |
240-
python -m pip install --upgrade pip
241-
pip install -e .
242-
pip install sphinx
266+
uv sync
267+
uv pip install sphinx
243268
244269
- name: Build documentation
245270
run: |
246-
sphinx-build -nW -b html -d docs/_build/doctrees docs docs/_build/html
271+
uv run sphinx-build -nW -b html -d docs/_build/doctrees docs docs/_build/html
247272
248273
- name: Upload documentation artifacts
249274
uses: actions/upload-artifact@v4
@@ -263,15 +288,21 @@ jobs:
263288
with:
264289
python-version: '3.11'
265290

291+
- name: Install uv
292+
uses: astral-sh/setup-uv@v4
293+
with:
294+
enable-cache: true
295+
cache-dependency-glob: "pyproject.toml"
296+
266297
- name: Install build dependencies
267298
run: |
268-
python -m pip install --upgrade pip
269-
pip install build twine
299+
uv sync
300+
uv pip install build twine
270301
271302
- name: Build package
272303
run: |
273-
python -m build
304+
uv run python -m build
274305
275306
- name: Check package
276307
run: |
277-
twine check dist/*
308+
uv run twine check dist/*

0 commit comments

Comments
 (0)