pyfastcdc 0.2.0__tar.gz → 0.2.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.
Files changed (31) hide show
  1. {pyfastcdc-0.2.0/pyfastcdc.egg-info → pyfastcdc-0.2.1}/PKG-INFO +39 -7
  2. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/README.md +37 -5
  3. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/pyfastcdc/__init__.py +1 -1
  4. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1/pyfastcdc.egg-info}/PKG-INFO +39 -7
  5. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/setup.py +12 -3
  6. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/LICENSE +0 -0
  7. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/MANIFEST.in +0 -0
  8. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/pyfastcdc/__init__.pyi +0 -0
  9. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/pyfastcdc/common.py +0 -0
  10. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/pyfastcdc/cy/__init__.py +0 -0
  11. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/pyfastcdc/cy/chunk.pxd +0 -0
  12. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/pyfastcdc/cy/chunk.pyx +0 -0
  13. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/pyfastcdc/cy/constants.pxd +0 -0
  14. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/pyfastcdc/cy/constants.pyx +0 -0
  15. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/pyfastcdc/cy/fastcdc.pyx +0 -0
  16. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/pyfastcdc/py/__init__.py +0 -0
  17. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/pyfastcdc/py/chunk.py +0 -0
  18. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/pyfastcdc/py/constants.py +0 -0
  19. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/pyfastcdc/py/fastcdc.py +0 -0
  20. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/pyfastcdc/py.typed +0 -0
  21. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/pyfastcdc/utils.py +0 -0
  22. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/pyfastcdc.egg-info/SOURCES.txt +0 -0
  23. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/pyfastcdc.egg-info/dependency_links.txt +0 -0
  24. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/pyfastcdc.egg-info/requires.txt +0 -0
  25. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/pyfastcdc.egg-info/top_level.txt +0 -0
  26. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/pyproject.toml +0 -0
  27. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/requirements.dev.txt +0 -0
  28. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/requirements.txt +0 -0
  29. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/setup.cfg +0 -0
  30. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/tests/test_arguments.py +0 -0
  31. {pyfastcdc-0.2.0 → pyfastcdc-0.2.1}/tests/test_correctness.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyfastcdc
3
- Version: 0.2.0
4
- Summary: FastCDC 2020 implementation in Python, with Cython acceleration
3
+ Version: 0.2.1
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
  [![Issues](https://img.shields.io/github/issues/Fallen-Breath/pyfastcdc.svg)](https://github.com/Fallen-Breath/pyfastcdc/issues)
43
43
  [![PyPI Version](https://img.shields.io/pypi/v/pyfastcdc.svg?label=PyPI)](https://pypi.org/project/pyfastcdc)
44
44
 
45
- A FastCDC 2020 implementation written in Python, with [Cython](https://github.com/cython/cython) acceleration
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 (around 0.01× or less in memory chunking speed)
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 basic usage is simple:
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 Chunk # GOOD
92
- from pyfastcdc.common import Chunk # BAD, no API stability guarantee
123
+ from pyfastcdc import NormalizedChunking # GOOD
124
+ from pyfastcdc.common import NormalizedChunking # BAD, no API stability guarantee
93
125
  ```
94
126
 
95
127
  ## Performance
@@ -4,7 +4,7 @@
4
4
  [![Issues](https://img.shields.io/github/issues/Fallen-Breath/pyfastcdc.svg)](https://github.com/Fallen-Breath/pyfastcdc/issues)
5
5
  [![PyPI Version](https://img.shields.io/pypi/v/pyfastcdc.svg?label=PyPI)](https://pypi.org/project/pyfastcdc)
6
6
 
7
- A FastCDC 2020 implementation written in Python, with [Cython](https://github.com/cython/cython) acceleration
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 (around 0.01× or less in memory chunking speed)
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 basic usage is simple:
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 Chunk # GOOD
54
- from pyfastcdc.common import Chunk # BAD, no API stability guarantee
85
+ from pyfastcdc import NormalizedChunking # GOOD
86
+ from pyfastcdc.common import NormalizedChunking # BAD, no API stability guarantee
55
87
  ```
56
88
 
57
89
  ## Performance
@@ -1,4 +1,4 @@
1
- __version__ = '0.2.0'
1
+ __version__ = '0.2.1'
2
2
 
3
3
  __all__ = [
4
4
  'BinaryStreamReader',
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyfastcdc
3
- Version: 0.2.0
4
- Summary: FastCDC 2020 implementation in Python, with Cython acceleration
3
+ Version: 0.2.1
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
  [![Issues](https://img.shields.io/github/issues/Fallen-Breath/pyfastcdc.svg)](https://github.com/Fallen-Breath/pyfastcdc/issues)
43
43
  [![PyPI Version](https://img.shields.io/pypi/v/pyfastcdc.svg?label=PyPI)](https://pypi.org/project/pyfastcdc)
44
44
 
45
- A FastCDC 2020 implementation written in Python, with [Cython](https://github.com/cython/cython) acceleration
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 (around 0.01× or less in memory chunking speed)
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 basic usage is simple:
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 Chunk # GOOD
92
- from pyfastcdc.common import Chunk # BAD, no API stability guarantee
123
+ from pyfastcdc import NormalizedChunking # GOOD
124
+ from pyfastcdc.common import NormalizedChunking # BAD, no API stability guarantee
93
125
  ```
94
126
 
95
127
  ## Performance
@@ -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
@@ -59,12 +60,20 @@ class BuildExt(build_ext):
59
60
  @classmethod
60
61
  @contextlib.contextmanager
61
62
  def __wrap_ext_err(cls):
63
+ require_cython = os.environ.get('PYFASTCDC_REQUIRE_CYTHON', '').lower() in ['true', '1']
62
64
  try:
63
65
  yield
64
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
65
74
  print("###########################################################################################################", file=sys.stderr)
66
- print("Failed to compile pyfastcdc cython extension, fallback to pure python implementation with is a lot slower", file=sys.stderr)
67
- 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)
68
77
  print("###########################################################################################################", file=sys.stderr)
69
78
 
70
79
  def run(self):
@@ -97,7 +106,7 @@ print(f'Cython version: {cython_version}')
97
106
  setup(
98
107
  name='pyfastcdc',
99
108
  version=get_version(),
100
- description='FastCDC 2020 implementation in Python, with Cython acceleration',
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',
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes