crcmod-plus 2.1.0__tar.gz → 2.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.
@@ -1,32 +1,10 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: crcmod-plus
3
- Version: 2.1.0
3
+ Version: 2.3.1
4
4
  Summary: CRC generator - modernized
5
5
  Author-email: Ray Buvel <rlbuvel@gmail.com>
6
6
  Maintainer-email: Tamas Nepusz <tamas@sxd.hu>
7
- License: ----------------------------------------------------------------------------
8
- Copyright (c) 2010 Raymond L. Buvel
9
- Copyright (c) 2010 Craig McQueen
10
-
11
- Permission is hereby granted, free of charge, to any person obtaining a copy
12
- of this software and associated documentation files (the "Software"), to deal
13
- in the Software without restriction, including without limitation the rights
14
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- copies of the Software, and to permit persons to whom the Software is
16
- furnished to do so, subject to the following conditions:
17
-
18
- The above copyright notice and this permission notice shall be included in
19
- all copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
- SOFTWARE.
28
- ----------------------------------------------------------------------------
29
-
7
+ License-Expression: MIT
30
8
  Project-URL: Changelog, https://github.com/ntamas/crcmod-plus/blob/main/CHANGELOG.md
31
9
  Project-URL: Documentation, https://github.com/ntamas/crcmod-plus#readme
32
10
  Project-URL: Issues, https://github.com/ntamas/crcmod-plus/issues
@@ -37,25 +15,28 @@ Classifier: Intended Audience :: Education
37
15
  Classifier: Intended Audience :: End Users/Desktop
38
16
  Classifier: Intended Audience :: Information Technology
39
17
  Classifier: Intended Audience :: Science/Research
40
- Classifier: License :: OSI Approved :: MIT License
41
18
  Classifier: Operating System :: OS Independent
42
19
  Classifier: Programming Language :: C
43
20
  Classifier: Programming Language :: C++
44
21
  Classifier: Programming Language :: Python
45
22
  Classifier: Programming Language :: Python :: 3
46
- Classifier: Programming Language :: Python :: 3.7
47
- Classifier: Programming Language :: Python :: 3.8
48
23
  Classifier: Programming Language :: Python :: 3.9
49
24
  Classifier: Programming Language :: Python :: 3.10
50
25
  Classifier: Programming Language :: Python :: 3.11
26
+ Classifier: Programming Language :: Python :: 3.12
27
+ Classifier: Programming Language :: Python :: 3.13
28
+ Classifier: Programming Language :: Python :: 3.14
51
29
  Classifier: Topic :: Communications
52
30
  Classifier: Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator
53
31
  Classifier: Topic :: Scientific/Engineering :: Mathematics
54
32
  Classifier: Topic :: Utilities
55
- Requires-Python: >=3.7
33
+ Requires-Python: >=3.9
56
34
  Description-Content-Type: text/markdown
57
- Provides-Extra: dev
58
35
  License-File: LICENSE.txt
36
+ Requires-Dist: typing_extensions; python_version < "3.8"
37
+ Provides-Extra: dev
38
+ Requires-Dist: pytest; extra == "dev"
39
+ Dynamic: license-file
59
40
 
60
41
  [![Build status](https://github.com/ntamas/crcmod-plus/actions/workflows/build.yml/badge.svg)](https://github.com/ntamas/crcmod-plus/actions/workflows/build.yml)
61
42
 
@@ -604,5 +604,9 @@ PyInit__crcfunext(void)
604
604
  Py_FatalError("crcfunext: One of the data types is invalid");
605
605
  }
606
606
 
607
- return PyModule_Create(&moduleDef);
607
+ PyObject* mod = PyModule_Create(&moduleDef);
608
+ #ifdef Py_GIL_DISABLED
609
+ PyUnstable_Module_SetGIL(mod, Py_MOD_GIL_NOT_USED);
610
+ #endif
611
+ return mod;
608
612
  }
