littlefs-python 0.18.0__tar.gz → 0.19.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- littlefs_python-0.19.1/.github/workflows/abi3.yml +42 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/.github/workflows/deploy.yml +36 -10
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/.github/workflows/run-tests.yml +11 -3
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/PKG-INFO +7 -1
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/README.rst +6 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/README.md +1 -1
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/lfs.c +25 -16
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/lfs.h +6 -5
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/tests/test_alloc.toml +183 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/setup.py +21 -1
- littlefs_python-0.19.1/src/littlefs/lfs.c +27863 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/src/littlefs/lfs.pyx +12 -4
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/src/littlefs_python.egg-info/PKG-INFO +7 -1
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/src/littlefs_python.egg-info/SOURCES.txt +3 -0
- littlefs_python-0.19.1/src/littlefs_python.egg-info/scm_file_list.json +132 -0
- littlefs_python-0.19.1/src/littlefs_python.egg-info/scm_version.json +8 -0
- littlefs_python-0.19.1/test/test_attr.py +57 -0
- littlefs_python-0.18.0/src/littlefs/lfs.c +0 -42111
- littlefs_python-0.18.0/test/test_attr.py +0 -26
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/.gitattributes +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/.github/dependabot.yml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/.gitignore +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/.gitmodules +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/.pre-commit-config.yaml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/.readthedocs.yml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/LICENSE +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/MANIFEST.in +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/ci/build-wheels.sh +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/ci/download_release_files.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/docs/Makefile +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/docs/api/index.rst +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/docs/cli.rst +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/docs/conf.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/docs/doc8.ini +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/docs/examples/index.rst +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/docs/index.rst +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/docs/make.bat +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/docs/requirements.txt +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/docs/usage.rst +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/examples/mkfsimg.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/examples/walk.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/.git +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/.gitattributes +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/.github/workflows/post-release.yml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/.github/workflows/release.yml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/.github/workflows/status.yml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/.github/workflows/test.yml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/.gitignore +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/DESIGN.md +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/LICENSE.md +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/Makefile +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/SPEC.md +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/bd/lfs_emubd.c +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/bd/lfs_emubd.h +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/bd/lfs_filebd.c +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/bd/lfs_filebd.h +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/bd/lfs_rambd.c +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/bd/lfs_rambd.h +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/benches/bench_dir.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/benches/bench_file.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/benches/bench_superblock.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/lfs_util.c +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/lfs_util.h +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/runners/bench_runner.c +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/runners/bench_runner.h +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/runners/test_runner.c +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/runners/test_runner.h +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/scripts/bench.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/scripts/changeprefix.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/scripts/code.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/scripts/cov.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/scripts/data.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/scripts/perf.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/scripts/perfbd.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/scripts/plot.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/scripts/plotmpl.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/scripts/prettyasserts.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/scripts/readblock.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/scripts/readmdir.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/scripts/readtree.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/scripts/stack.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/scripts/structs.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/scripts/summary.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/scripts/tailpipe.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/scripts/teepipe.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/scripts/test.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/scripts/tracebd.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/scripts/watch.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/tests/test_attrs.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/tests/test_badblocks.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/tests/test_bd.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/tests/test_compat.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/tests/test_dirs.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/tests/test_entries.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/tests/test_evil.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/tests/test_exhaustion.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/tests/test_files.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/tests/test_interspersed.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/tests/test_move.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/tests/test_orphans.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/tests/test_paths.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/tests/test_powerloss.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/tests/test_relocations.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/tests/test_seek.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/tests/test_shrink.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/tests/test_superblocks.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/littlefs/tests/test_truncate.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/mypy.ini +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/pyproject.toml +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/requirements.txt +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/setup.cfg +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/src/littlefs/__init__.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/src/littlefs/__main__.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/src/littlefs/context.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/src/littlefs/errors.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/src/littlefs/lfs.pxd +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/src/littlefs/lfs.pyi +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/src/littlefs/py.typed +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/src/littlefs/repl.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/src/littlefs_python.egg-info/dependency_links.txt +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/src/littlefs_python.egg-info/entry_points.txt +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/src/littlefs_python.egg-info/not-zip-safe +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/src/littlefs_python.egg-info/requires.txt +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/src/littlefs_python.egg-info/top_level.txt +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/test/cli/test_create_and_extract.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/test/cli/test_create_and_repl.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/test/cli/test_walk_all.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/test/lfs/conftest.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/test/lfs/test_dir_functions.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/test/lfs/test_file_functions.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/test/lfs/test_fs_functions.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/test/test_block_count.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/test/test_context.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/test/test_directories.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/test/test_files.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/test/test_grow.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/test/test_multiversion.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/test/test_name_max.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/test/test_remove_rename.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/test/test_unicode_filenames.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/test/test_version.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/test/test_walk.py +0 -0
- {littlefs_python-0.18.0 → littlefs_python-0.19.1}/test/test_windisk_context.py +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Builds the stable-ABI (abi3) wheel on the oldest Python it supports and runs the tests with it. Anything
|
|
2
|
+
# the extension uses outside that version's limited API (e.g. a typed memoryview, which needs Py_buffer
|
|
3
|
+
# before Python 3.11) fails here, at compile or at import. Later Pythons are covered by the stable ABI's own
|
|
4
|
+
# guarantee.
|
|
5
|
+
|
|
6
|
+
name: abi3
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
push:
|
|
10
|
+
branches: [master]
|
|
11
|
+
pull_request:
|
|
12
|
+
branches: [master]
|
|
13
|
+
|
|
14
|
+
env:
|
|
15
|
+
LIMITED_API: "3.9"
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
abi3:
|
|
19
|
+
runs-on: ubuntu-22.04
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v7
|
|
22
|
+
with:
|
|
23
|
+
submodules: "recursive"
|
|
24
|
+
fetch-depth: 0
|
|
25
|
+
- name: Set up Python ${{ env.LIMITED_API }}
|
|
26
|
+
uses: actions/setup-python@v7
|
|
27
|
+
with:
|
|
28
|
+
python-version: ${{ env.LIMITED_API }}
|
|
29
|
+
- name: Build the abi3 wheel
|
|
30
|
+
env:
|
|
31
|
+
LITTLEFS_PY_LIMITED_API: ${{ env.LIMITED_API }}
|
|
32
|
+
run: |
|
|
33
|
+
python -m pip install --upgrade pip build
|
|
34
|
+
python -m build --wheel
|
|
35
|
+
- name: Install the abi3 wheel
|
|
36
|
+
run: |
|
|
37
|
+
pip install -r requirements.txt
|
|
38
|
+
pip install dist/*-abi3-*.whl
|
|
39
|
+
python -c "import littlefs.lfs as m; assert m.__file__.endswith('.abi3.so'), m.__file__; print(m.__file__)"
|
|
40
|
+
- name: Test with pytest
|
|
41
|
+
run: |
|
|
42
|
+
pytest
|
|
@@ -23,21 +23,21 @@ jobs:
|
|
|
23
23
|
CIBW_ARCHS_LINUX: "x86_64 i686 aarch64"
|
|
24
24
|
|
|
25
25
|
steps:
|
|
26
|
-
- uses: actions/checkout@
|
|
26
|
+
- uses: actions/checkout@v7
|
|
27
27
|
with:
|
|
28
28
|
submodules: "recursive"
|
|
29
29
|
fetch-depth: 0
|
|
30
30
|
|
|
31
31
|
- name: Setup QEMU # Needed to build aarch64 wheels
|
|
32
32
|
if: runner.os == 'Linux'
|
|
33
|
-
uses: docker/setup-qemu-action@
|
|
33
|
+
uses: docker/setup-qemu-action@v4
|
|
34
34
|
with:
|
|
35
35
|
platforms: all
|
|
36
36
|
|
|
37
37
|
- name: Build wheels
|
|
38
38
|
uses: pypa/cibuildwheel@v3.4.1
|
|
39
39
|
|
|
40
|
-
- uses: actions/upload-artifact@
|
|
40
|
+
- uses: actions/upload-artifact@v7
|
|
41
41
|
with:
|
|
42
42
|
name: wheels-${{ matrix.os }}
|
|
43
43
|
path: ./wheelhouse/*.whl
|
|
@@ -51,7 +51,7 @@ jobs:
|
|
|
51
51
|
cibw_archs: ["arm64"]
|
|
52
52
|
|
|
53
53
|
steps:
|
|
54
|
-
- uses: actions/checkout@
|
|
54
|
+
- uses: actions/checkout@v7
|
|
55
55
|
with:
|
|
56
56
|
submodules: "recursive"
|
|
57
57
|
fetch-depth: 0
|
|
@@ -84,16 +84,42 @@ jobs:
|
|
|
84
84
|
delocate-listdeps --all {dest_dir}/$WHEEL_SIMPLE_FILENAME
|
|
85
85
|
|
|
86
86
|
echo "DONE."
|
|
87
|
-
- uses: actions/upload-artifact@
|
|
87
|
+
- uses: actions/upload-artifact@v7
|
|
88
88
|
with:
|
|
89
89
|
name: wheels-macos-arm64
|
|
90
90
|
path: ./wheelhouse/*.whl
|
|
91
91
|
|
|
92
|
+
build_wheels_windows_arm64:
|
|
93
|
+
name: Build ARM64 wheels on ${{ matrix.os }}
|
|
94
|
+
runs-on: ${{ matrix.os }}
|
|
95
|
+
strategy:
|
|
96
|
+
matrix:
|
|
97
|
+
os: [windows-11-arm]
|
|
98
|
+
|
|
99
|
+
env:
|
|
100
|
+
# Native ARM64 CPython builds on Windows are available for 3.11+.
|
|
101
|
+
CIBW_BUILD: "cp311-* cp312-* cp313-* cp314-*"
|
|
102
|
+
CIBW_ARCHS_WINDOWS: "ARM64"
|
|
103
|
+
|
|
104
|
+
steps:
|
|
105
|
+
- uses: actions/checkout@v7
|
|
106
|
+
with:
|
|
107
|
+
submodules: "recursive"
|
|
108
|
+
fetch-depth: 0
|
|
109
|
+
|
|
110
|
+
- name: Build wheels
|
|
111
|
+
uses: pypa/cibuildwheel@v3.4.1
|
|
112
|
+
|
|
113
|
+
- uses: actions/upload-artifact@v7
|
|
114
|
+
with:
|
|
115
|
+
name: wheels-windows-arm64
|
|
116
|
+
path: ./wheelhouse/*.whl
|
|
117
|
+
|
|
92
118
|
build_sdist:
|
|
93
119
|
name: Build source distribution
|
|
94
120
|
runs-on: ubuntu-22.04
|
|
95
121
|
steps:
|
|
96
|
-
- uses: actions/checkout@
|
|
122
|
+
- uses: actions/checkout@v7
|
|
97
123
|
with:
|
|
98
124
|
submodules: "recursive"
|
|
99
125
|
fetch-depth: 0
|
|
@@ -103,23 +129,23 @@ jobs:
|
|
|
103
129
|
pip install build
|
|
104
130
|
python -m build . --sdist
|
|
105
131
|
|
|
106
|
-
- uses: actions/upload-artifact@
|
|
132
|
+
- uses: actions/upload-artifact@v7
|
|
107
133
|
with:
|
|
108
134
|
name: wheels-sdist
|
|
109
135
|
path: dist/*.tar.gz
|
|
110
136
|
|
|
111
137
|
upload_pypi:
|
|
112
|
-
needs: [build_wheels, build_wheels_macos_arm64, build_sdist]
|
|
138
|
+
needs: [build_wheels, build_wheels_macos_arm64, build_wheels_windows_arm64, build_sdist]
|
|
113
139
|
runs-on: ubuntu-22.04
|
|
114
140
|
if: ${{ inputs.upload_to_pypi }}
|
|
115
141
|
steps:
|
|
116
|
-
- uses: actions/download-artifact@
|
|
142
|
+
- uses: actions/download-artifact@v8
|
|
117
143
|
with:
|
|
118
144
|
path: dist
|
|
119
145
|
pattern: wheels-*
|
|
120
146
|
merge-multiple: true
|
|
121
147
|
|
|
122
|
-
- uses: pypa/gh-action-pypi-publish@v1.14.
|
|
148
|
+
- uses: pypa/gh-action-pypi-publish@v1.14.3
|
|
123
149
|
with:
|
|
124
150
|
user: __token__
|
|
125
151
|
password: ${{ secrets.pypi_api_token }}
|
|
@@ -14,15 +14,23 @@ jobs:
|
|
|
14
14
|
runs-on: ${{ matrix.os }}
|
|
15
15
|
strategy:
|
|
16
16
|
matrix:
|
|
17
|
-
os: [ubuntu-22.04, macos-15, windows-latest]
|
|
17
|
+
os: [ubuntu-22.04, macos-15, windows-latest, windows-11-arm]
|
|
18
18
|
python-version: [3.8, 3.9, "3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
19
|
+
exclude:
|
|
20
|
+
# Native ARM64 CPython builds on Windows are available for 3.11+.
|
|
21
|
+
- os: windows-11-arm
|
|
22
|
+
python-version: 3.8
|
|
23
|
+
- os: windows-11-arm
|
|
24
|
+
python-version: 3.9
|
|
25
|
+
- os: windows-11-arm
|
|
26
|
+
python-version: "3.10"
|
|
19
27
|
|
|
20
28
|
steps:
|
|
21
|
-
- uses: actions/checkout@
|
|
29
|
+
- uses: actions/checkout@v7
|
|
22
30
|
with:
|
|
23
31
|
submodules: "recursive"
|
|
24
32
|
- name: Set up Python ${{ matrix.python-version }}
|
|
25
|
-
uses: actions/setup-python@
|
|
33
|
+
uses: actions/setup-python@v7
|
|
26
34
|
with:
|
|
27
35
|
python-version: ${{ matrix.python-version }}
|
|
28
36
|
- name: Install dependencies
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: littlefs-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.19.1
|
|
4
4
|
Summary: A python wrapper for littlefs
|
|
5
5
|
Home-page: https://github.com/jrast/littlefs-python
|
|
6
6
|
Author: Jürg Rast
|
|
@@ -202,6 +202,12 @@ the package::
|
|
|
202
202
|
|
|
203
203
|
It's highly recommended to install the package in a virtual environment!
|
|
204
204
|
|
|
205
|
+
To build one wheel against the CPython stable ABI (abi3), which runs on the
|
|
206
|
+
given Python version and every later one, set ``LITTLEFS_PY_LIMITED_API``
|
|
207
|
+
(3.9 or later; needs Cython 3.1 or later)::
|
|
208
|
+
|
|
209
|
+
LITTLEFS_PY_LIMITED_API=3.9 python -m build --wheel
|
|
210
|
+
|
|
205
211
|
Development Hints
|
|
206
212
|
-----------------
|
|
207
213
|
|
|
@@ -169,6 +169,12 @@ the package::
|
|
|
169
169
|
|
|
170
170
|
It's highly recommended to install the package in a virtual environment!
|
|
171
171
|
|
|
172
|
+
To build one wheel against the CPython stable ABI (abi3), which runs on the
|
|
173
|
+
given Python version and every later one, set ``LITTLEFS_PY_LIMITED_API``
|
|
174
|
+
(3.9 or later; needs Cython 3.1 or later)::
|
|
175
|
+
|
|
176
|
+
LITTLEFS_PY_LIMITED_API=3.9 python -m build --wheel
|
|
177
|
+
|
|
172
178
|
Development Hints
|
|
173
179
|
-----------------
|
|
174
180
|
|
|
@@ -192,7 +192,7 @@ More details on how littlefs works can be found in [DESIGN.md](DESIGN.md) and
|
|
|
192
192
|
## Testing
|
|
193
193
|
|
|
194
194
|
The littlefs comes with a test suite designed to run on a PC using the
|
|
195
|
-
[emulated block device](bd/
|
|
195
|
+
[emulated block device](bd/lfs_emubd.h) found in the `bd` directory.
|
|
196
196
|
The tests assume a Linux environment and can be started with make:
|
|
197
197
|
|
|
198
198
|
``` bash
|
|
@@ -258,7 +258,7 @@ static int lfs_bd_prog(lfs_t *lfs,
|
|
|
258
258
|
continue;
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
-
// pcache must have been flushed, either by programming
|
|
261
|
+
// pcache must have been flushed, either by programming an
|
|
262
262
|
// entire block or manually flushing the pcache
|
|
263
263
|
LFS_ASSERT(pcache->block == LFS_BLOCK_NULL);
|
|
264
264
|
|
|
@@ -286,7 +286,7 @@ static int lfs_bd_erase(lfs_t *lfs, lfs_block_t block) {
|
|
|
286
286
|
|
|
287
287
|
// some operations on paths
|
|
288
288
|
static inline lfs_size_t lfs_path_namelen(const char *path) {
|
|
289
|
-
return strcspn(path, "/");
|
|
289
|
+
return (lfs_size_t)strcspn(path, "/");
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
static inline bool lfs_path_islast(const char *path) {
|
|
@@ -1291,6 +1291,7 @@ static lfs_stag_t lfs_dir_fetchmatch(lfs_t *lfs,
|
|
|
1291
1291
|
|
|
1292
1292
|
// found a match for our fetcher?
|
|
1293
1293
|
if ((fmask & tag) == (fmask & ftag)) {
|
|
1294
|
+
LFS_ASSERT(cb != NULL);
|
|
1294
1295
|
int res = cb(data, tag, &(struct lfs_diskoff){
|
|
1295
1296
|
dir->pair[0], off+sizeof(tag)});
|
|
1296
1297
|
if (res < 0) {
|
|
@@ -1501,7 +1502,7 @@ nextname:
|
|
|
1501
1502
|
if (lfs_tag_type3(tag) == LFS_TYPE_DIR) {
|
|
1502
1503
|
name += strspn(name, "/");
|
|
1503
1504
|
}
|
|
1504
|
-
lfs_size_t namelen = strcspn(name, "/");
|
|
1505
|
+
lfs_size_t namelen = (lfs_size_t)strcspn(name, "/");
|
|
1505
1506
|
|
|
1506
1507
|
// skip '.'
|
|
1507
1508
|
if (namelen == 1 && memcmp(name, ".", 1) == 0) {
|
|
@@ -1520,7 +1521,7 @@ nextname:
|
|
|
1520
1521
|
int depth = 1;
|
|
1521
1522
|
while (true) {
|
|
1522
1523
|
suffix += strspn(suffix, "/");
|
|
1523
|
-
sufflen = strcspn(suffix, "/");
|
|
1524
|
+
sufflen = (lfs_size_t)strcspn(suffix, "/");
|
|
1524
1525
|
if (sufflen == 0) {
|
|
1525
1526
|
break;
|
|
1526
1527
|
}
|
|
@@ -1761,7 +1762,7 @@ static int lfs_dir_commitcrc(lfs_t *lfs, struct lfs_commit *commit) {
|
|
|
1761
1762
|
|
|
1762
1763
|
commit->off = noff;
|
|
1763
1764
|
// perturb valid bit?
|
|
1764
|
-
commit->ptag = ntag ^ ((
|
|
1765
|
+
commit->ptag = ntag ^ ((lfs_tag_t)(0x80 & ~eperturb) << 24);
|
|
1765
1766
|
// reset crc for next commit
|
|
1766
1767
|
commit->crc = 0xffffffff;
|
|
1767
1768
|
|
|
@@ -3244,10 +3245,12 @@ static int lfs_file_open_(lfs_t *lfs, lfs_file_t *file,
|
|
|
3244
3245
|
#endif
|
|
3245
3246
|
|
|
3246
3247
|
static int lfs_file_close_(lfs_t *lfs, lfs_file_t *file) {
|
|
3247
|
-
#ifndef LFS_READONLY
|
|
3248
|
-
int err = lfs_file_sync_(lfs, file);
|
|
3249
|
-
#else
|
|
3250
3248
|
int err = 0;
|
|
3249
|
+
#ifndef LFS_READONLY
|
|
3250
|
+
// it's not safe to do anything if our file errored
|
|
3251
|
+
if (!(file->flags & LFS_F_ERRED)) {
|
|
3252
|
+
err = lfs_file_sync_(lfs, file);
|
|
3253
|
+
}
|
|
3251
3254
|
#endif
|
|
3252
3255
|
|
|
3253
3256
|
// remove from list of mdirs
|
|
@@ -3429,18 +3432,12 @@ relocate:
|
|
|
3429
3432
|
|
|
3430
3433
|
#ifndef LFS_READONLY
|
|
3431
3434
|
static int lfs_file_sync_(lfs_t *lfs, lfs_file_t *file) {
|
|
3432
|
-
if (file->flags & LFS_F_ERRED) {
|
|
3433
|
-
// it's not safe to do anything if our file errored
|
|
3434
|
-
return 0;
|
|
3435
|
-
}
|
|
3436
|
-
|
|
3437
3435
|
int err = lfs_file_flush(lfs, file);
|
|
3438
3436
|
if (err) {
|
|
3439
3437
|
file->flags |= LFS_F_ERRED;
|
|
3440
3438
|
return err;
|
|
3441
3439
|
}
|
|
3442
3440
|
|
|
3443
|
-
|
|
3444
3441
|
if ((file->flags & LFS_F_DIRTY) &&
|
|
3445
3442
|
!lfs_pair_isnull(file->m.pair)) {
|
|
3446
3443
|
// before we commit metadata, we need sync the disk to make sure
|
|
@@ -3485,6 +3482,17 @@ static int lfs_file_sync_(lfs_t *lfs, lfs_file_t *file) {
|
|
|
3485
3482
|
file->flags &= ~LFS_F_DIRTY;
|
|
3486
3483
|
}
|
|
3487
3484
|
|
|
3485
|
+
// mark any other file handles as dirty + desync
|
|
3486
|
+
for (lfs_file_t *f = (lfs_file_t*)lfs->mlist; f; f = f->next) {
|
|
3487
|
+
if (file != f
|
|
3488
|
+
&& f->type == LFS_TYPE_REG
|
|
3489
|
+
&& lfs_pair_cmp(f->m.pair, file->m.pair) == 0
|
|
3490
|
+
&& f->id == file->id) {
|
|
3491
|
+
f->flags |= LFS_F_DUSTY;
|
|
3492
|
+
}
|
|
3493
|
+
}
|
|
3494
|
+
|
|
3495
|
+
file->flags &= ~LFS_F_ERRED & ~LFS_F_DUSTY;
|
|
3488
3496
|
return 0;
|
|
3489
3497
|
}
|
|
3490
3498
|
#endif
|
|
@@ -3692,7 +3700,7 @@ static lfs_ssize_t lfs_file_write_(lfs_t *lfs, lfs_file_t *file,
|
|
|
3692
3700
|
return nsize;
|
|
3693
3701
|
}
|
|
3694
3702
|
|
|
3695
|
-
file->flags &= ~LFS_F_ERRED;
|
|
3703
|
+
file->flags &= ~LFS_F_ERRED & ~LFS_F_DUSTY;
|
|
3696
3704
|
return nsize;
|
|
3697
3705
|
}
|
|
3698
3706
|
#endif
|
|
@@ -4771,7 +4779,8 @@ int lfs_fs_traverse_(lfs_t *lfs,
|
|
|
4771
4779
|
continue;
|
|
4772
4780
|
}
|
|
4773
4781
|
|
|
4774
|
-
if ((f->flags & LFS_F_DIRTY)
|
|
4782
|
+
if (((f->flags & LFS_F_DIRTY) || (f->flags & LFS_F_DUSTY))
|
|
4783
|
+
&& !(f->flags & LFS_F_INLINE)) {
|
|
4775
4784
|
int err = lfs_ctz_traverse(lfs, &f->cache, &lfs->rcache,
|
|
4776
4785
|
f->ctz.head, f->ctz.size, cb, data);
|
|
4777
4786
|
if (err) {
|
|
@@ -135,14 +135,15 @@ enum lfs_open_flags {
|
|
|
135
135
|
|
|
136
136
|
// internally used flags
|
|
137
137
|
#ifndef LFS_READONLY
|
|
138
|
-
LFS_F_DIRTY =
|
|
139
|
-
|
|
138
|
+
LFS_F_DIRTY = 0x00010000, // File does not match storage due to write
|
|
139
|
+
LFS_F_DUSTY = 0x00020000, // File does not match storage due to desync
|
|
140
|
+
LFS_F_WRITING = 0x00040000, // File has been written since last flush
|
|
140
141
|
#endif
|
|
141
|
-
LFS_F_READING =
|
|
142
|
+
LFS_F_READING = 0x00080000, // File has been read since last flush
|
|
142
143
|
#ifndef LFS_READONLY
|
|
143
|
-
LFS_F_ERRED =
|
|
144
|
+
LFS_F_ERRED = 0x00100000, // An error occurred during write
|
|
144
145
|
#endif
|
|
145
|
-
LFS_F_INLINE =
|
|
146
|
+
LFS_F_INLINE = 0x01000000, // Currently inlined in directory entry
|
|
146
147
|
};
|
|
147
148
|
|
|
148
149
|
// File seek flags
|
|
@@ -250,6 +250,189 @@ code = '''
|
|
|
250
250
|
}
|
|
251
251
|
'''
|
|
252
252
|
|
|
253
|
+
# multiple handle allocation test
|
|
254
|
+
#
|
|
255
|
+
# this tests that multiple open handles to the same file don't clobber
|
|
256
|
+
# each other
|
|
257
|
+
[cases.test_alloc_multihandle]
|
|
258
|
+
defines.FILES = 2
|
|
259
|
+
defines.SIZE = '(((BLOCK_SIZE-8)*(BLOCK_COUNT-6)) / FILES)'
|
|
260
|
+
defines.GC = [false, true]
|
|
261
|
+
defines.COMPACT_THRESH = ['-1', '0', 'BLOCK_SIZE/2']
|
|
262
|
+
defines.INFER_BC = [false, true]
|
|
263
|
+
defines.SYNC = [false, true]
|
|
264
|
+
code = '''
|
|
265
|
+
const char *names[] = {"eggs", "spinach"};
|
|
266
|
+
lfs_file_t files[FILES];
|
|
267
|
+
|
|
268
|
+
lfs_t lfs;
|
|
269
|
+
lfs_format(&lfs, cfg) => 0;
|
|
270
|
+
struct lfs_config cfg_ = *cfg;
|
|
271
|
+
if (INFER_BC) {
|
|
272
|
+
cfg_.block_count = 0;
|
|
273
|
+
}
|
|
274
|
+
lfs_mount(&lfs, &cfg_) => 0;
|
|
275
|
+
lfs_mkdir(&lfs, "breakfast") => 0;
|
|
276
|
+
|
|
277
|
+
// write one file
|
|
278
|
+
char path[1024];
|
|
279
|
+
sprintf(path, "breakfast/quiche");
|
|
280
|
+
lfs_file_open(&lfs, &files[0], path,
|
|
281
|
+
LFS_O_RDWR | LFS_O_CREAT | LFS_O_EXCL) => 0;
|
|
282
|
+
if (GC) {
|
|
283
|
+
lfs_fs_gc(&lfs) => 0;
|
|
284
|
+
}
|
|
285
|
+
size_t size = strlen(names[0]);
|
|
286
|
+
for (lfs_size_t i = 0; i < SIZE; i += size) {
|
|
287
|
+
lfs_file_write(&lfs, &files[0], names[0], size) => size;
|
|
288
|
+
}
|
|
289
|
+
// sync?
|
|
290
|
+
if (SYNC) {
|
|
291
|
+
lfs_file_sync(&lfs, &files[0]) => 0;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// write the other file
|
|
295
|
+
sprintf(path, "breakfast/quiche");
|
|
296
|
+
lfs_file_open(&lfs, &files[1], path,
|
|
297
|
+
LFS_O_RDWR | LFS_O_CREAT | LFS_O_TRUNC) => 0;
|
|
298
|
+
if (GC) {
|
|
299
|
+
lfs_fs_gc(&lfs) => 0;
|
|
300
|
+
}
|
|
301
|
+
size = strlen(names[1]);
|
|
302
|
+
for (lfs_size_t i = 0; i < SIZE; i += size) {
|
|
303
|
+
lfs_file_write(&lfs, &files[1], names[1], size) => size;
|
|
304
|
+
}
|
|
305
|
+
// sync?
|
|
306
|
+
if (SYNC) {
|
|
307
|
+
lfs_file_sync(&lfs, &files[1]) => 0;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// try to read from both
|
|
311
|
+
for (int n = 0; n < FILES; n++) {
|
|
312
|
+
lfs_file_rewind(&lfs, &files[n]) => 0;
|
|
313
|
+
size_t size = strlen(names[n]);
|
|
314
|
+
for (lfs_size_t i = 0; i < SIZE; i += size) {
|
|
315
|
+
uint8_t buffer[1024];
|
|
316
|
+
lfs_file_read(&lfs, &files[n], buffer, size) => size;
|
|
317
|
+
assert(memcmp(buffer, names[n], size) == 0);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
for (int n = 0; n < FILES; n++) {
|
|
321
|
+
lfs_file_close(&lfs, &files[n]) => 0;
|
|
322
|
+
}
|
|
323
|
+
lfs_unmount(&lfs) => 0;
|
|
324
|
+
|
|
325
|
+
// check after remounting
|
|
326
|
+
lfs_mount(&lfs, &cfg_) => 0;
|
|
327
|
+
{
|
|
328
|
+
// last one wins
|
|
329
|
+
int n = FILES-1;
|
|
330
|
+
char path[1024];
|
|
331
|
+
sprintf(path, "breakfast/quiche");
|
|
332
|
+
lfs_file_t file;
|
|
333
|
+
lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
|
|
334
|
+
size_t size = strlen(names[n]);
|
|
335
|
+
for (lfs_size_t i = 0; i < SIZE; i += size) {
|
|
336
|
+
uint8_t buffer[1024];
|
|
337
|
+
lfs_file_read(&lfs, &file, buffer, size) => size;
|
|
338
|
+
assert(memcmp(buffer, names[n], size) == 0);
|
|
339
|
+
}
|
|
340
|
+
lfs_file_close(&lfs, &file) => 0;
|
|
341
|
+
}
|
|
342
|
+
lfs_unmount(&lfs) => 0;
|
|
343
|
+
'''
|
|
344
|
+
|
|
345
|
+
# multiple handle allocation reuse test
|
|
346
|
+
[cases.test_alloc_multihandle_reuse]
|
|
347
|
+
defines.FILES = 2
|
|
348
|
+
defines.SIZE = '(((BLOCK_SIZE-8)*(BLOCK_COUNT-6)) / (FILES+1))'
|
|
349
|
+
defines.CYCLES = [1, 10]
|
|
350
|
+
defines.INFER_BC = [false, true]
|
|
351
|
+
defines.SYNC = [false, true]
|
|
352
|
+
code = '''
|
|
353
|
+
const char *names[] = {"eggs", "spinach"};
|
|
354
|
+
lfs_file_t files[FILES];
|
|
355
|
+
|
|
356
|
+
lfs_t lfs;
|
|
357
|
+
lfs_format(&lfs, cfg) => 0;
|
|
358
|
+
struct lfs_config cfg_ = *cfg;
|
|
359
|
+
if (INFER_BC) {
|
|
360
|
+
cfg_.block_count = 0;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
lfs_mount(&lfs, &cfg_) => 0;
|
|
364
|
+
lfs_mkdir(&lfs, "breakfast") => 0;
|
|
365
|
+
|
|
366
|
+
// write one file
|
|
367
|
+
char path[1024];
|
|
368
|
+
sprintf(path, "breakfast/quiche");
|
|
369
|
+
lfs_file_open(&lfs, &files[0], path,
|
|
370
|
+
LFS_O_RDWR | LFS_O_CREAT | LFS_O_EXCL) => 0;
|
|
371
|
+
if (GC) {
|
|
372
|
+
lfs_fs_gc(&lfs) => 0;
|
|
373
|
+
}
|
|
374
|
+
size_t size = strlen(names[0]);
|
|
375
|
+
for (lfs_size_t i = 0; i < SIZE; i += size) {
|
|
376
|
+
lfs_file_write(&lfs, &files[0], names[0], size) => size;
|
|
377
|
+
}
|
|
378
|
+
// sync?
|
|
379
|
+
if (SYNC) {
|
|
380
|
+
lfs_file_sync(&lfs, &files[0]) => 0;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
for (int c = 0; c < CYCLES; c++) {
|
|
384
|
+
// write the other file
|
|
385
|
+
sprintf(path, "breakfast/quiche");
|
|
386
|
+
lfs_file_open(&lfs, &files[1], path,
|
|
387
|
+
LFS_O_RDWR | LFS_O_CREAT | LFS_O_TRUNC) => 0;
|
|
388
|
+
if (GC) {
|
|
389
|
+
lfs_fs_gc(&lfs) => 0;
|
|
390
|
+
}
|
|
391
|
+
size = strlen(names[1]);
|
|
392
|
+
for (lfs_size_t i = 0; i < SIZE; i += size) {
|
|
393
|
+
lfs_file_write(&lfs, &files[1], names[1], size) => size;
|
|
394
|
+
}
|
|
395
|
+
// sync?
|
|
396
|
+
if (SYNC) {
|
|
397
|
+
lfs_file_sync(&lfs, &files[1]) => 0;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
// try to read from both
|
|
401
|
+
for (int n = 0; n < FILES; n++) {
|
|
402
|
+
lfs_file_rewind(&lfs, &files[n]) => 0;
|
|
403
|
+
size_t size = strlen(names[n]);
|
|
404
|
+
for (lfs_size_t i = 0; i < SIZE; i += size) {
|
|
405
|
+
uint8_t buffer[1024];
|
|
406
|
+
lfs_file_read(&lfs, &files[n], buffer, size) => size;
|
|
407
|
+
assert(memcmp(buffer, names[n], size) == 0);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
lfs_file_close(&lfs, &files[1]) => 0;
|
|
412
|
+
}
|
|
413
|
+
lfs_file_close(&lfs, &files[0]) => 0;
|
|
414
|
+
lfs_unmount(&lfs) => 0;
|
|
415
|
+
|
|
416
|
+
// check after remounting
|
|
417
|
+
lfs_mount(&lfs, &cfg_) => 0;
|
|
418
|
+
{
|
|
419
|
+
// last one wins
|
|
420
|
+
int n = (SYNC) ? FILES-1 : 0;
|
|
421
|
+
char path[1024];
|
|
422
|
+
sprintf(path, "breakfast/quiche");
|
|
423
|
+
lfs_file_t file;
|
|
424
|
+
lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
|
|
425
|
+
size_t size = strlen(names[n]);
|
|
426
|
+
for (int i = 0; i < SIZE; i += size) {
|
|
427
|
+
uint8_t buffer[1024];
|
|
428
|
+
lfs_file_read(&lfs, &file, buffer, size) => size;
|
|
429
|
+
assert(memcmp(buffer, names[n], size) == 0);
|
|
430
|
+
}
|
|
431
|
+
lfs_file_close(&lfs, &file) => 0;
|
|
432
|
+
}
|
|
433
|
+
lfs_unmount(&lfs) => 0;
|
|
434
|
+
'''
|
|
435
|
+
|
|
253
436
|
# exhaustion test
|
|
254
437
|
[cases.test_alloc_exhaustion]
|
|
255
438
|
defines.INFER_BC = [false, true]
|
|
@@ -1,8 +1,25 @@
|
|
|
1
|
+
import os
|
|
1
2
|
from os import path
|
|
2
3
|
from setuptools import setup, find_packages
|
|
3
4
|
from setuptools import Extension
|
|
5
|
+
import Cython
|
|
4
6
|
from Cython.Build import cythonize
|
|
5
7
|
|
|
8
|
+
# Opt-in stable-ABI (abi3) build: LITTLEFS_PY_LIMITED_API=3.9 builds one extension that runs on CPython 3.9
|
|
9
|
+
# and every later version. Unset, the extension is built for the running Python only.
|
|
10
|
+
LIMITED_API = os.environ.get("LITTLEFS_PY_LIMITED_API")
|
|
11
|
+
LIMITED_API_MACROS = []
|
|
12
|
+
LIMITED_API_OPTIONS = {}
|
|
13
|
+
if LIMITED_API:
|
|
14
|
+
major, minor = (int(part) for part in LIMITED_API.split("."))
|
|
15
|
+
if (major, minor) < (3, 9):
|
|
16
|
+
raise SystemExit("LITTLEFS_PY_LIMITED_API must be 3.9 or later, got %s" % LIMITED_API)
|
|
17
|
+
cython_version = tuple(int(part) for part in Cython.__version__.split(".")[:2])
|
|
18
|
+
if cython_version < (3, 1):
|
|
19
|
+
raise SystemExit("An abi3 build needs Cython 3.1 or later, found %s" % Cython.__version__)
|
|
20
|
+
LIMITED_API_MACROS = [("Py_LIMITED_API", "0x%02X%02X0000" % (major, minor))]
|
|
21
|
+
LIMITED_API_OPTIONS = {"bdist_wheel": {"py_limited_api": "cp%d%d" % (major, minor)}}
|
|
22
|
+
|
|
6
23
|
# Extension definition
|
|
7
24
|
EXTENSIONS = [
|
|
8
25
|
Extension(
|
|
@@ -16,8 +33,10 @@ EXTENSIONS = [
|
|
|
16
33
|
("LFS_MULTIVERSION", "1"),
|
|
17
34
|
("LFS_NAME_MAX", "1022"), # LittleFS limitation: must be <= 1022
|
|
18
35
|
# ('LFS_YES_TRACE', '1')
|
|
19
|
-
]
|
|
36
|
+
]
|
|
37
|
+
+ LIMITED_API_MACROS,
|
|
20
38
|
extra_compile_args=["-std=c99", "-UNDEBUG"],
|
|
39
|
+
py_limited_api=bool(LIMITED_API),
|
|
21
40
|
)
|
|
22
41
|
]
|
|
23
42
|
|
|
@@ -39,6 +58,7 @@ setup(
|
|
|
39
58
|
package_data={"*": ["py.typed", "*.pyi"]},
|
|
40
59
|
package_dir={"": "src"},
|
|
41
60
|
zip_safe=False,
|
|
61
|
+
options=LIMITED_API_OPTIONS,
|
|
42
62
|
ext_modules=cythonize(EXTENSIONS, language_level=3, annotate=False, compiler_directives={"embedsignature": True}),
|
|
43
63
|
entry_points={
|
|
44
64
|
"console_scripts": [
|