Skip to content

Commit fb136d2

Browse files
committed
add uv preset
1 parent a0bcc1c commit fb136d2

File tree

9 files changed

+111
-62
lines changed

9 files changed

+111
-62
lines changed

.github/workflows/lint.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,13 @@ on:
44
workflow_call:
55

66
jobs:
7-
lint-and-typecheck:
7+
lint:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v3
11-
- name: Set up Python
12-
uses: actions/setup-python@v4
10+
- uses: actions/checkout@v4
11+
- uses: extractions/setup-just@v2
12+
- uses: astral-sh/setup-uv@v5
1313
with:
14-
python-version: "3.12"
15-
- name: Install dependencies
16-
run: |
17-
python -m pip install --upgrade pip
18-
pip install pre-commit
19-
- name: Run pre-commit
20-
uses: pre-commit/action@v3.0.0
21-
with:
22-
extra_args: --all-files --hook-stage manual
14+
cache-dependency-glob: "**/pyproject.toml"
15+
- run: uv python install 3.10
16+
- run: just install lint-ci

.github/workflows/lint_with_just.yml renamed to .github/workflows/lint_poetry.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ jobs:
1212
uses: actions/setup-python@v4
1313
with:
1414
python-version: "3.12"
15-
- uses: extractions/setup-just@v2
16-
- name: Install Poetry
17-
uses: abatilo/actions-poetry@v2.3.0
15+
- name: Install dependencies
16+
run: |
17+
python -m pip install --upgrade pip
18+
pip install pre-commit
19+
- name: Run pre-commit
20+
uses: pre-commit/action@v3.0.0
1821
with:
19-
poetry-version: "1.8.3"
20-
- run: just install lint-ci
22+
extra_args: --all-files --hook-stage manual

.github/workflows/preset.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ on:
77
jobs:
88
lint-and-typecheck:
99
if: github.event_name == 'push' || github.event_name == 'pull_request'
10-
uses: community-of-python/community-workflow/.github/workflows/lint.yml@main
10+
uses: community-of-python/community-workflow/.github/workflows/lint_poetry.yml@main
1111
secrets: inherit
1212

1313
test-and-coverage:
1414
if: github.event_name == 'push' || github.event_name == 'pull_request'
15-
uses: community-of-python/community-workflow/.github/workflows/test.yml@main
15+
uses: community-of-python/community-workflow/.github/workflows/test_poetry.yml@main
1616
secrets: inherit
1717

1818
publish:
1919
if: github.event_name == 'release' && github.event.action == 'published'
20-
uses: community-of-python/community-workflow/.github/workflows/publish.yml@main
21-
secrets: inherit
20+
uses: community-of-python/community-workflow/.github/workflows/publish_poetry.yml@main
21+
secrets: inherit

.github/workflows/preset_with_just.yml renamed to .github/workflows/preset_uv.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ on:
55
workflow_call:
66

77
jobs:
8-
lint-and-typecheck:
8+
lint:
99
if: github.event_name == 'push' || github.event_name == 'pull_request'
10-
uses: community-of-python/community-workflow/.github/workflows/lint_with_just.yml@main
10+
uses: community-of-python/community-workflow/.github/workflows/lint.yml
1111
secrets: inherit
1212

13-
test-and-coverage:
13+
test:
1414
if: github.event_name == 'push' || github.event_name == 'pull_request'
15-
uses: community-of-python/community-workflow/.github/workflows/test.yml@main
15+
uses: community-of-python/community-workflow/.github/workflows/test.yml
1616
secrets: inherit
1717

1818
publish:
1919
if: github.event_name == 'release' && github.event.action == 'published'
20-
uses: community-of-python/community-workflow/.github/workflows/publish.yml@main
21-
secrets: inherit
20+
uses: community-of-python/community-workflow/.github/workflows/publish.yml
21+
secrets: inherit
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Publish
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-python@v5
12+
with:
13+
python-version: "3.12"
14+
- uses: actions/cache@v4
15+
with:
16+
path: |
17+
~/.cache/pip
18+
~/.cache/poetry
19+
key: publish-${{ hashFiles('pyproject.toml') }}
20+
- run: pip install -U poetry==1.8.5
21+
- uses: extractions/setup-just@v2
22+
- run: poetry install --all-extras --without dev
23+
- run: poetry version ${{ github.event.release.tag_name }}
24+
- run: poetry publish --build --username __token__ --password ${{ secrets.PYPI_TOKEN }}
25+
- run: set +x