@@ -0,0 +1,85 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "crcmod-plus"
7
+ version = "2.3.1"
8
+ authors = [{ name = "Ray Buvel", email = "rlbuvel@gmail.com" }]
9
+ description = "CRC generator - modernized"
10
+ readme = "README.md"
11
+ requires-python = ">=3.9"
12
+ maintainers = [{ name = "Tamas Nepusz", email = "tamas@sxd.hu" }]
13
+ license = "MIT"
14
+ license-files = ["LICENSE.txt"]
15
+ classifiers = [
16
+ "Development Status :: 5 - Production/Stable",
17
+ "Intended Audience :: Developers",
18
+ "Intended Audience :: Education",
19
+ "Intended Audience :: End Users/Desktop",
20
+ "Intended Audience :: Information Technology",
21
+ "Intended Audience :: Science/Research",
22
+ "Operating System :: OS Independent",
23
+ "Programming Language :: C",
24
+ "Programming Language :: C++",
25
+ "Programming Language :: Python",
26
+ "Programming Language :: Python :: 3",
27
+ "Programming Language :: Python :: 3.9",
28
+ "Programming Language :: Python :: 3.10",
29
+ "Programming Language :: Python :: 3.11",
30
+ "Programming Language :: Python :: 3.12",
31
+ "Programming Language :: Python :: 3.13",
32
+ "Programming Language :: Python :: 3.14",
33
+ "Topic :: Communications",
34
+ "Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator",
35
+ "Topic :: Scientific/Engineering :: Mathematics",
36
+ "Topic :: Utilities",
37
+ ]
38
+ dependencies = ["typing_extensions; python_version < '3.8'"]
39
+
40
+ [project.urls]
41
+ Changelog = "https://github.com/ntamas/crcmod-plus/blob/main/CHANGELOG.md"
42
+ Documentation = "https://github.com/ntamas/crcmod-plus#readme"
43
+ Issues = "https://github.com/ntamas/crcmod-plus/issues"
44
+ Source = "https://github.com/ntamas/crcmod-plus"
45
+
46
+ [project.optional-dependencies]
47
+ dev = ["pytest"]
48
+
49
+ [tool.cibuildwheel]
50
+ enable = ["cpython-freethreading", "pypy"]
51
+
52
+ [tool.ruff.lint.extend-per-file-ignores]
53
+ "predefined.py" = ["E501"]
54
+
55
+ [tool.setuptools.packages.find]
56
+ where = ["src"]
57
+
58
+ [tool.setuptools.package-data]
59
+ crcmod = ["py.typed"]
60
+
61
+ [tool.tox]
62
+ legacy_tox_ini = """
63
+ [tox]
64
+ min_version = 4.0
65
+ env_list = py314t, py314, py313t, py313, py312, py311, py310, py39, type
66
+
67
+ [gh-actions]
68
+ python =
69
+ 3.9: py39
70
+ 3.10: py310
71
+ 3.11: py311
72
+ 3.12: py312
73
+ 3.13: py313
74
+ 3.13t: py313t
75
+ 3.14: py314, type
76
+ 3.14t: py314t
77
+
78
+ [testenv]
79
+ deps = pytest
80
+ commands = pytest tests
81
+
82
+ [testenv:type]
83
+ deps = mypy
84
+ commands = mypy src
85
+ """
@@ -1,12 +1,21 @@
1
1
  from platform import python_implementation
2
2
  from setuptools import setup, Extension
3
3
  from sys import version_info
4
+ import sysconfig
4
5
  from wheel.bdist_wheel import bdist_wheel
5
6
 
7
+
8
+ def is_freethread():
9
+ if sysconfig.get_config_var("Py_GIL_DISABLED"):
10
+ return True
11
+ return False
12
+
13
+
6
14
  # fmt: off
7
15
  can_use_limited_api = (
8
16
  python_implementation() == "CPython" and
9
- version_info >= (3, 11, 0)
17
+ version_info >= (3, 11, 0) and
18
+ not is_freethread()
10
19
  )
11
20
  # fmt: on
12
21
 
