Skip to content

Commit cf4a4bf

Browse files
[pre-commit.ci] pre-commit autoupdate (#10)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: S. Co1 <[email protected]>
1 parent c7dbc62 commit cf4a4bf

File tree

9 files changed

+1055
-1311
lines changed

9 files changed

+1055
-1311
lines changed

.bumper.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[tool.bumper]
2+
current_version = "1.0.0"
3+
4+
[[tool.bumper.files]]
5+
file = "./pyproject.toml"
6+
search = 'version = "{current_version}"'
7+
8+
[[tool.bumper.files]]
9+
file = "./README.md"
10+
search = "matplotlib-window/{current_version}"

.bumpversion.cfg

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/lint_test.yml

Lines changed: 51 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,58 +12,83 @@ jobs:
1212
lint:
1313
runs-on: ubuntu-latest
1414

15+
env:
16+
UV_CACHE_DIR: /tmp/.uv-cache
17+
1518
steps:
1619
- uses: actions/checkout@v4
17-
- name: Install Poetry for caching
18-
run: pipx install poetry
20+
21+
- name: Set up uv
22+
run: curl -LsSf https://astral.sh/uv/0.4.30/install.sh | sh
23+
1924
- name: Set up Python
2025
uses: actions/setup-python@v5
2126
with:
22-
python-version: '3.x'
23-
cache: 'poetry'
27+
python-version-file: "pyproject.toml"
28+
29+
- name: Restore uv cache
30+
uses: actions/cache@v4
31+
with:
32+
path: /tmp/.uv-cache
33+
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
34+
restore-keys: |
35+
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
36+
uv-${{ runner.os }}
2437
2538
- name: Install dependencies
26-
run: |
27-
python -m pip install -U pip setuptools importlib-metadata
28-
python -m pip install poetry
29-
poetry install
39+
run: uv sync --all-extras --dev
3040

3141
- name: Run mypy
32-
run: poetry run mypy .
42+
run: uv run mypy .
3343
if: always()
3444

45+
- name: Minimize uv cache
46+
run: uv cache prune --ci
47+
3548
test:
3649
runs-on: ubuntu-latest
3750
strategy:
3851
matrix:
39-
python-version: ["3.11", "3.12", "3.13-dev"]
52+
python-version: ["3.11", "3.12", "3.13"]
4053
fail-fast: false
4154

55+
env:
56+
UV_CACHE_DIR: /tmp/.uv-cache
57+
4258
steps:
4359
- uses: actions/checkout@v4
44-
- name: Install Poetry for caching
45-
run: pipx install poetry
60+
61+
- name: Set up uv
62+
run: curl -LsSf https://astral.sh/uv/0.4.30/install.sh | sh
4663

4764
- name: Set up (release) Python ${{ matrix.python-version }}
4865
uses: actions/setup-python@v5
4966
if: "!endsWith(matrix.python-version, '-dev')"
5067
with:
5168
python-version: ${{ matrix.python-version }}
52-
cache: 'poetry'
5369

5470
- name: Set up (deadsnakes) Python ${{ matrix.python-version }}
5571
uses: deadsnakes/[email protected]
5672
if: endsWith(matrix.python-version, '-dev')
5773
with:
5874
python-version: ${{ matrix.python-version }}
5975

76+
- name: Restore uv cache
77+
uses: actions/cache@v4
78+
with:
79+
path: /tmp/.uv-cache
80+
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
81+
restore-keys: |
82+
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
83+
uv-${{ runner.os }}
84+
6085
- name: Install dependencies
6186
run: |
62-
python -m pip install -U pip setuptools importlib-metadata
63-
pip install tox-gh-actions
87+
uv venv
88+
uv pip install tox-gh-actions tox-uv
6489
6590
- name: Run tests w/tox
66-
run: tox
91+
run: uv run tox
6792

6893
- name: Cache coverage for ${{ matrix.python-version }}
6994
uses: actions/upload-artifact@v4
@@ -73,16 +98,20 @@ jobs:
7398
if-no-files-found: error
7499
include-hidden-files: true
75100

101+
- name: Minimize uv cache
102+
run: uv cache prune --ci
103+
76104
combine-cov:
77105
runs-on: ubuntu-latest
78106
needs: test
79107

80108
steps:
81109
- uses: actions/checkout@v4
110+
82111
- name: Set up Python
83112
uses: actions/setup-python@v5
84113
with:
85-
python-version: '3.x'
114+
python-version-file: "pyproject.toml"
86115

87116
- name: Pull coverage workflow artifacts
88117
uses: actions/download-artifact@v4
@@ -91,17 +120,17 @@ jobs:
91120

92121
- name: Install cov & combine
93122
run: |
94-
pip install coverage
123+
python -m pip install coverage
95124
coverage combine ./cov_cache/**/.coverage
96125
97126
- name: Report coverage
98127
run: |
99-
echo '**Combined Coverage**' >> $GITHUB_STEP_SUMMARY
100-
echo '```' >> $GITHUB_STEP_SUMMARY
101-
coverage report -m --skip-covered >> $GITHUB_STEP_SUMMARY
102-
echo '```' >> $GITHUB_STEP_SUMMARY
103128
coverage html
104129
130+
# Report a markdown version to the action summary
131+
echo '**Combined Coverage**' >> $GITHUB_STEP_SUMMARY
132+
coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
133+
105134
- name: Publish cov HTML
106135
uses: actions/upload-artifact@v4
107136
with:

.github/workflows/pypi_release.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,31 @@ jobs:
88
build:
99
name: Build dist & publish
1010
runs-on: ubuntu-latest
11+
environment:
12+
name: pypi
13+
url: https://pypi.org/p/matplotlib-window
14+
permissions:
15+
contents: write
16+
id-token: write
1117

1218
steps:
1319
- uses: actions/checkout@v4
20+
21+
- name: Set up uv
22+
run: curl -LsSf https://astral.sh/uv/0.4.30/install.sh | sh
23+
1424
- name: Set up Python
1525
uses: actions/setup-python@v5
1626
with:
17-
python-version: '3.x'
27+
python-version-file: "pyproject.toml"
1828

19-
- name: Install build dependencies & build
20-
run: |
21-
python -m pip install --upgrade pip
22-
pip install poetry
23-
poetry build
29+
- name: Build package
30+
run: uvx --from build pyproject-build --installer uv
2431

2532
- name: Publish to PyPI
26-
uses: pypa/gh-action-pypi-publish@release/v1.9
33+
uses: pypa/gh-action-pypi-publish@release/v1.10
2734
with:
28-
user: __token__
29-
password: ${{ secrets.pypi_api_token }}
35+
print-hash: true
3036

3137
- name: Upload wheel to release
3238
env:

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ci:
33

44
repos:
55
- repo: https://github.com/psf/black
6-
rev: 24.8.0
6+
rev: 24.10.0
77
hooks:
88
- id: black
99
- repo: https://github.com/pycqa/isort
@@ -35,6 +35,6 @@ repos:
3535
- id: python-check-blanket-type-ignore
3636
- id: python-use-type-annotations
3737
- repo: https://github.com/astral-sh/ruff-pre-commit
38-
rev: v0.6.9
38+
rev: v0.7.2
3939
hooks:
4040
- id: ruff

0 commit comments

Comments
 (0)