Skip to content

Commit cb78116

Browse files
committed
wip
1 parent 0b88797 commit cb78116

File tree

2 files changed

+21
-42
lines changed

2 files changed

+21
-42
lines changed

.github/actions/setup-test-env/action.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ inputs:
88
python-version:
99
description: Python version for actions/setup-python
1010
required: true
11+
default: '3.12'
1112
install-winfsp:
1213
description: Whether to install WinFsp and Cygwin FUSE compatibility layer
1314
required: false
@@ -66,6 +67,11 @@ runs:
6667
- name: Set up uv
6768
uses: astral-sh/setup-uv@v6
6869

70+
- name: Configure uv package age policy
71+
shell: bash
72+
run: |
73+
echo "UV_EXCLUDE_NEWER=7 days" >> "$GITHUB_ENV"
74+
6975
- uses: msys2/setup-msys2@v2
7076
if: ${{ startsWith(inputs.os, 'windows') }}
7177
with:
@@ -123,14 +129,8 @@ runs:
123129
shell: bash
124130
run: |
125131
# https://news.ycombinator.com/item?id=47547405
126-
# Would be nice to limit to "tested" packages, but the current solution is not cross-platform:
127-
# --uploaded-prior-to="$(date -u -d '3 days ago' '+%Y-%m-%dT%H:%M:%SZ')"
128-
# We will have to wait for pip 26.1 for --uploaded-prior-to=P7D
129-
uv pip install --system --upgrade pip
130132
# Still needed for building lzmaffi without build isolation
131-
uv pip install --system --upgrade wheel
132-
uv pip install --system --upgrade setuptools
133-
uv pip install --system --upgrade-strategy eager --upgrade twine build cffi
133+
uv pip install --system --upgrade wheel setuptools twine build cffi
134134
135135
- name: Install Custom libFUSE
136136
if: ${{ startsWith(inputs.os, 'ubuntu') && inputs.libfuse-version != 'system' }}

.github/workflows/tests.yml

Lines changed: 14 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,26 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818

19-
- name: Set up Python
20-
uses: actions/setup-python@v5
21-
with:
22-
python-version: '3.12'
23-
cache: 'pip'
24-
25-
- name: Set up uv
26-
uses: astral-sh/setup-uv@v6
27-
28-
- name: Install Dependencies
29-
uses: awalsh128/cache-apt-pkgs-action@v1.4.3
19+
- name: Setup Shared Test Environment
20+
uses: ./.github/actions/setup-test-env
3021
with:
31-
packages: 'liblzo2-dev shellcheck'
22+
os: ${{ matrix.os }}
23+
python-version: 3.14
24+
linux-packages: 'liblzo2-dev shellcheck'
3225

3326
- name: Install pip Dependencies
3427
run: |
35-
uv pip install --system --upgrade pip
36-
uv pip install --system pytest fsspec
28+
uv pip install --system pytest fsspec ruff~=0.14 black~=26.0 codespell flake8 pylint mypy
3729
( cd core && uv pip install --system .[full,ext4,fsspec,sqlar] )
3830
uv pip install --system .
3931
4032
- name: Style Check With Ruff
4133
run: |
4234
# I hate when the CI fails after not pushing for a while because ruff has new default rules.
43-
uv pip install --system ruff~=0.14
4435
ruff check --config tests/.ruff.toml -- $( git ls-tree -r --name-only HEAD | 'grep' -E '[.]py$' | 'grep' -v '/_external/' )
4536
4637
- name: Style Check With Black
4738
run: |
48-
uv pip install --system black~=26.0
4939
black -q --diff --line-length 120 --skip-string-normalization --target-version=py39 \
5040
$( git ls-tree -r --name-only HEAD | 'grep' '[.]py$' | 'grep' -v '/_external/' ) > black.diff
5141
if [ -s black.diff ]; then
@@ -55,24 +45,21 @@ jobs:
5545
5646
- name: Lint With Codespell
5747
run: |
58-
uv pip install --system codespell
5948
codespell $( git ls-tree -r --name-only HEAD | 'grep' -E '[.](py|md|txt|sh|yml)$' | 'grep' -v '/_external/' )
6049
6150
- name: Lint With Flake8
6251
run: |
63-
uv pip install --system flake8
6452
flake8 --config tests/.flake8 {ratarmount,tests}/[^_]*.py core/{ratarmountcore,tests}/[^_]*.py
6553
6654
- name: Lint With Pylint
6755
run: |
68-
uv pip install --system pylint
6956
# ubuntu-slim runs on one core, so parallelism with -j would only add overhead.
7057
pylint --rcfile tests/.pylintrc ratarmount core/ratarmountcore tests/*.py core/tests/*.py | tee pylint.log
7158
! 'egrep' ': E[0-9]{4}: ' pylint.log
7259
7360
- name: Lint With Mypy
7461
run: |
75-
yes | uv pip install --system --upgrade-strategy eager --upgrade types-dataclasses mypy
62+
yes | uv pip install --system --upgrade-strategy eager --upgrade types-dataclasses
7663
mypy --config-file tests/.mypy.ini ratarmount core/ratarmountcore core/tests
7764
yes | uv pip uninstall --system types-dataclasses
7865
@@ -90,27 +77,19 @@ jobs:
9077
steps:
9178
- uses: actions/checkout@v4
9279

93-
- name: Set up Python
94-
uses: actions/setup-python@v5
80+
- name: Setup Shared Test Environment
81+
uses: ./.github/actions/setup-test-env
9582
with:
83+
os: ${{ matrix.os }}
9684
# Pytype does not support Python 3.13 as of 2025-06.
9785
# https://news.ycombinator.com/item?id=44963724
9886
# https://github.com/google/pytype
9987
# > The last supported Python version for Pytype will be 3.12.
100-
python-version: '3.12'
101-
cache: 'pip'
102-
103-
- name: Set up uv
104-
uses: astral-sh/setup-uv@v6
105-
106-
- name: Install Dependencies
107-
uses: awalsh128/cache-apt-pkgs-action@v1.4.3
108-
with:
109-
packages: 'liblzo2-dev'
88+
python-version: 3.12
89+
linux-packages: 'liblzo2-dev'
11090

11191
- name: Install pip Dependencies
11292
run: |
113-
uv pip install --system --upgrade pip
11493
uv pip install --system pytype
11594
( cd core && uv pip install --system .[full,ext4,fsspec,sqlar] )
11695
uv pip install --system .
@@ -216,7 +195,7 @@ jobs:
216195
# Segfaults (139) are not allowed but other exit codes are valid!
217196
# indexed_zstd=1.2.0 did segfault here!
218197
python3 -m ratarmount README.md || [ $? != 139 ]
219-
uv pip uninstall --system -y "$module"
198+
uv pip uninstall --system "$module"
220199
done
221200
uv pip install --system --upgrade 'git+https://github.com/mxmlnkn/indexed_bzip2.git@master#egginfo=rapidgzip&subdirectory=python/rapidgzip'
222201
@@ -278,7 +257,7 @@ jobs:
278257
- name: Module tests without fusepy
279258
run: |
280259
uv pip install --system pytest
281-
uv pip uninstall --system -y fusepy mfusepy
260+
uv pip uninstall --system fusepy mfusepy
282261
pytest -rs -v tests/tests.py
283262
284263

0 commit comments

Comments
 (0)