@@ -32,6 +41,7 @@ setup_args = dict(
32
41
  ext_modules=[
33
42
  Extension("crcmod._crcfunext", ["lib/_crcfunext.c"], **extension_kwargs)
34
43
  ],
44
+ package_dir={"": "src"},
35
45
  cmdclass={"bdist_wheel": bdist_wheel_abi3},
36
46
  )
37
47
 
@@ -15,5 +15,6 @@ all you need is a function for CRC calculation.
15
15
 
16
16
  from .crcmod import Crc, mkCrcFun
17
17
  from ._version import __version__
18
+ from . import predefined # Auto-import for drop-in compatibility with original crcmod
18
19
 
19
- __all__ = ("Crc", "mkCrcFun", "__version__")
20
+ __all__ = ("Crc", "mkCrcFun", "__version__", "predefined")
@@ -1,2 +1,2 @@
1
- __version_tuple__ = (2, 1, 0)
1
+ __version_tuple__ = (2, 3, 1)
2
2
  __version__ = ".".join(map(str, __version_tuple__))
@@ -38,8 +38,9 @@ Buffer = Union[str, bytes, bytearray, memoryview, array]
38
38
  class CrcFun(Protocol):
39
39
  """Type alias for CRC calculator functions created by this module."""
40
40
 
41
- def __call__(self, data: Buffer, crc: int = ..., table: Sequence[int] = ...) -> int:
42
- ...
41
+ def __call__(
42
+ self, data: Buffer, crc: int = ..., table: Sequence[int] = ...
43
+ ) -> int: ...
43
44
 
44
45
 
45
46
  CrcFunNoDefaultArgs = Callable[[Buffer, int, Sequence[int]], int]
@@ -1,32 +1,10 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: crcmod-plus
3
- Version: 2.1.0
3
+ Version: 2.3.1
4
4
  Summary: CRC generator - modernized
5
5
  Author-email: Ray Buvel <rlbuvel@gmail.com>
6
6
  Maintainer-email: Tamas Nepusz <tamas@sxd.hu>
7
- License: ----------------------------------------------------------------------------
8
- Copyright (c) 2010 Raymond L. Buvel
9
- Copyright (c) 2010 Craig McQueen
10
-
11
- Permission is hereby granted, free of charge, to any person obtaining a copy
12
- of this software and associated documentation files (the "Software"), to deal
13
- in the Software without restriction, including without limitation the rights
14
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- copies of the Software, and to permit persons to whom the Software is
16
- furnished to do so, subject to the following conditions:
17
-
18
- The above copyright notice and this permission notice shall be included in
19
- all copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
- SOFTWARE.
28
- ----------------------------------------------------------------------------
29
-
7
+ License-Expression: MIT
30
8
  Project-URL: Changelog, https://github.com/ntamas/crcmod-plus/blob/main/CHANGELOG.md
31
9
  Project-URL: Documentation, https://github.com/ntamas/crcmod-plus#readme
32
10
  Project-URL: Issues, https://github.com/ntamas/crcmod-plus/issues
@@ -37,25 +15,28 @@ Classifier: Intended Audience :: Education
37
15
  Classifier: Intended Audience :: End Users/Desktop
38
16
  Classifier: Intended Audience :: Information Technology
39
17
  Classifier: Intended Audience :: Science/Research
40
- Classifier: License :: OSI Approved :: MIT License
41
18
  Classifier: Operating System :: OS Independent
42
19
  Classifier: Programming Language :: C
43
20
  Classifier: Programming Language :: C++
44
21
  Classifier: Programming Language :: Python
45
22
  Classifier: Programming Language :: Python :: 3
46
- Classifier: Programming Language :: Python :: 3.7
47
- Classifier: Programming Language :: Python :: 3.8
48
23
  Classifier: Programming Language :: Python :: 3.9
49
24
  Classifier: Programming Language :: Python :: 3.10
50
25
  Classifier: Programming Language :: Python :: 3.11
26
+ Classifier: Programming Language :: Python :: 3.12
27
+ Classifier: Programming Language :: Python :: 3.13
28
+ Classifier: Programming Language :: Python :: 3.14
51
29
  Classifier: Topic :: Communications
52
30
  Classifier: Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator
53
31
  Classifier: Topic :: Scientific/Engineering :: Mathematics
54
32
  Classifier: Topic :: Utilities
55
- Requires-Python: >=3.7
33
+ Requires-Python: >=3.9
56
34
  Description-Content-Type: text/markdown
57
- Provides-Extra: dev
58
35
  License-File: LICENSE.txt
36
+ Requires-Dist: typing_extensions; python_version < "3.8"
37
+ Provides-Extra: dev
38
+ Requires-Dist: pytest; extra == "dev"
39
+ Dynamic: license-file
59
40
 
60
41
  [![Build status](https://github.com/ntamas/crcmod-plus/actions/workflows/build.yml/badge.svg)](https://github.com/ntamas/crcmod-plus/actions/workflows/build.yml)
61
42
 
@@ -22,7 +22,6 @@
22
22
  # -----------------------------------------------------------------------------
23
23
  """Unit tests for crcmod functionality"""
24
24
 
25
-
26
25
  import unittest
27
26
 
28
27
  from array import array
@@ -1,78 +0,0 @@
1
- [build-system]
2
- requires = ["setuptools>=61", "wheel"]
3
- build-backend = "setuptools.build_meta"
4
-
5
- [project]
6
- name = "crcmod-plus"
7
- version = "2.1.0"
8
- authors = [{ name = "Ray Buvel", email = "rlbuvel@gmail.com" }]
9
- description = "CRC generator - modernized"
10
- readme = "README.md"
11
- requires-python = ">=3.7"
12
- maintainers = [{ name = "Tamas Nepusz", email = "tamas@sxd.hu" }]
13
- license = { file = "LICENSE.txt" }
14
- classifiers = [
15
- "Development Status :: 5 - Production/Stable",
16
- "Intended Audience :: Developers",
17
- "Intended Audience :: Education",
18
- "Intended Audience :: End Users/Desktop",
19
- "Intended Audience :: Information Technology",
20
- "Intended Audience :: Science/Research",
21
- "License :: OSI Approved :: MIT License",
22
- "Operating System :: OS Independent",
23
- "Programming Language :: C",
24
- "Programming Language :: C++",
25
- "Programming Language :: Python",
26
- "Programming Language :: Python :: 3",
27
- "Programming Language :: Python :: 3.7",
28
- "Programming Language :: Python :: 3.8",
29
- "Programming Language :: Python :: 3.9",
30
- "Programming Language :: Python :: 3.10",
31
- "Programming Language :: Python :: 3.11",
32
- "Topic :: Communications",
33
- "Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator",
34
- "Topic :: Scientific/Engineering :: Mathematics",
35
- "Topic :: Utilities",
36
- ]
37
- dependencies = ["typing_extensions; python_version < '3.8'"]
38
-
39
- [project.urls]
40
- Changelog = "https://github.com/ntamas/crcmod-plus/blob/main/CHANGELOG.md"
41
- Documentation = "https://github.com/ntamas/crcmod-plus#readme"
42
- Issues = "https://github.com/ntamas/crcmod-plus/issues"
43
- Source = "https://github.com/ntamas/crcmod-plus"
44
-
45
- [project.optional-dependencies]
46
- dev = ["pytest"]
47
-
48
- [tool.ruff.extend-per-file-ignores]
49
- "predefined.py" = ["E501"]
50
-
51
- [tool.setuptools.packages.find]
52
- where = ["src"]
53
-
54
- [tool.setuptools.package-data]
55
- crcmod = ["py.typed"]
56
-
57
- [tool.tox]
58
- legacy_tox_ini = """
59
- [tox]
60
- min_version = 4.0
61
- env_list = py311, py310, py39, py38, py37, type
62
-
63
- [gh-actions]
64
- python =
65
- 3.7: py37
66
- 3.8: py38
67
- 3.9: py39
68
- 3.10: py310
69
- 3.11: py311, type
70
-
71
- [testenv]
72
- deps = pytest
73
- commands = pytest tests
74
-
75
- [testenv:type]
76
- deps = mypy
77
- commands = mypy src
78
- """
File without changes
File without changes
File without changes