pyfastcdc 0.2.0b1__tar.gz → 0.3.0__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.2.0b1/pyfastcdc.egg-info → pyfastcdc-0.3.0}/PKG-INFO +40 -8
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/README.md +38 -6
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/pyfastcdc/__init__.py +1 -1
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/pyfastcdc/__init__.pyi +2 -0
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/pyfastcdc/cy/fastcdc.pyx +2 -2
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/pyfastcdc/py/fastcdc.py +2 -1
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/pyfastcdc/utils.py +10 -0
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0/pyfastcdc.egg-info}/PKG-INFO +40 -8
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/pyfastcdc.egg-info/SOURCES.txt +2 -1
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/setup.py +18 -9
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/tests/test_arguments.py +1 -1
- pyfastcdc-0.3.0/tests/test_correctness.py +679 -0
- pyfastcdc-0.3.0/tests/test_utils.py +61 -0
- pyfastcdc-0.2.0b1/tests/test_correctness.py +0 -454
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/LICENSE +0 -0
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/MANIFEST.in +0 -0
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/pyfastcdc/common.py +0 -0
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/pyfastcdc/cy/__init__.py +0 -0
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/pyfastcdc/cy/chunk.pxd +0 -0
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/pyfastcdc/cy/chunk.pyx +0 -0
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/pyfastcdc/cy/constants.pxd +0 -0
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/pyfastcdc/cy/constants.pyx +0 -0
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/pyfastcdc/py/__init__.py +0 -0
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/pyfastcdc/py/chunk.py +0 -0
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/pyfastcdc/py/constants.py +0 -0
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/pyfastcdc/py.typed +0 -0
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/pyfastcdc.egg-info/dependency_links.txt +0 -0
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/pyfastcdc.egg-info/requires.txt +0 -0
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/pyfastcdc.egg-info/top_level.txt +0 -0
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/pyproject.toml +0 -0
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/requirements.dev.txt +0 -0
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/requirements.txt +0 -0
- {pyfastcdc-0.2.0b1 → pyfastcdc-0.3.0}/setup.cfg +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyfastcdc
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: FastCDC 2020 implementation in Python
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: A high-performance FastCDC 2020 implementation written in Python + Cython
|
|
5
5
|
Author: Fallen_Breath
|
|
6
6
|
License: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/Fallen-Breath/pyfastcdc
|
|
@@ -42,7 +42,7 @@ Dynamic: summary
|
|
|
42
42
|
[](https://github.com/Fallen-Breath/pyfastcdc/issues)
|
|
43
43
|
[](https://pypi.org/project/pyfastcdc)
|
|
44
44
|
|
|
45
|
-
A FastCDC 2020 implementation written in Python
|
|
45
|
+
A high-performance FastCDC 2020 implementation written in Python + [Cython](https://github.com/cython/cython)
|
|
46
46
|
|
|
47
47
|
Supports Python 3.6+. Provides prebuilt wheels for Python 3.8+
|
|
48
48
|
|
|
@@ -63,14 +63,46 @@ For platforms without prebuilt wheels, a suitable build environment capable of c
|
|
|
63
63
|
For example, on Debian, you might need to install `gcc` and `python3-dev` via `apt`
|
|
64
64
|
|
|
65
65
|
If the Cython extension fails to compile, the installation will fall back to a pure Python implementation,
|
|
66
|
-
which is significantly slower (
|
|
66
|
+
which is significantly slower (about 0.5% or less in memory chunking speed)
|
|
67
|
+
|
|
68
|
+
<details>
|
|
69
|
+
|
|
70
|
+
<summary>I only want to use the Cython implemetion, not the slow pure-Python one</summary>
|
|
71
|
+
|
|
72
|
+
You can set the environment variable `PYFASTCDC_REQUIRE_CYTHON=true` or `PYFASTCDC_REQUIRE_CYTHON=1` for the `pip` installation command
|
|
73
|
+
to disable the pure-Python fallback on extension compilation error and make the installation fail hard.
|
|
74
|
+
Thus, after a successful installation, you will always have a working Cython extension
|
|
75
|
+
|
|
76
|
+
Example bash command using `pip`:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
$ PYFASTCDC_REQUIRE_CYTHON=true pip install pyfastcdc
|
|
80
|
+
... some pip output ...
|
|
81
|
+
Building wheels for collected packages: pyfastcdc
|
|
82
|
+
Building wheel for pyfastcdc (pyproject.toml) ... error
|
|
83
|
+
... some pip output ...
|
|
84
|
+
###########################################################################################################
|
|
85
|
+
Failed to compile pyfastcdc Cython extension, fail hard since PYFASTCDC_REQUIRE_CYTHON is set to true
|
|
86
|
+
Unset PYFASTCDC_REQUIRE_CYTHON to allow pure-Python fallback if that's acceptable for your use case.
|
|
87
|
+
<class 'distutils.compilers.C.errors.CompileError'> command 'gcc' failed: No such file or directory
|
|
88
|
+
###########################################################################################################
|
|
89
|
+
error: command 'gcc' failed: No such file or directory
|
|
90
|
+
----------------------------------------
|
|
91
|
+
ERROR: Failed building wheel for pyfastcdc
|
|
92
|
+
... some pip output ...
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
</details>
|
|
67
96
|
|
|
68
97
|
## Usage
|
|
69
98
|
|
|
70
|
-
The
|
|
99
|
+
The usage of PyFastCDC is simple:
|
|
71
100
|
|
|
72
101
|
1. Construct a `FastCDC` instance with desired parameters
|
|
73
102
|
2. Call `FastCDC.cut_xxx()` function to chunk your data
|
|
103
|
+
- Call `cut_buf()` to chunk in-memory data buffers
|
|
104
|
+
- Call `cut_file()` to chunk a regular file using mmap
|
|
105
|
+
- Call `cut_stream()` to chunk a custom file-like streaming object
|
|
74
106
|
|
|
75
107
|
Example:
|
|
76
108
|
|
|
@@ -88,8 +120,8 @@ Please only import members from `pyfastcdc` in your application code and avoid i
|
|
|
88
120
|
Only public APIs inside the `pyfastcdc` module are guaranteed to be stable across releases
|
|
89
121
|
|
|
90
122
|
```python
|
|
91
|
-
from pyfastcdc import
|
|
92
|
-
from pyfastcdc.common import
|
|
123
|
+
from pyfastcdc import NormalizedChunking # GOOD
|
|
124
|
+
from pyfastcdc.common import NormalizedChunking # BAD, no API stability guarantee
|
|
93
125
|
```
|
|
94
126
|
|
|
95
127
|
## Performance
|
|
@@ -114,7 +146,7 @@ FastCDC parameters:
|
|
|
114
146
|
|
|
115
147
|
Test environment:
|
|
116
148
|
|
|
117
|
-
- PyFastCDC 0.
|
|
149
|
+
- PyFastCDC 0.2.0b1, precompiled wheel from Test PyPI, Cython 3.2.4
|
|
118
150
|
- Python 3.11.14 using docker image `python:3.11`
|
|
119
151
|
- Ryzen 7 6800H @ 4.55GHz, NVMe SSD, Debian 13.2
|
|
120
152
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://github.com/Fallen-Breath/pyfastcdc/issues)
|
|
5
5
|
[](https://pypi.org/project/pyfastcdc)
|
|
6
6
|
|
|
7
|
-
A FastCDC 2020 implementation written in Python
|
|
7
|
+
A high-performance FastCDC 2020 implementation written in Python + [Cython](https://github.com/cython/cython)
|
|
8
8
|
|
|
9
9
|
Supports Python 3.6+. Provides prebuilt wheels for Python 3.8+
|
|
10
10
|
|
|
@@ -25,14 +25,46 @@ For platforms without prebuilt wheels, a suitable build environment capable of c
|
|
|
25
25
|
For example, on Debian, you might need to install `gcc` and `python3-dev` via `apt`
|
|
26
26
|
|
|
27
27
|
If the Cython extension fails to compile, the installation will fall back to a pure Python implementation,
|
|
28
|
-
which is significantly slower (
|
|
28
|
+
which is significantly slower (about 0.5% or less in memory chunking speed)
|
|
29
|
+
|
|
30
|
+
<details>
|
|
31
|
+
|
|
32
|
+
<summary>I only want to use the Cython implemetion, not the slow pure-Python one</summary>
|
|
33
|
+
|
|
34
|
+
You can set the environment variable `PYFASTCDC_REQUIRE_CYTHON=true` or `PYFASTCDC_REQUIRE_CYTHON=1` for the `pip` installation command
|
|
35
|
+
to disable the pure-Python fallback on extension compilation error and make the installation fail hard.
|
|
36
|
+
Thus, after a successful installation, you will always have a working Cython extension
|
|
37
|
+
|
|
38
|
+
Example bash command using `pip`:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
$ PYFASTCDC_REQUIRE_CYTHON=true pip install pyfastcdc
|
|
42
|
+
... some pip output ...
|
|
43
|
+
Building wheels for collected packages: pyfastcdc
|
|
44
|
+
Building wheel for pyfastcdc (pyproject.toml) ... error
|
|
45
|
+
... some pip output ...
|
|
46
|
+
###########################################################################################################
|
|
47
|
+
Failed to compile pyfastcdc Cython extension, fail hard since PYFASTCDC_REQUIRE_CYTHON is set to true
|
|
48
|
+
Unset PYFASTCDC_REQUIRE_CYTHON to allow pure-Python fallback if that's acceptable for your use case.
|
|
49
|
+
<class 'distutils.compilers.C.errors.CompileError'> command 'gcc' failed: No such file or directory
|
|
50
|
+
###########################################################################################################
|
|
51
|
+
error: command 'gcc' failed: No such file or directory
|
|
52
|
+
----------------------------------------
|
|
53
|
+
ERROR: Failed building wheel for pyfastcdc
|
|
54
|
+
... some pip output ...
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
</details>
|
|
29
58
|
|
|
30
59
|
## Usage
|
|
31
60
|
|
|
32
|
-
The
|
|
61
|
+
The usage of PyFastCDC is simple:
|
|
33
62
|
|
|
34
63
|
1. Construct a `FastCDC` instance with desired parameters
|
|
35
64
|
2. Call `FastCDC.cut_xxx()` function to chunk your data
|
|
65
|
+
- Call `cut_buf()` to chunk in-memory data buffers
|
|
66
|
+
- Call `cut_file()` to chunk a regular file using mmap
|
|
67
|
+
- Call `cut_stream()` to chunk a custom file-like streaming object
|
|
36
68
|
|
|
37
69
|
Example:
|
|
38
70
|
|
|
@@ -50,8 +82,8 @@ Please only import members from `pyfastcdc` in your application code and avoid i
|
|
|
50
82
|
Only public APIs inside the `pyfastcdc` module are guaranteed to be stable across releases
|
|
51
83
|
|
|
52
84
|
```python
|
|
53
|
-
from pyfastcdc import
|
|
54
|
-
from pyfastcdc.common import
|
|
85
|
+
from pyfastcdc import NormalizedChunking # GOOD
|
|
86
|
+
from pyfastcdc.common import NormalizedChunking # BAD, no API stability guarantee
|
|
55
87
|
```
|
|
56
88
|
|
|
57
89
|
## Performance
|
|
@@ -76,7 +108,7 @@ FastCDC parameters:
|
|
|
76
108
|
|
|
77
109
|
Test environment:
|
|
78
110
|
|
|
79
|
-
- PyFastCDC 0.
|
|
111
|
+
- PyFastCDC 0.2.0b1, precompiled wheel from Test PyPI, Cython 3.2.4
|
|
80
112
|
- Python 3.11.14 using docker image `python:3.11`
|
|
81
113
|
- Ryzen 7 6800H @ 4.55GHz, NVMe SSD, Debian 13.2
|
|
82
114
|
|
|
@@ -32,7 +32,7 @@ cdef uint64_t AVG_SIZE_UPPER_BOUND = 4 * 1048576
|
|
|
32
32
|
cdef uint64_t MAX_SIZE_UPPER_BOUND = 16 * 1048576
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
#
|
|
35
|
+
# docstrings are in pyfastcdc/__init__.pyi
|
|
36
36
|
cdef class FastCDC:
|
|
37
37
|
cdef _Config config
|
|
38
38
|
cdef uint64_t* gear_holder
|
|
@@ -66,7 +66,7 @@ cdef class FastCDC:
|
|
|
66
66
|
self.config.min_size = min_size
|
|
67
67
|
self.config.max_size = max_size
|
|
68
68
|
|
|
69
|
-
bits =
|
|
69
|
+
bits = utils.logarithm2(avg_size)
|
|
70
70
|
self.config.mask_s = MASKS[bits + normalized_chunking]
|
|
71
71
|
self.config.mask_l = MASKS[bits - normalized_chunking]
|
|
72
72
|
self.config.mask_s_ls = self.config.mask_s << 1
|
|
@@ -48,6 +48,7 @@ class _Config:
|
|
|
48
48
|
self.gear_ls = gear_ls
|
|
49
49
|
|
|
50
50
|
|
|
51
|
+
# docstrings are in pyfastcdc/__init__.pyi
|
|
51
52
|
class FastCDC:
|
|
52
53
|
MIN_SIZE_LOWER_BOUND: ClassVar[int] = 64
|
|
53
54
|
AVG_SIZE_LOWER_BOUND: ClassVar[int] = 256
|
|
@@ -80,7 +81,7 @@ class FastCDC:
|
|
|
80
81
|
if not (0 <= normalized_chunking <= 3):
|
|
81
82
|
raise ValueError(f'normalized_chunking {normalized_chunking} is out of range [0, 3]')
|
|
82
83
|
|
|
83
|
-
bits =
|
|
84
|
+
bits = utils.logarithm2(avg_size)
|
|
84
85
|
mask_s = MASKS[bits + normalized_chunking]
|
|
85
86
|
mask_l = MASKS[bits - normalized_chunking]
|
|
86
87
|
mask_s_ls = (mask_s << 1) & _UINT64_MASK
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import math
|
|
1
2
|
import mmap
|
|
2
3
|
import os
|
|
3
4
|
from pathlib import Path
|
|
@@ -8,6 +9,15 @@ from pyfastcdc.common import BinaryStreamReader
|
|
|
8
9
|
ReadintoFunc = Callable[[memoryview], int]
|
|
9
10
|
|
|
10
11
|
|
|
12
|
+
def logarithm2(value: int) -> int:
|
|
13
|
+
# The same as the nlfiedler/fastcdc-rs v4.0.1 Rust implementation: (value as f64).log2().round() as u32
|
|
14
|
+
if value < 0:
|
|
15
|
+
raise ValueError(f'value must be non-negative, got {value}')
|
|
16
|
+
if value == 0:
|
|
17
|
+
return 0
|
|
18
|
+
return math.floor(math.log2(value) + 0.5)
|
|
19
|
+
|
|
20
|
+
|
|
11
21
|
def create_memoryview_from_buffer(buf: Union[bytes, bytearray, memoryview]) -> memoryview:
|
|
12
22
|
if isinstance(buf, (bytes, bytearray, memoryview)):
|
|
13
23
|
return memoryview(buf)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyfastcdc
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: FastCDC 2020 implementation in Python
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: A high-performance FastCDC 2020 implementation written in Python + Cython
|
|
5
5
|
Author: Fallen_Breath
|
|
6
6
|
License: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/Fallen-Breath/pyfastcdc
|
|
@@ -42,7 +42,7 @@ Dynamic: summary
|
|
|
42
42
|
[](https://github.com/Fallen-Breath/pyfastcdc/issues)
|
|
43
43
|
[](https://pypi.org/project/pyfastcdc)
|
|
44
44
|
|
|
45
|
-
A FastCDC 2020 implementation written in Python
|
|
45
|
+
A high-performance FastCDC 2020 implementation written in Python + [Cython](https://github.com/cython/cython)
|
|
46
46
|
|
|
47
47
|
Supports Python 3.6+. Provides prebuilt wheels for Python 3.8+
|
|
48
48
|
|
|
@@ -63,14 +63,46 @@ For platforms without prebuilt wheels, a suitable build environment capable of c
|
|
|
63
63
|
For example, on Debian, you might need to install `gcc` and `python3-dev` via `apt`
|
|
64
64
|
|
|
65
65
|
If the Cython extension fails to compile, the installation will fall back to a pure Python implementation,
|
|
66
|
-
which is significantly slower (
|
|
66
|
+
which is significantly slower (about 0.5% or less in memory chunking speed)
|
|
67
|
+
|
|
68
|
+
<details>
|
|
69
|
+
|
|
70
|
+
<summary>I only want to use the Cython implemetion, not the slow pure-Python one</summary>
|
|
71
|
+
|
|
72
|
+
You can set the environment variable `PYFASTCDC_REQUIRE_CYTHON=true` or `PYFASTCDC_REQUIRE_CYTHON=1` for the `pip` installation command
|
|
73
|
+
to disable the pure-Python fallback on extension compilation error and make the installation fail hard.
|
|
74
|
+
Thus, after a successful installation, you will always have a working Cython extension
|
|
75
|
+
|
|
76
|
+
Example bash command using `pip`:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
$ PYFASTCDC_REQUIRE_CYTHON=true pip install pyfastcdc
|
|
80
|
+
... some pip output ...
|
|
81
|
+
Building wheels for collected packages: pyfastcdc
|
|
82
|
+
Building wheel for pyfastcdc (pyproject.toml) ... error
|
|
83
|
+
... some pip output ...
|
|
84
|
+
###########################################################################################################
|
|
85
|
+
Failed to compile pyfastcdc Cython extension, fail hard since PYFASTCDC_REQUIRE_CYTHON is set to true
|
|
86
|
+
Unset PYFASTCDC_REQUIRE_CYTHON to allow pure-Python fallback if that's acceptable for your use case.
|
|
87
|
+
<class 'distutils.compilers.C.errors.CompileError'> command 'gcc' failed: No such file or directory
|
|
88
|
+
###########################################################################################################
|
|
89
|
+
error: command 'gcc' failed: No such file or directory
|
|
90
|
+
----------------------------------------
|
|
91
|
+
ERROR: Failed building wheel for pyfastcdc
|
|
92
|
+
... some pip output ...
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
</details>
|
|
67
96
|
|
|
68
97
|
## Usage
|
|
69
98
|
|
|
70
|
-
The
|
|
99
|
+
The usage of PyFastCDC is simple:
|
|
71
100
|
|
|
72
101
|
1. Construct a `FastCDC` instance with desired parameters
|
|
73
102
|
2. Call `FastCDC.cut_xxx()` function to chunk your data
|
|
103
|
+
- Call `cut_buf()` to chunk in-memory data buffers
|
|
104
|
+
- Call `cut_file()` to chunk a regular file using mmap
|
|
105
|
+
- Call `cut_stream()` to chunk a custom file-like streaming object
|
|
74
106
|
|
|
75
107
|
Example:
|
|
76
108
|
|
|
@@ -88,8 +120,8 @@ Please only import members from `pyfastcdc` in your application code and avoid i
|
|
|
88
120
|
Only public APIs inside the `pyfastcdc` module are guaranteed to be stable across releases
|
|
89
121
|
|
|
90
122
|
```python
|
|
91
|
-
from pyfastcdc import
|
|
92
|
-
from pyfastcdc.common import
|
|
123
|
+
from pyfastcdc import NormalizedChunking # GOOD
|
|
124
|
+
from pyfastcdc.common import NormalizedChunking # BAD, no API stability guarantee
|
|
93
125
|
```
|
|
94
126
|
|
|
95
127
|
## Performance
|
|
@@ -114,7 +146,7 @@ FastCDC parameters:
|
|
|
114
146
|
|
|
115
147
|
Test environment:
|
|
116
148
|
|
|
117
|
-
- PyFastCDC 0.
|
|
149
|
+
- PyFastCDC 0.2.0b1, precompiled wheel from Test PyPI, Cython 3.2.4
|
|
118
150
|
- Python 3.11.14 using docker image `python:3.11`
|
|
119
151
|
- Ryzen 7 6800H @ 4.55GHz, NVMe SSD, Debian 13.2
|
|
120
152
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import ast
|
|
2
2
|
import contextlib
|
|
3
3
|
import functools
|
|
4
|
+
import os
|
|
4
5
|
import sys
|
|
5
6
|
from pathlib import Path
|
|
6
7
|
from typing import List
|
|
@@ -56,21 +57,23 @@ class BuildExt(build_ext):
|
|
|
56
57
|
def __init__(self, *args, **kwargs):
|
|
57
58
|
super().__init__(*args, **kwargs)
|
|
58
59
|
|
|
59
|
-
try:
|
|
60
|
-
from Cython import __version__ as cython_version
|
|
61
|
-
except ImportError:
|
|
62
|
-
cython_version = 'N/A'
|
|
63
|
-
print(f'Cython version: {cython_version}')
|
|
64
|
-
|
|
65
60
|
@classmethod
|
|
66
61
|
@contextlib.contextmanager
|
|
67
62
|
def __wrap_ext_err(cls):
|
|
63
|
+
require_cython = os.environ.get('PYFASTCDC_REQUIRE_CYTHON', '').lower() in ['true', '1']
|
|
68
64
|
try:
|
|
69
65
|
yield
|
|
70
66
|
except Exception as e:
|
|
67
|
+
if require_cython:
|
|
68
|
+
print("###########################################################################################################", file=sys.stderr)
|
|
69
|
+
print("Failed to compile pyfastcdc Cython extension, fail hard since PYFASTCDC_REQUIRE_CYTHON is set to true", file=sys.stderr)
|
|
70
|
+
print("Unset PYFASTCDC_REQUIRE_CYTHON to allow pure-Python fallback if that's acceptable for your use case.", file=sys.stderr)
|
|
71
|
+
print(type(e), e, file=sys.stderr)
|
|
72
|
+
print("###########################################################################################################", file=sys.stderr)
|
|
73
|
+
raise e
|
|
71
74
|
print("###########################################################################################################", file=sys.stderr)
|
|
72
|
-
print("Failed to compile pyfastcdc
|
|
73
|
-
print(e)
|
|
75
|
+
print("Failed to compile pyfastcdc Cython extension, fallback to pure python implementation with is a lot slower", file=sys.stderr)
|
|
76
|
+
print(type(e), e, file=sys.stderr)
|
|
74
77
|
print("###########################################################################################################", file=sys.stderr)
|
|
75
78
|
|
|
76
79
|
def run(self):
|
|
@@ -94,10 +97,16 @@ else:
|
|
|
94
97
|
|
|
95
98
|
print(f'setuptools_version: {setuptools_version}')
|
|
96
99
|
use_license_expression = parse_major(setuptools_version) >= 77
|
|
100
|
+
try:
|
|
101
|
+
from Cython import __version__ as cython_version
|
|
102
|
+
except ImportError:
|
|
103
|
+
cython_version = 'N/A'
|
|
104
|
+
print(f'Cython version: {cython_version}')
|
|
105
|
+
|
|
97
106
|
setup(
|
|
98
107
|
name='pyfastcdc',
|
|
99
108
|
version=get_version(),
|
|
100
|
-
description='FastCDC 2020 implementation in Python
|
|
109
|
+
description='A high-performance FastCDC 2020 implementation written in Python + Cython',
|
|
101
110
|
long_description=read_file('README.md'),
|
|
102
111
|
long_description_content_type='text/markdown',
|
|
103
112
|
author='Fallen_Breath',
|