Skip to content

Commit

Permalink
[CI] Test with Python 3.13 and 3.14
Browse files Browse the repository at this point in the history
  • Loading branch information
mxmlnkn committed Sep 16, 2024
1 parent fe59449 commit 3c72846
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 11 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,13 @@ jobs:

strategy:
matrix:
os: [macos-13, ubuntu-latest]
os: ['macos-13', 'ubuntu-latest']
# macos-13 / macos-latest does not work anymore because the dependencies don't have any wheels,
# probably because it is M1 based.
# ToDo: Add windows-latest but it requires a lot of setup of the dependencies!
# Maybe only test ratarmount-core without most dependencies after I have split that off.
# Oldest and newest versions should be enough. Python versions are supported 5 years from release date.
# https://endoflife.date/python
# 3.5 was released 2015-09-13 and end-of-life was 2020-09-13
# 3.6 was released 2016-12-23 and end-of-life was 2021-12-23
# 3.7 was released 2018-06-27 and end-of-life was 2023-06-27
Expand All @@ -84,7 +85,11 @@ jobs:
# 3.11 was released 2022-10-24 and end-of-life will be 2027-10
# 3.12 was released 2023-10-02 and end-of-life will be 2028-10
# 3.13 is to be released 2024-10
python-version: ['3.8', '3.12']
# 3.14 is to be released 2025-10
python-version: ['3.8', '3.12', '3.13.0-rc.2']
include:
- os: ubuntu-latest
python-version: '3.14.0-alpha.0'

defaults:
run:
Expand Down Expand Up @@ -139,7 +144,7 @@ jobs:
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade wheel
python3 -m pip install --upgrade setuptools
python3 -m pip install --upgrade-strategy eager --upgrade cython twine build zstandard fusepy cffi
python3 -m pip install --upgrade-strategy eager --upgrade twine build fusepy cffi
- name: Test Startup With Only One Compression Dependency
run: |
Expand Down
32 changes: 28 additions & 4 deletions core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,43 @@ full = [
"PySquashfsImage == 0.9.0",
"lz4 ~= 4.0.0",
"python-lzo ~= 1.0",
"zstandard ~= 0.22.0",
"isal ~= 1.0",
# https://peps.python.org/pep-0508/
# Need at least 0.23.0 for Python 3.13 support.
# https://github.com/indygreg/python-zstandard/issues/223
# The old zstandard-python versions for Python < 3.8 are untested because they are EOL.
"zstandard ~= 0.20.0; python_version == '3.6'",
"zstandard ~= 0.21.0; python_version == '3.7'",
# With Python 3.14, I get ImportError: cannot import name 'ByteString' from 'typing' via
# zstandard/__init__.py:21.
# https://github.com/indygreg/python-zstandard/issues/238
"zstandard ~= 0.23.0; python_version >= '3.8' and python_version < '3.14'",
# With Python 3.14, when building the wheel, I get:
# /usr/bin/ld: cannot find /tmp/tmpcuw21d78/bin/isa-l.a: No such file or directory
'isal ~= 1.0; python_version < "3.14.0"',
]
bzip2 = ["rapidgzip >= 0.13.1"]
gzip = ["indexed_gzip >= 1.6.3, < 2.0"]
# Need >= 4.1 because of https://github.com/markokr/rarfile/issues/73
rar = ["rarfile ~= 4.1"]
# For now, only optional (and installed in the AppImage) because it is unstable and depends on many other packages
# that do not even have up-to-date wheels, i.e., will fail to install if, e.g., gcc and liblzo2-dev are not installed.
squashfs = [
"PySquashfsImage == 0.9.0",
"lz4 ~= 4.0.0",
"python-lzo ~= 1.0",
"zstandard ~= 0.22.0",
"isal ~= 1.0",
# https://peps.python.org/pep-0508/
# Need at least 0.23.0 for Python 3.13 support.
# https://github.com/indygreg/python-zstandard/issues/223
# The old zstandard-python versions for Python < 3.8 are untested because they are EOL.
"zstandard ~= 0.20.0; python_version == '3.6'",
"zstandard ~= 0.21.0; python_version == '3.7'",
# With Python 3.14, I get ImportError: cannot import name 'ByteString' from 'typing' via
# zstandard/__init__.py:21.
# https://github.com/indygreg/python-zstandard/issues/238
"zstandard ~= 0.23.0; python_version >= '3.8' and python_version < '3.14'",
# With Python 3.14, when building the wheel, I get:
# /usr/bin/ld: cannot find /tmp/tmpcuw21d78/bin/isa-l.a: No such file or directory
'isal ~= 1.0; python_version < "3.14.0"',
]
xz = ["python-xz ~= 0.4.0"]
zip = []
Expand Down
13 changes: 12 additions & 1 deletion core/tests/test_BlockParallelReaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
import indexed_zstd
import pytest
import xz
import zstandard

try:
# May not be installed with Python 3.14 because of incompatibilities.
import zstandard
except ImportError:
zstandard = None # type: ignore

sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

Expand Down Expand Up @@ -207,6 +212,9 @@ def _createArchive(archivePath: str, streams: int, blocksPerStream: int, blockSi

@staticmethod
def _testSequentialReading(archivePath: str, bufferSize: int, parallelization: int):
if zstandard is None:
return

with indexed_zstd.IndexedZstdFile(archivePath) as serialFile, (
SeekableZstd(archivePath) if parallelization == 1 else ParallelZstdReader(archivePath, parallelization)
) as parallelFile:
Expand All @@ -225,6 +233,9 @@ def _testSequentialReading(archivePath: str, bufferSize: int, parallelization: i

@staticmethod
def _testRandomReads(archivePath: str, samples: int, parallelization: int):
if zstandard is None:
return

with indexed_zstd.IndexedZstdFile(archivePath) as serialFile, (
SeekableZstd(archivePath) if parallelization == 1 else ParallelZstdReader(archivePath, parallelization)
) as parallelFile:
Expand Down
12 changes: 9 additions & 3 deletions tests/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1936,7 +1936,7 @@ tests+=(
fi

# zipfile returns unseekable file object with Python 3.6. Therefore, I disabled it completely there.
python3MinorVersion=$( python3 --version | sed -n -E 's|.* 3[.]([0-9]+)[.][0-9]+|\1|p' )
python3MinorVersion=$( python3 -c 'import sys; print(sys.version_info.minor)' )
if [[ -n "$python3MinorVersion" && "$python3MinorVersion" -gt 6 ]]; then
if ! uname | 'grep' -q -i darwin; then
tests+=(
Expand Down Expand Up @@ -1977,22 +1977,28 @@ tests+=(
c157a79031e1c40f85931829bc5fc552 tests/2k-recursive-tars.tar.bz2 mimi/foo
)

# https://github.com/indygreg/python-zstandard/issues/238
if [[ -n "$python3MinorVersion" && "$python3MinorVersion" -ge 14 ]]; then
pytestedTests+=(
2709a3348eb2c52302a7606ecf5860bc tests/folder-symlink.zstd.squashfs foo/fighter/ufo
2709a3348eb2c52302a7606ecf5860bc tests/folder-symlink.zstd.squashfs foo/jet/ufo
)
fi

pytestedTests+=(
2709a3348eb2c52302a7606ecf5860bc tests/folder-symlink.gzip.squashfs foo/fighter/ufo
2709a3348eb2c52302a7606ecf5860bc tests/folder-symlink.lz4.squashfs foo/fighter/ufo
2709a3348eb2c52302a7606ecf5860bc tests/folder-symlink.lzma.squashfs foo/fighter/ufo
2709a3348eb2c52302a7606ecf5860bc tests/folder-symlink.lzo.squashfs foo/fighter/ufo
2709a3348eb2c52302a7606ecf5860bc tests/folder-symlink.no-compression.squashfs foo/fighter/ufo
2709a3348eb2c52302a7606ecf5860bc tests/folder-symlink.xz.squashfs foo/fighter/ufo
2709a3348eb2c52302a7606ecf5860bc tests/folder-symlink.zstd.squashfs foo/fighter/ufo

2709a3348eb2c52302a7606ecf5860bc tests/folder-symlink.gzip.squashfs foo/jet/ufo
2709a3348eb2c52302a7606ecf5860bc tests/folder-symlink.lz4.squashfs foo/jet/ufo
2709a3348eb2c52302a7606ecf5860bc tests/folder-symlink.lzma.squashfs foo/jet/ufo
2709a3348eb2c52302a7606ecf5860bc tests/folder-symlink.lzo.squashfs foo/jet/ufo
2709a3348eb2c52302a7606ecf5860bc tests/folder-symlink.no-compression.squashfs foo/jet/ufo
2709a3348eb2c52302a7606ecf5860bc tests/folder-symlink.xz.squashfs foo/jet/ufo
2709a3348eb2c52302a7606ecf5860bc tests/folder-symlink.zstd.squashfs foo/jet/ufo

2709a3348eb2c52302a7606ecf5860bc tests/file-in-non-existing-folder.rar foo2/ufo
2709a3348eb2c52302a7606ecf5860bc tests/folder-symlink.rar foo/fighter/ufo
Expand Down

0 comments on commit 3c72846

Please sign in to comment.