.github/workflows/publish.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,10 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v4
11-
- uses: actions/setup-python@v5
12-
with:
13-
python-version: "3.12"
14-
- uses: actions/cache@v4
15-
with:
16-
path: |
17-
~/.cache/pip
18-
~/.cache/poetry
19-
key: publish-${{ hashFiles('pyproject.toml') }}
20-
- run: pip install -U poetry==1.8.5
2111
- uses: extractions/setup-just@v2
22-
- run: poetry install --all-extras --without dev
23-
- run: poetry version ${{ github.event.release.tag_name }}
24-
- run: poetry publish --build --username __token__ --password ${{ secrets.PYPI_TOKEN }}
25-
- run: set +x
12+
- uses: astral-sh/setup-uv@v5
13+
with:
14+
cache-dependency-glob: "**/pyproject.toml"
15+
- run: just publish
16+
env:
17+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

.github/workflows/test.yml

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,27 @@ on:
66
jobs:
77
test:
88
name: ${{matrix.os}}-${{matrix.python-version}}
9+
runs-on: ${{ matrix.os }}
910
strategy:
11+
fail-fast: false
1012
matrix:
11-
python-version: ["3.9", "3.10", "3.11", "3.12"]
13+
python-version:
14+
- "3.9"
15+
- "3.10"
16+
- "3.11"
17+
- "3.12"
18+
- "3.13"
1219
os: [ubuntu-latest, macos-latest, windows-latest]
13-
runs-on: ${{ matrix.os }}
1420
steps:
15-
- name: Checkout repository
16-
uses: actions/checkout@v3
17-
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v4
19-
with:
20-
python-version: ${{ matrix.python-version }}
21-
- name: Install Poetry
22-
uses: abatilo/actions-poetry@v2.3.0
21+
- uses: actions/checkout@v4
22+
- uses: extractions/setup-just@v2
23+
- uses: astral-sh/setup-uv@v5
2324
with:
24-
poetry-version: "1.8.3"
25-
- name: Install dependencies with Poetry
26-
run: |
27-
poetry config virtualenvs.create false
28-
poetry install --all-extras --with dev
29-
- name: Run tests with coverage
30-
run: |
31-
pytest . --cov=. --cov-report xml -n 4
32-
- name: Upload coverage to Codecov
33-
uses: codecov/codecov-action@v4.0.1
25+
cache-dependency-glob: "**/pyproject.toml"
26+
- run: uv python install ${{ matrix.python-version }}
27+
- run: just install
28+
- run: just test . --cov=. --cov-report xml
29+
- uses: codecov/codecov-action@v4.0.1
3430
env:
3531
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3632
with:

.github/workflows/test_poetry.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Test and Coverage
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
test:
8+
name: ${{matrix.os}}-${{matrix.python-version}}
9+
strategy:
10+
matrix:
11+
python-version: ["3.9", "3.10", "3.11", "3.12"]
12+
os: [ubuntu-latest, macos-latest, windows-latest]
13+
runs-on: ${{ matrix.os }}
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Install Poetry
22+
uses: abatilo/actions-poetry@v2.3.0
23+
with:
24+
poetry-version: "1.8.3"
25+
- name: Install dependencies with Poetry
26+
run: |
27+
poetry config virtualenvs.create false
28+
poetry install --all-extras --with dev
29+
- name: Run tests with coverage
30+
run: |
31+
pytest . --cov=. --cov-report xml -n 4
32+
- name: Upload coverage to Codecov
33+
uses: codecov/codecov-action@v4.0.1
34+
env:
35+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
36+
with:
37+
files: ./coverage.xml
38+
flags: unittests
39+
name: codecov-${{ matrix.python-version }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

0 commit comments

Comments
 (0)