pyfastcdc 0.3.0__tar.gz → 0.3.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.
- {pyfastcdc-0.3.0/pyfastcdc.egg-info → pyfastcdc-0.3.1}/PKG-INFO +4 -3
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/README.md +2 -2
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/pyfastcdc/__init__.py +1 -1
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/pyfastcdc/__init__.pyi +2 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1/pyfastcdc.egg-info}/PKG-INFO +4 -3
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/pyfastcdc.egg-info/SOURCES.txt +1 -0
- pyfastcdc-0.3.1/pyproject.toml +8 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/setup.py +5 -1
- pyfastcdc-0.3.1/tests/test_threading.py +54 -0
- pyfastcdc-0.3.0/pyproject.toml +0 -3
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/LICENSE +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/MANIFEST.in +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/pyfastcdc/common.py +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/pyfastcdc/cy/__init__.py +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/pyfastcdc/cy/chunk.pxd +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/pyfastcdc/cy/chunk.pyx +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/pyfastcdc/cy/constants.pxd +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/pyfastcdc/cy/constants.pyx +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/pyfastcdc/cy/fastcdc.pyx +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/pyfastcdc/py/__init__.py +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/pyfastcdc/py/chunk.py +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/pyfastcdc/py/constants.py +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/pyfastcdc/py/fastcdc.py +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/pyfastcdc/py.typed +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/pyfastcdc/utils.py +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/pyfastcdc.egg-info/dependency_links.txt +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/pyfastcdc.egg-info/requires.txt +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/pyfastcdc.egg-info/top_level.txt +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/requirements.dev.txt +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/requirements.txt +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/setup.cfg +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/tests/test_arguments.py +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/tests/test_correctness.py +0 -0
- {pyfastcdc-0.3.0 → pyfastcdc-0.3.1}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyfastcdc
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: A high-performance FastCDC 2020 implementation written in Python + Cython
|
|
5
5
|
Author: Fallen_Breath
|
|
6
6
|
License: MIT
|
|
@@ -15,6 +15,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
18
19
|
Requires-Python: >=3.6
|
|
19
20
|
Description-Content-Type: text/markdown
|
|
20
21
|
License-File: LICENSE
|
|
@@ -44,7 +45,7 @@ Dynamic: summary
|
|
|
44
45
|
|
|
45
46
|
A high-performance FastCDC 2020 implementation written in Python + [Cython](https://github.com/cython/cython)
|
|
46
47
|
|
|
47
|
-
Supports Python 3.6+. Provides prebuilt wheels for Python 3.
|
|
48
|
+
Supports Python 3.6+. Provides prebuilt wheels for Python 3.9+
|
|
48
49
|
|
|
49
50
|
Its core algorithm implementation is a direct port of the v2020 module from [nlfiedler/fastcdc-rs](https://github.com/nlfiedler/fastcdc-rs),
|
|
50
51
|
which means that the output of PyFastCDC completely matches the output of nlfiedler/fastcdc-rs
|
|
@@ -67,7 +68,7 @@ which is significantly slower (about 0.5% or less in memory chunking speed)
|
|
|
67
68
|
|
|
68
69
|
<details>
|
|
69
70
|
|
|
70
|
-
<summary>I only want to use the Cython
|
|
71
|
+
<summary>I only want to use the Cython implementation, not the slow pure-Python one</summary>
|
|
71
72
|
|
|
72
73
|
You can set the environment variable `PYFASTCDC_REQUIRE_CYTHON=true` or `PYFASTCDC_REQUIRE_CYTHON=1` for the `pip` installation command
|
|
73
74
|
to disable the pure-Python fallback on extension compilation error and make the installation fail hard.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
A high-performance FastCDC 2020 implementation written in Python + [Cython](https://github.com/cython/cython)
|
|
8
8
|
|
|
9
|
-
Supports Python 3.6+. Provides prebuilt wheels for Python 3.
|
|
9
|
+
Supports Python 3.6+. Provides prebuilt wheels for Python 3.9+
|
|
10
10
|
|
|
11
11
|
Its core algorithm implementation is a direct port of the v2020 module from [nlfiedler/fastcdc-rs](https://github.com/nlfiedler/fastcdc-rs),
|
|
12
12
|
which means that the output of PyFastCDC completely matches the output of nlfiedler/fastcdc-rs
|
|
@@ -29,7 +29,7 @@ which is significantly slower (about 0.5% or less in memory chunking speed)
|
|
|
29
29
|
|
|
30
30
|
<details>
|
|
31
31
|
|
|
32
|
-
<summary>I only want to use the Cython
|
|
32
|
+
<summary>I only want to use the Cython implementation, not the slow pure-Python one</summary>
|
|
33
33
|
|
|
34
34
|
You can set the environment variable `PYFASTCDC_REQUIRE_CYTHON=true` or `PYFASTCDC_REQUIRE_CYTHON=1` for the `pip` installation command
|
|
35
35
|
to disable the pure-Python fallback on extension compilation error and make the installation fail hard.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyfastcdc
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: A high-performance FastCDC 2020 implementation written in Python + Cython
|
|
5
5
|
Author: Fallen_Breath
|
|
6
6
|
License: MIT
|
|
@@ -15,6 +15,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
18
19
|
Requires-Python: >=3.6
|
|
19
20
|
Description-Content-Type: text/markdown
|
|
20
21
|
License-File: LICENSE
|
|
@@ -44,7 +45,7 @@ Dynamic: summary
|
|
|
44
45
|
|
|
45
46
|
A high-performance FastCDC 2020 implementation written in Python + [Cython](https://github.com/cython/cython)
|
|
46
47
|
|
|
47
|
-
Supports Python 3.6+. Provides prebuilt wheels for Python 3.
|
|
48
|
+
Supports Python 3.6+. Provides prebuilt wheels for Python 3.9+
|
|
48
49
|
|
|
49
50
|
Its core algorithm implementation is a direct port of the v2020 module from [nlfiedler/fastcdc-rs](https://github.com/nlfiedler/fastcdc-rs),
|
|
50
51
|
which means that the output of PyFastCDC completely matches the output of nlfiedler/fastcdc-rs
|
|
@@ -67,7 +68,7 @@ which is significantly slower (about 0.5% or less in memory chunking speed)
|
|
|
67
68
|
|
|
68
69
|
<details>
|
|
69
70
|
|
|
70
|
-
<summary>I only want to use the Cython
|
|
71
|
+
<summary>I only want to use the Cython implementation, not the slow pure-Python one</summary>
|
|
71
72
|
|
|
72
73
|
You can set the environment variable `PYFASTCDC_REQUIRE_CYTHON=true` or `PYFASTCDC_REQUIRE_CYTHON=1` for the `pip` installation command
|
|
73
74
|
to disable the pure-Python fallback on extension compilation error and make the installation fail hard.
|
|
@@ -92,7 +92,10 @@ else:
|
|
|
92
92
|
from Cython.Build import cythonize
|
|
93
93
|
ext_modules = cythonize(
|
|
94
94
|
'pyfastcdc/cy/*.pyx',
|
|
95
|
-
compiler_directives={
|
|
95
|
+
compiler_directives={
|
|
96
|
+
'language_level': '3',
|
|
97
|
+
**({'freethreading_compatible': True} if sys.version_info >= (3, 13) else {}),
|
|
98
|
+
},
|
|
96
99
|
)
|
|
97
100
|
|
|
98
101
|
print(f'setuptools_version: {setuptools_version}')
|
|
@@ -135,6 +138,7 @@ setup(
|
|
|
135
138
|
'Programming Language :: Python :: 3.12',
|
|
136
139
|
'Programming Language :: Python :: 3.13',
|
|
137
140
|
'Programming Language :: Python :: 3.14',
|
|
141
|
+
'Programming Language :: Python :: 3.15',
|
|
138
142
|
],
|
|
139
143
|
ext_modules=ext_modules,
|
|
140
144
|
cmdclass={'build_ext': BuildExt},
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import subprocess
|
|
3
|
+
import sys
|
|
4
|
+
import sysconfig
|
|
5
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
6
|
+
from io import BytesIO
|
|
7
|
+
from threading import Barrier
|
|
8
|
+
|
|
9
|
+
import pytest
|
|
10
|
+
|
|
11
|
+
from pyfastcdc import FastCDC
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@pytest.mark.skipif(not sysconfig.get_config_var('Py_GIL_DISABLED'), reason='requires free-threaded Python')
|
|
15
|
+
def test_import_keeps_gil_disabled():
|
|
16
|
+
# Check the first import in a fresh process, without forcing the GIL off.
|
|
17
|
+
env = os.environ.copy()
|
|
18
|
+
env.pop('PYTHON_GIL', None)
|
|
19
|
+
result = subprocess.run(
|
|
20
|
+
[sys.executable, '-c', (
|
|
21
|
+
'import sys; assert not sys._is_gil_enabled(); '
|
|
22
|
+
'import pyfastcdc; assert not sys._is_gil_enabled()'
|
|
23
|
+
)],
|
|
24
|
+
env=env, capture_output=True, text=True, timeout=30,
|
|
25
|
+
)
|
|
26
|
+
assert result.returncode == 0, result.stdout + result.stderr
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@pytest.mark.parametrize('method', ['buf', 'stream'])
|
|
30
|
+
def test_independent_instances_in_parallel(method, random_data_1m):
|
|
31
|
+
def collect(seed, data):
|
|
32
|
+
cdc = FastCDC(avg_size=4096, seed=seed)
|
|
33
|
+
chunks = cdc.cut_buf(data) if method == 'buf' else cdc.cut_stream(BytesIO(data))
|
|
34
|
+
# Copy each stream chunk before advancing the iterator and reusing its buffer.
|
|
35
|
+
return [(chunk.offset, chunk.length, chunk.gear_hash, bytes(chunk.data)) for chunk in chunks]
|
|
36
|
+
|
|
37
|
+
cases = [(seed, bytes([seed]) + random_data_1m) for seed in (0, 1)]
|
|
38
|
+
expected = [collect(*case) for case in cases]
|
|
39
|
+
start = Barrier(len(cases), timeout=30)
|
|
40
|
+
free_threaded = bool(sysconfig.get_config_var('Py_GIL_DISABLED'))
|
|
41
|
+
|
|
42
|
+
def worker(case):
|
|
43
|
+
start.wait()
|
|
44
|
+
if free_threaded:
|
|
45
|
+
assert not sys._is_gil_enabled()
|
|
46
|
+
result = collect(*case)
|
|
47
|
+
if free_threaded:
|
|
48
|
+
assert not sys._is_gil_enabled()
|
|
49
|
+
return result
|
|
50
|
+
|
|
51
|
+
with ThreadPoolExecutor(max_workers=len(cases)) as pool:
|
|
52
|
+
futures = [pool.submit(worker, case) for case in cases]
|
|
53
|
+
actual = [future.result() for future in futures]
|
|
54
|
+
assert actual == expected
|
pyfastcdc-0.3.0/pyproject.toml
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|