crcc 2.3.0__tar.gz → 2.5.2__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 (52) hide show
  1. {crcc-2.3.0 → crcc-2.5.2}/CHANGES.rst +17 -0
  2. {crcc-2.3.0/src/crcc.egg-info → crcc-2.5.2}/PKG-INFO +8 -7
  3. {crcc-2.3.0 → crcc-2.5.2}/README.rst +1 -1
  4. {crcc-2.3.0 → crcc-2.5.2}/docs/conf.py +18 -1
  5. crcc-2.5.2/noxfile.py +96 -0
  6. {crcc-2.3.0 → crcc-2.5.2}/pyproject.toml +38 -37
  7. {crcc-2.3.0 → crcc-2.5.2}/setup.py +14 -13
  8. {crcc-2.3.0/src/crcc → crcc-2.5.2/src}/crc.c/crc.c +1 -2
  9. {crcc-2.3.0/src/crcc → crcc-2.5.2/src}/crc.c/crc.def +1 -0
  10. {crcc-2.3.0/src/crcc → crcc-2.5.2/src}/crc.c/crc_predef.c +3 -0
  11. {crcc-2.3.0 → crcc-2.5.2}/src/crcc/__about__.py +2 -0
  12. {crcc-2.3.0 → crcc-2.5.2}/src/crcc/__init__.py +6 -2
  13. {crcc-2.3.0 → crcc-2.5.2}/src/crcc/_crc.py +6 -5
  14. {crcc-2.3.0 → crcc-2.5.2}/src/crcc/_dll.py +2 -0
  15. {crcc-2.3.0 → crcc-2.5.2}/src/crcc/_platform/__init__.py +4 -2
  16. {crcc-2.3.0 → crcc-2.5.2}/src/crcc/_platform/linux.py +4 -5
  17. {crcc-2.3.0 → crcc-2.5.2}/src/crcc/_platform/macos.py +4 -5
  18. {crcc-2.3.0 → crcc-2.5.2}/src/crcc/_platform/windows.py +4 -5
  19. {crcc-2.3.0 → crcc-2.5.2/src/crcc.egg-info}/PKG-INFO +8 -7
  20. {crcc-2.3.0 → crcc-2.5.2}/src/crcc.egg-info/SOURCES.txt +17 -17
  21. crcc-2.5.2/src/crcc.egg-info/requires.txt +3 -0
  22. {crcc-2.3.0 → crcc-2.5.2}/tests/__main__.py +2 -2
  23. {crcc-2.3.0 → crcc-2.5.2}/tests/test_crc_model.c +2 -2
  24. {crcc-2.3.0 → crcc-2.5.2}/tests/test_crc_model.py +23 -9
  25. crcc-2.3.0/noxfile.py +0 -165
  26. crcc-2.3.0/src/crcc.egg-info/requires.txt +0 -3
  27. {crcc-2.3.0 → crcc-2.5.2}/LICENSE +0 -0
  28. {crcc-2.3.0 → crcc-2.5.2}/MANIFEST.in +0 -0
  29. {crcc-2.3.0 → crcc-2.5.2}/docs/CHANGES.rst +0 -0
  30. {crcc-2.3.0 → crcc-2.5.2}/docs/README.rst +0 -0
  31. {crcc-2.3.0 → crcc-2.5.2}/docs/_static/.keep +0 -0
  32. {crcc-2.3.0 → crcc-2.5.2}/docs/_templates/.keep +0 -0
  33. {crcc-2.3.0 → crcc-2.5.2}/docs/index.rst +0 -0
  34. {crcc-2.3.0 → crcc-2.5.2}/docs/userguide.rst +0 -0
  35. {crcc-2.3.0 → crcc-2.5.2}/examples/crc_fd.c +0 -0
  36. {crcc-2.3.0 → crcc-2.5.2}/examples/crc_fd.h +0 -0
  37. {crcc-2.3.0 → crcc-2.5.2}/examples/crc_file.c +0 -0
  38. {crcc-2.3.0 → crcc-2.5.2}/examples/crc_file.h +0 -0
  39. {crcc-2.3.0 → crcc-2.5.2}/include/crcc/crc.h +0 -0
  40. {crcc-2.3.0 → crcc-2.5.2}/setup.cfg +0 -0
  41. {crcc-2.3.0/src/crcc → crcc-2.5.2/src}/crc.c/crc_defs.h +0 -0
  42. {crcc-2.3.0/src/crcc → crcc-2.5.2/src}/crc.c/crc_table.c +0 -0
  43. {crcc-2.3.0/src/crcc → crcc-2.5.2/src}/crc.c/crc_table.h +0 -0
  44. {crcc-2.3.0/src/crcc → crcc-2.5.2/src}/crc.c/crc_update.c +0 -0
  45. {crcc-2.3.0/src/crcc → crcc-2.5.2/src}/crc.c/crc_update.h +0 -0
  46. {crcc-2.3.0/src/crcc/crc.c → crcc-2.5.2/src/crcc}/crc_py.c +0 -0
  47. {crcc-2.3.0 → crcc-2.5.2}/src/crcc/py.typed +0 -0
  48. {crcc-2.3.0 → crcc-2.5.2}/src/crcc.egg-info/dependency_links.txt +0 -0
  49. {crcc-2.3.0 → crcc-2.5.2}/src/crcc.egg-info/not-zip-safe +0 -0
  50. {crcc-2.3.0 → crcc-2.5.2}/src/crcc.egg-info/top_level.txt +0 -0
  51. {crcc-2.3.0 → crcc-2.5.2}/tests/__init__.py +0 -0
  52. {crcc-2.3.0 → crcc-2.5.2}/tests/data/.keep +0 -0
@@ -1,6 +1,23 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ 2.5.2 (2026-11-29)
5
+ ------------------
6
+ - Added support for Python 3.16
7
+ - Switched to ABI3-compatible wheel builds by using the stable CPython ABI.
8
+ - Setup updates, fixes and improvements.
9
+
10
+ 2.5.1 (2026-10-05)
11
+ ------------------
12
+ - Full support for Python 3.15
13
+ - Added support for PyPy 3.12
14
+ - Added support for GraalPy 3.13
15
+ - GraalPy <= 3.12 is not supported due to 'ctypes' incompatibility.
16
+ - Dropped support for Python 3.10 (due to compatibility issues).
17
+ - Updated nox's default python to version 3.14
18
+ - Fix for nox 'lint' session.
19
+ - Setup updates, fixes and improvements.
20
+
4
21
  2.3.0 (2026-03-30)
5
22
  ------------------
6
23
  - Setup update and improvement.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crcc
3
- Version: 2.3.0
3
+ Version: 2.5.2
4
4
  Summary: C and Python CRC calculations module.
5
5
  Author-email: Adam Karpierz <adam@karpierz.net>
6
6
  Maintainer-email: Adam Karpierz <adam@karpierz.net>
@@ -21,22 +21,23 @@ Classifier: Operating System :: OS Independent
21
21
  Classifier: Programming Language :: C
22
22
  Classifier: Programming Language :: Python
23
23
  Classifier: Programming Language :: Python :: 3 :: Only
24
- Classifier: Programming Language :: Python :: 3.10
25
24
  Classifier: Programming Language :: Python :: 3.11
26
25
  Classifier: Programming Language :: Python :: 3.12
27
26
  Classifier: Programming Language :: Python :: 3.13
28
27
  Classifier: Programming Language :: Python :: 3.14
29
28
  Classifier: Programming Language :: Python :: 3.15
29
+ Classifier: Programming Language :: Python :: 3.16
30
30
  Classifier: Programming Language :: Python :: Implementation :: CPython
31
31
  Classifier: Programming Language :: Python :: Implementation :: PyPy
32
+ Classifier: Programming Language :: Python :: Implementation :: GraalPy
32
33
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
33
34
  Classifier: Typing :: Typed
34
- Requires-Python: <4.0.0,>=3.10.0
35
+ Requires-Python: <4.0.0,>=3.11.0
35
36
  Description-Content-Type: text/x-rst; charset=UTF-8
36
37
  License-File: LICENSE
37
- Requires-Dist: typing-extensions>=4.15.0
38
- Requires-Dist: pkg-about>=2.3.0
39
- Requires-Dist: py-utlx>=2.3.0
38
+ Requires-Dist: typing-extensions>=4.16.0
39
+ Requires-Dist: pkg-about>=2.5.0
40
+ Requires-Dist: py-utlx>=2.5.0
40
41
  Dynamic: license-file
41
42
 
42
43
  crcc
@@ -63,7 +64,7 @@ Installation
63
64
 
64
65
  Prerequisites:
65
66
 
66
- + Python 3.10 or higher
67
+ + Python 3.11 or higher
67
68
 
68
69
  * https://www.python.org/
69
70
 
@@ -22,7 +22,7 @@ Installation
22
22
 
23
23
  Prerequisites:
24
24
 
25
- + Python 3.10 or higher
25
+ + Python 3.11 or higher
26
26
 
27
27
  * https://www.python.org/
28
28
 
@@ -44,22 +44,29 @@ needs_sphinx = '8.1.3'
44
44
  # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
45
45
  # ones.
46
46
  extensions = [
47
+ 'myst_parser',
47
48
  'sphinx.ext.autodoc',
48
49
  'sphinx.ext.autosummary',
49
50
  'sphinx.ext.doctest',
50
51
  'sphinx.ext.intersphinx',
51
52
  #'sphinx.ext.todo',
52
53
  #'sphinx.ext.coverage',
54
+ 'sphinx.ext.viewcode',
53
55
  'sphinx.ext.ifconfig',
54
56
  'sphinx.ext.napoleon',
55
57
  'sphinx_autodoc_typehints',
56
- #'sphinx_toolbox',
57
58
  'sphinx_tabs.tabs',
59
+ 'sphinx-prompt',
58
60
  'sphinx_copybutton',
59
61
  'sphinxcontrib.spelling',
60
62
  'nbsphinx',
61
63
  ]
62
64
 
65
+ source_suffix = {
66
+ '.rst': 'restructuredtext',
67
+ '.md': 'markdown',
68
+ }
69
+
63
70
  # Needed for e.g. linkcheck builder
64
71
  tls_verify = False
65
72
 
@@ -97,6 +104,16 @@ html_static_path = ['_static']
97
104
 
98
105
  # -- Extension configuration -------------------------------------------------
99
106
 
107
+ # -- Options for MyST extension ----------------------------------------------
108
+
109
+ myst_enable_extensions = [
110
+ 'colon_fence', # ```{note} ... ```
111
+ 'deflist', # definitions list
112
+ 'fieldlist', # fields as in reST
113
+ 'html_admonition', # :::note
114
+ 'html_image', # ![alt](img.png)
115
+ ]
116
+
100
117
  # -- Options for autodoc extension -------------------------------------------
101
118
 
102
119
  autoclass_content = 'both'
crcc-2.5.2/noxfile.py ADDED
@@ -0,0 +1,96 @@
1
+ # Copyright (c) 2026 Adam Karpierz
2
+ # SPDX-License-Identifier: Zlib
3
+
4
+ # /// script
5
+ # dependencies = ["nox>=2026.10.20", "nox_ext", "nox_lib"]
6
+ # ///
7
+
8
+ from __future__ import annotations
9
+
10
+ from typing import Any
11
+ import sys
12
+ import os
13
+ import shutil
14
+ import subprocess
15
+ import warnings
16
+
17
+ import nox
18
+ import nox_ext
19
+ import nox_lib
20
+ from nox_ext import print, pprint
21
+ from nox_lib.util import Path, copytree, rmtree
22
+
23
+ env = os.environ
24
+
25
+ # Configuration
26
+
27
+ PKG = nox.get_package_data()
28
+
29
+ PYPROJECT = nox.project.load_toml("pyproject.toml")
30
+ PY_VERSIONS = nox.project.python_versions(PYPROJECT)
31
+ PY_DEFAULT = "3.14"
32
+
33
+ # Prevent Python from writing bytecode
34
+ env["PYTHONDONTWRITEBYTECODE"] = "1"
35
+ # env["PKG_INITIAL_BUILD"] = "1"
36
+
37
+ # Sessions
38
+
39
+ @nox.session(python=[PY_DEFAULT], default=False,
40
+ requires=["cleanup"])
41
+ def prepare(session: nox.Session) -> None:
42
+ """Preparing the repository"""
43
+ nox_lib.prepare.prep_cmd(session)
44
+
45
+ @nox.session(python=[PY_DEFAULT], default=False)
46
+ def cleanup(session: nox.Session) -> None:
47
+ """Cleaning the repository"""
48
+ nox_lib.cleanup.clean_cmd(session)
49
+ nox_lib.cleanup.cleanup(session)
50
+
51
+ @nox.session(python=[*PY_VERSIONS,
52
+ "pypy3.11", "pypy3.12",
53
+ "graalpy3.13"])
54
+ def tests(session: nox.Session) -> None:
55
+ """Running tests"""
56
+ session.install(".", "--group=test")
57
+ nox_lib.tests.unittests(session)
58
+
59
+ @nox.session(python=[PY_DEFAULT])
60
+ def coverage(session: nox.Session) -> None:
61
+ """Running code coverage analysis"""
62
+ session.install(".", "--group=coverage")
63
+ nox_lib.coverage.coverage(session)
64
+
65
+ @nox.session(python=[PY_DEFAULT])
66
+ def docs(session: nox.Session) -> None:
67
+ """Building documentation and running doc tests"""
68
+ session.install(".", "--group=docs")
69
+ nox_lib.docs.sphinx(session)
70
+
71
+ @nox.session(python=[PY_DEFAULT], default=False,
72
+ requires=["tests", "coverage", "lint", "typing", "docs"])
73
+ def build(session: nox.Session) -> None:
74
+ """Building the package"""
75
+ session.install("--group=build")
76
+ nox_lib.build.build(session)
77
+
78
+ @nox.session(python=[PY_DEFAULT], default=False,
79
+ requires=["build"])
80
+ def publish(session: nox.Session) -> None:
81
+ """Publishing the package and documentation"""
82
+ session.install("--group=publish")
83
+ nox_lib.publish.on_pypi(session)
84
+ nox_lib.publish.docs_on_gh_pages(session)
85
+
86
+ @nox.session(python=[PY_DEFAULT])
87
+ def lint(session: nox.Session) -> None:
88
+ """Checking code style and quality"""
89
+ session.install(".", "--group=lint")
90
+ nox_lib.lint.flake8(session)
91
+
92
+ @nox.session(python=[PY_DEFAULT])
93
+ def typing(session: nox.Session) -> None:
94
+ """Static type checking"""
95
+ session.install(".", "--group=typing")
96
+ nox_lib.typing.mypy(session)
@@ -3,11 +3,11 @@
3
3
 
4
4
  [build-system]
5
5
  build-backend = "setuptools.build_meta"
6
- requires = [ "setuptools>=81.0.0", "packaging>=26.0.0" ]
6
+ requires = [ "setuptools>=81.0.0", "packaging>=26.4.0" ]
7
7
 
8
8
  [project]
9
9
  name = "crcc"
10
- version = "2.3.0"
10
+ version = "2.5.2"
11
11
  description = "C and Python CRC calculations module."
12
12
  keywords = [ "crcc", "crc" ]
13
13
  license = "Zlib"
@@ -25,7 +25,7 @@ urls.Download = "https://pypi.org/project/crcc/"
25
25
  urls.Repository = "https://github.com/karpierz/crcc"
26
26
  urls.Tracker = "https://github.com/karpierz/crcc/issues"
27
27
  urls.Sponsoring = "https://www.paypal.com/donate/?hosted_button_id=FX8L7CJUGLW7S"
28
- requires-python = ">=3.10.0,<4.0.0"
28
+ requires-python = ">=3.11.0,<4.0.0"
29
29
  classifiers = [
30
30
  "Development Status :: 5 - Production/Stable",
31
31
  "Intended Audience :: Developers",
@@ -34,14 +34,15 @@ classifiers = [
34
34
  "Programming Language :: C",
35
35
  "Programming Language :: Python",
36
36
  "Programming Language :: Python :: 3 :: Only",
37
- "Programming Language :: Python :: 3.10",
38
37
  "Programming Language :: Python :: 3.11",
39
38
  "Programming Language :: Python :: 3.12",
40
39
  "Programming Language :: Python :: 3.13",
41
40
  "Programming Language :: Python :: 3.14",
42
41
  "Programming Language :: Python :: 3.15",
42
+ "Programming Language :: Python :: 3.16",
43
43
  "Programming Language :: Python :: Implementation :: CPython",
44
44
  "Programming Language :: Python :: Implementation :: PyPy",
45
+ "Programming Language :: Python :: Implementation :: GraalPy",
45
46
  "Topic :: Software Development :: Libraries :: Python Modules",
46
47
  "Typing :: Typed",
47
48
  ]
@@ -51,71 +52,70 @@ dynamic = [ "readme" ]
51
52
  # entry-points.crcc.magical.epoint = "crcc:main_epoint"
52
53
  dependencies = [
53
54
  # mandatory
54
- "typing-extensions>=4.15.0",
55
- "pkg-about>=2.3.0",
55
+ "typing-extensions>=4.16.0",
56
+ "pkg-about>=2.5.0",
56
57
  # others
57
- "py-utlx>=2.3.0",
58
+ "py-utlx>=2.5.0",
58
59
  ]
59
60
 
60
61
  [dependency-groups]
61
62
  base = [
62
- "pip>=26.0.1",
63
+ "pip>=26.3.0; platform_python_implementation!='GraalVM'",
64
+ "pip>=26.1.2; platform_python_implementation=='GraalVM' and python_version~='3.13.0'",
65
+ "pip>=24.3.1; platform_python_implementation=='GraalVM' and python_version~='3.12.0'",
63
66
  "setuptools>=81.0.0",
64
67
  ]
65
68
  test = [
66
69
  { include-group = "base" },
67
- "deepdiff>=9.0.0",
68
- "rich>=14.3.3",
70
+ "deepdiff~=9.0.0",
71
+ "rich>=15.0.0",
69
72
  ]
70
73
  coverage = [
71
74
  { include-group = "test" },
72
- "coverage>=7.13.5",
75
+ "coverage>=7.17.5",
73
76
  "covdefaults>=2.3.0",
74
- "diff-cover>=10.2.0",
77
+ "diff-cover>=11.0.5",
75
78
  ]
76
79
  docs = [
77
80
  { include-group = "base" },
78
- "sphinx>=8.1.3",
81
+ "sphinx>=9.0.4",
79
82
  "pygments_ansi_color>=0.3.0", # fix sphinx load error
80
83
  "roman_numerals>=4.1.0", # -||-
81
- "sphinx-autodoc-typehints>=3.0.1",
82
- "sphinx-toolbox>=4.1.2",
83
- "sphinx-tabs>=3.4.5", # Do not change - sphinx-toolbox requires <3.4.7
84
+ "myst-parser>=5.1.0",
85
+ "sphinx-autodoc-typehints>=3.6.1",
86
+ "sphinx-tabs>=3.5.0",
87
+ "sphinx-prompt>=1.10.2",
84
88
  "sphinx-copybutton>=0.5.2",
85
89
  "sphinxcontrib-spelling>=8.0.2",
86
90
  "sphinx-lint>=1.0.2",
87
91
  "restructuredtext-lint>=2.0.2",
88
92
  "nbsphinx>=0.9.8",
89
93
  ]
90
- build-py = [
91
- { include-group = "test" },
92
- "build>=1.4.2",
93
- "pyc-wheel>=2.3.0",
94
- ]
95
94
  build = [
96
95
  { include-group = "test" },
97
96
  "check-manifest>=0.51",
98
- "build>=1.4.2",
99
- "twine>=6.2.0",
97
+ "build>=1.6.1",
98
+ "twine>=7.0.0",
99
+ "pyc-wheel>=2.5.0",
100
100
  ]
101
101
  publish = [
102
- "twine>=6.2.0",
103
- ]
104
- type = [
105
- { include-group = "base" },
106
- "mypy>=1.19.1",
107
- "mypy_extensions>=1.1.0",
108
- "types-setuptools>=81.0.0.20260209",
102
+ "twine>=7.0.0",
109
103
  ]
110
104
  lint = [
111
105
  { include-group = "test" },
112
- "flake8>=7.3.0",
106
+ "flake8>=7.5.0",
113
107
  "flake8-in-file-ignores>=0.3.0",
114
108
  "flake8-pyproject>=1.2.4",
115
109
  "flake8-docstrings>=1.7.0",
116
110
  "pep8-naming>=0.15.1",
117
- "flake8-builtins>=3.1.0",
118
- "flake8-deprecated>=2.3.0",
111
+ "flake8-builtins>=3.2.0",
112
+ "flake8-deprecated>=2.4.0",
113
+ ]
114
+ typing = [
115
+ { include-group = "base" },
116
+ "mypy>=2.4.1",
117
+ "mypy-extensions>=1.2.0",
118
+ "types-setuptools>=81.0.0.20260209",
119
119
  ]
120
120
 
121
121
  [tool.setuptools]
@@ -127,7 +127,7 @@ packages.find.namespaces = false
127
127
  packages.find.where = [ "src" ]
128
128
  package-dir."" = "src"
129
129
  # package-dir."crcc.tests" = "tests"
130
- package-data.crcc = [
130
+ package-data."crcc" = [
131
131
  ]
132
132
  exclude-package-data."*" = [
133
133
  "*.c", "*.h",
@@ -135,7 +135,7 @@ exclude-package-data."*" = [
135
135
  "*.cxx", "*.hxx",
136
136
  "*.pyx", "*.pxd",
137
137
  ]
138
- exclude-package-data.crcc = [
138
+ exclude-package-data."crcc" = [
139
139
  "*.def",
140
140
  ]
141
141
 
@@ -176,7 +176,7 @@ filename = [ "*.py", "*.pyx" ]
176
176
  # include = [ "tests" ]
177
177
  # exclude = [ ".nox", ".tox", "*.egg", ".git", "__pycache__",
178
178
  # "build", "_build", "docs/_build", "dist" ]
179
- exclude = [ "_vendor" ]
179
+ exclude = [ "_vendor", "crc.c" ]
180
180
  max-line-length = 99
181
181
  ignore = [
182
182
  # pycodestyle error and warning codes
@@ -222,7 +222,7 @@ ignore = [
222
222
  count = true
223
223
 
224
224
  [tool.mypy]
225
- python_version = "3.10"
225
+ python_version = "3.11"
226
226
  strict = true
227
227
  sqlite_cache = true
228
228
  warn_unused_configs = true
@@ -234,3 +234,4 @@ check_untyped_defs = true
234
234
  # ignore_missing_imports = true
235
235
  files = [ "src" ]
236
236
  # exclude = [ "docs/", "tests/" ]
237
+ exclude = [ "src/crc.c/" ]
@@ -11,7 +11,7 @@ class BuildExt(build_ext):
11
11
  "unix": ["-O3", "-g0", "-ffast-math"],
12
12
  }
13
13
  ld_args_map = {
14
- "msvc": ["/DEF:src/crcc/crc.c/crc.def"],
14
+ "msvc": ["/DEF:src/crc.c/crc.def"],
15
15
  "unix": [],
16
16
  }
17
17
 
@@ -33,20 +33,21 @@ ext_modules = [
33
33
  Extension(
34
34
  name="crcc._platform.crc",
35
35
  language="c",
36
- sources=["src/crcc/crc.c/crc.c",
37
- "src/crcc/crc.c/crc_table.c",
38
- "src/crcc/crc.c/crc_update.c",
39
- "src/crcc/crc.c/crc_py.c"],
36
+ define_macros=[("Py_LIMITED_API", "0x03110000")],
37
+ py_limited_api=True,
38
+ sources=["src/crc.c/crc.c",
39
+ "src/crc.c/crc_table.c",
40
+ "src/crc.c/crc_update.c",
41
+ "src/crcc/crc_py.c"],
40
42
  depends=["include/crcc/crc.h",
41
- "src/crcc/crc.c/crc.def",
42
- "src/crcc/crc.c/crc_defs.h",
43
- "src/crcc/crc.c/crc_table.h",
44
- "src/crcc/crc.c/crc_update.h"],
43
+ "src/crc.c/crc.def",
44
+ "src/crc.c/crc_defs.h",
45
+ "src/crc.c/crc_table.h",
46
+ "src/crc.c/crc_update.h"],
45
47
  include_dirs=["include"],
46
48
  ),
47
49
  ]
48
50
 
49
- setup(
50
- ext_modules = ext_modules,
51
- cmdclass = dict(build_ext=BuildExt),
52
- )
51
+ setup(ext_modules=ext_modules,
52
+ cmdclass=dict(build_ext=BuildExt),
53
+ options={"bdist_wheel": {"py_limited_api": "cp311"}})
@@ -127,8 +127,7 @@ crc_t crc_final(const crc_model_t* crc_model, crc_t crc)
127
127
 
128
128
  const crc_model_t* crc_predefined_model_by_name(const char* name)
129
129
  {
130
- crc_model_t* term = &crc_predefined_models[sizeof(crc_predefined_models) /
131
- sizeof(crc_predefined_models[0]) - 1];
130
+ crc_model_t* term = &crc_predefined_models[crc_predefined_models_size];
132
131
  if ( ! term->name[0] )
133
132
  {
134
133
  crc_model_t* model;
@@ -9,3 +9,4 @@ EXPORTS
9
9
  crc_model_by_name @5
10
10
  crc_predefined_model_by_name @6
11
11
  crc_predefined_models @7
12
+ crc_predefined_models_size @8
@@ -99,4 +99,7 @@ crc_model_t crc_predefined_models[] = {
99
99
  {""},
100
100
  };
101
101
 
102
+ size_t crc_predefined_models_size = (sizeof(crc_predefined_models) /
103
+ sizeof(crc_predefined_models[0]) - 1);
104
+
102
105
  #endif
@@ -1,4 +1,6 @@
1
1
  # Copyright (c) 1994 Adam Karpierz
2
2
  # SPDX-License-Identifier: Zlib
3
3
 
4
+ from __future__ import annotations
5
+
4
6
  __import__("pkg_about").about()
@@ -1,8 +1,12 @@
1
+ # flake8-in-file-ignores: noqa: F401,F403,F821
2
+
1
3
  # Copyright (c) 1994 Adam Karpierz
2
4
  # SPDX-License-Identifier: Zlib
3
5
 
4
6
  """Python API of CRC package."""
5
7
 
6
- from .__about__ import * ; del __about__ # type: ignore[name-defined] # noqa
8
+ from __future__ import annotations
9
+
10
+ from .__about__ import * ; del __about__ # type: ignore[name-defined]
7
11
 
8
- from ._crc import * ; del _crc # type: ignore[name-defined] # noqa
12
+ from ._crc import * ; del _crc # type: ignore[name-defined]
@@ -3,12 +3,15 @@
3
3
 
4
4
  """Public Python API of CRC package."""
5
5
 
6
+ from __future__ import annotations
7
+
6
8
  import ctypes as ct
7
9
 
8
10
  from ._platform import CFUNC
9
11
  from ._dll import dll
10
12
 
11
- class FILE(ct.Structure): pass
13
+ class FILE(ct.Structure):
14
+ pass
12
15
 
13
16
 
14
17
  # The types of the CRC values.
@@ -50,11 +53,9 @@ class model_t(ct.Structure):
50
53
 
51
54
  # Predefined CRC models.
52
55
  #
53
- predefined_models = (model_t * 1000).in_dll(dll, "crc_predefined_models")
54
- for size, pmodel in enumerate(predefined_models): # pragma: no cover
55
- if pmodel.width == 0: break
56
+ size = ct.c_size_t.in_dll(dll, "crc_predefined_models_size").value
56
57
  predefined_models = (model_t * size).in_dll(dll, "crc_predefined_models")
57
- del size, pmodel
58
+ del size
58
59
 
59
60
  model = CFUNC(model_t,
60
61
  ct.c_char_p,
@@ -1,6 +1,8 @@
1
1
  # Copyright (c) 1994 Adam Karpierz
2
2
  # SPDX-License-Identifier: Zlib
3
3
 
4
+ from __future__ import annotations
5
+
4
6
  from ._platform import DLL_PATH, DLL
5
7
  from ._platform import dlclose # noqa: F401
6
8
 
@@ -3,9 +3,11 @@
3
3
  # Copyright (c) 1994 Adam Karpierz
4
4
  # SPDX-License-Identifier: Zlib
5
5
 
6
+ from __future__ import annotations
7
+
6
8
  __all__ = (
7
- 'is_windows', 'is_linux', 'is_macos',
8
- 'DLL_PATH', 'DLL', 'dlclose', 'CFUNC',
9
+ "is_windows", "is_linux", "is_macos",
10
+ "DLL_PATH", "DLL", "dlclose", "CFUNC",
9
11
  )
10
12
 
11
13
  from utlx.platform import *
@@ -3,17 +3,16 @@
3
3
  # Copyright (c) 1994 Adam Karpierz
4
4
  # SPDX-License-Identifier: Zlib
5
5
 
6
+ from __future__ import annotations
7
+
6
8
  import ctypes
7
- import sysconfig
8
9
  from pathlib import Path
9
10
  from functools import partial
10
11
 
11
- __all__ = ('DLL_PATH', 'DLL', 'dlclose', 'CFUNC')
12
+ __all__ = ("DLL_PATH", "DLL", "dlclose", "CFUNC")
12
13
 
13
14
  here = Path(__file__).resolve().parent
14
- dll_suff = sysconfig.get_config_var("EXT_SUFFIX") or ".pyd"
15
-
16
- DLL_PATH = here/("crc" + dll_suff)
15
+ DLL_PATH = here/"crc.pyd"
17
16
 
18
17
  from ctypes import CDLL as _DLL
19
18
  from _ctypes import dlclose # type: ignore[attr-defined]
@@ -3,17 +3,16 @@
3
3
  # Copyright (c) 1994 Adam Karpierz
4
4
  # SPDX-License-Identifier: Zlib
5
5
 
6
+ from __future__ import annotations
7
+
6
8
  import ctypes
7
- import sysconfig
8
9
  from pathlib import Path
9
10
  from functools import partial
10
11
 
11
- __all__ = ('DLL_PATH', 'DLL', 'dlclose', 'CFUNC')
12
+ __all__ = ("DLL_PATH", "DLL", "dlclose", "CFUNC")
12
13
 
13
14
  here = Path(__file__).resolve().parent
14
- dll_suff = sysconfig.get_config_var("EXT_SUFFIX") or ".pyd"
15
-
16
- DLL_PATH = here/("crc" + dll_suff)
15
+ DLL_PATH = here/"crc.pyd"
17
16
 
18
17
  from ctypes import CDLL as _DLL
19
18
  from _ctypes import dlclose # type: ignore[attr-defined]
@@ -3,17 +3,16 @@
3
3
  # Copyright (c) 1994 Adam Karpierz
4
4
  # SPDX-License-Identifier: Zlib
5
5
 
6
+ from __future__ import annotations
7
+
6
8
  from typing import Any
7
9
  import ctypes
8
- import sysconfig
9
10
  from pathlib import Path
10
11
 
11
- __all__ = ('DLL_PATH', 'DLL', 'dlclose', 'CFUNC')
12
+ __all__ = ("DLL_PATH", "DLL", "dlclose", "CFUNC")
12
13
 
13
14
  here = Path(__file__).resolve().parent
14
- dll_suff = sysconfig.get_config_var("EXT_SUFFIX") or ".pyd"
15
-
16
- DLL_PATH = here/("crc" + dll_suff)
15
+ DLL_PATH = here/"crc.pyd"
17
16
 
18
17
  from ctypes import WinDLL as _DLL
19
18
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crcc
3
- Version: 2.3.0
3
+ Version: 2.5.2
4
4
  Summary: C and Python CRC calculations module.
5
5
  Author-email: Adam Karpierz <adam@karpierz.net>
6
6
  Maintainer-email: Adam Karpierz <adam@karpierz.net>
@@ -21,22 +21,23 @@ Classifier: Operating System :: OS Independent
21
21
  Classifier: Programming Language :: C
22
22
  Classifier: Programming Language :: Python
23
23
  Classifier: Programming Language :: Python :: 3 :: Only
24
- Classifier: Programming Language :: Python :: 3.10
25
24
  Classifier: Programming Language :: Python :: 3.11
26
25
  Classifier: Programming Language :: Python :: 3.12
27
26
  Classifier: Programming Language :: Python :: 3.13
28
27
  Classifier: Programming Language :: Python :: 3.14
29
28
  Classifier: Programming Language :: Python :: 3.15
29
+ Classifier: Programming Language :: Python :: 3.16
30
30
  Classifier: Programming Language :: Python :: Implementation :: CPython
31
31
  Classifier: Programming Language :: Python :: Implementation :: PyPy
32
+ Classifier: Programming Language :: Python :: Implementation :: GraalPy
32
33
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
33
34
  Classifier: Typing :: Typed
34
- Requires-Python: <4.0.0,>=3.10.0
35
+ Requires-Python: <4.0.0,>=3.11.0
35
36
  Description-Content-Type: text/x-rst; charset=UTF-8
36
37
  License-File: LICENSE
37
- Requires-Dist: typing-extensions>=4.15.0
38
- Requires-Dist: pkg-about>=2.3.0
39
- Requires-Dist: py-utlx>=2.3.0
38
+ Requires-Dist: typing-extensions>=4.16.0
39
+ Requires-Dist: pkg-about>=2.5.0
40
+ Requires-Dist: py-utlx>=2.5.0
40
41
  Dynamic: license-file
41
42
 
42
43
  crcc
@@ -63,7 +64,7 @@ Installation
63
64
 
64
65
  Prerequisites:
65
66
 
66
- + Python 3.10 or higher
67
+ + Python 3.11 or higher
67
68
 
68
69
  * https://www.python.org/
69
70
 
@@ -18,18 +18,27 @@ examples/crc_file.c
18
18
  examples/crc_file.h
19
19
  include/crcc/crc.h
20
20
  include/crcc/crc.h
21
- src/crcc/crc.c/crc.c
22
- src/crcc/crc.c/crc.def
23
- src/crcc/crc.c/crc_defs.h
24
- src/crcc/crc.c/crc_py.c
25
- src/crcc/crc.c/crc_table.c
26
- src/crcc/crc.c/crc_table.h
27
- src/crcc/crc.c/crc_update.c
28
- src/crcc/crc.c/crc_update.h
21
+ src/crc.c/crc.c
22
+ src/crc.c/crc.def
23
+ src/crc.c/crc_defs.h
24
+ src/crc.c/crc_table.c
25
+ src/crc.c/crc_table.h
26
+ src/crc.c/crc_update.c
27
+ src/crc.c/crc_update.h
28
+ src/crcc/crc_py.c
29
+ src/crc.c/crc.c
30
+ src/crc.c/crc.def
31
+ src/crc.c/crc_defs.h
32
+ src/crc.c/crc_predef.c
33
+ src/crc.c/crc_table.c
34
+ src/crc.c/crc_table.h
35
+ src/crc.c/crc_update.c
36
+ src/crc.c/crc_update.h
29
37
  src/crcc/__about__.py
30
38
  src/crcc/__init__.py
31
39
  src/crcc/_crc.py
32
40
  src/crcc/_dll.py
41
+ src/crcc/crc_py.c
33
42
  src/crcc/py.typed
34
43
  src/crcc.egg-info/PKG-INFO
35
44
  src/crcc.egg-info/SOURCES.txt
@@ -41,15 +50,6 @@ src/crcc/_platform/__init__.py
41
50
  src/crcc/_platform/linux.py
42
51
  src/crcc/_platform/macos.py
43
52
  src/crcc/_platform/windows.py
44
- src/crcc/crc.c/crc.c
45
- src/crcc/crc.c/crc.def
46
- src/crcc/crc.c/crc_defs.h
47
- src/crcc/crc.c/crc_predef.c
48
- src/crcc/crc.c/crc_py.c
49
- src/crcc/crc.c/crc_table.c
50
- src/crcc/crc.c/crc_table.h
51
- src/crcc/crc.c/crc_update.c
52
- src/crcc/crc.c/crc_update.h
53
53
  tests/__init__.py
54
54
  tests/__main__.py
55
55
  tests/test_crc_model.c
@@ -0,0 +1,3 @@
1
+ typing-extensions>=4.16.0
2
+ pkg-about>=2.5.0
3
+ py-utlx>=2.5.0
@@ -1,14 +1,14 @@
1
1
  # Copyright (c) 1994 Adam Karpierz
2
2
  # SPDX-License-Identifier: Zlib
3
3
 
4
+ from __future__ import annotations
5
+
4
6
  import unittest
5
7
  import sys
6
8
  import logging
7
9
 
8
10
  from . import test_dir
9
11
 
10
- log = logging.getLogger(__name__)
11
-
12
12
 
13
13
  def test_suite(names=None, include=(), exclude=()):
14
14
  from . import __name__ as pkg_name
@@ -6,8 +6,8 @@
6
6
  #include <stdint.h>
7
7
  #include <stdio.h>
8
8
  #include "../include/crcc/crc.h"
9
- #include "../src/crcc/crc.c/crc_table.h"
10
- #include "../src/crcc/crc.c/crc_defs.h"
9
+ #include "../src/crc.c/crc_table.h"
10
+ #include "../src/crc.c/crc_defs.h"
11
11
 
12
12
  typedef enum {false = 0, true = 1} bool;
13
13
 
@@ -36,19 +36,33 @@ class CrcTestCase(unittest.TestCase):
36
36
  if crc_model.width == 0: break
37
37
  self.crc_model_names.append(crc_model.name.decode())
38
38
 
39
- @unittest.skipUnless(is_windows, "Windows-only test")
40
39
  def test_dll_nonexistent(self):
41
- with mock.patch("sysconfig.get_config_var",
42
- return_value=".nonexistent"), \
43
- self.assertRaises(ImportError) as exc:
44
- sys.modules.pop("crcc._platform.windows", None)
45
- sys.modules.pop("crcc._platform", None)
46
- import crcc._platform
47
- sys.modules.pop("crcc._platform.windows", None)
48
- sys.modules.pop("crcc._platform", None)
40
+ from pathlib import Path
41
+ real_exists=Path.exists
42
+
43
+ def fake_exists(path):
44
+ return False if path.name == "crc.pyd" else real_exists(path)
45
+
46
+ self._clear_platform_modules()
47
+ try:
48
+ # with mock.patch("sysconfig.get_config_var",
49
+ # return_value=".nonexistent"), \
50
+ with mock.patch.object(Path, "exists", autospec=True,
51
+ side_effect=fake_exists), \
52
+ self.assertRaises(ImportError) as exc:
53
+ import crcc._platform
54
+ finally:
55
+ self._clear_platform_modules()
49
56
  import crcc._platform
50
57
  self.assertIn("Shared library not found: ", str(exc.exception))
51
58
 
59
+ def _clear_platform_modules(self):
60
+ for name in ("crcc._platform.windows",
61
+ "crcc._platform.linux",
62
+ "crcc._platform.macos",
63
+ "crcc._platform"):
64
+ sys.modules.pop(name, None)
65
+
52
66
  def test_predefined_models(self):
53
67
  """Test of predefined CRC models"""
54
68
  print()
crcc-2.3.0/noxfile.py DELETED
@@ -1,165 +0,0 @@
1
- # Copyright (c) 2026 Adam Karpierz
2
- # SPDX-License-Identifier: Zlib
3
-
4
- # /// script
5
- # dependencies = ["nox>=2026.2.9", "nox_ext", "nox_lib"]
6
- # ///
7
-
8
- from __future__ import annotations
9
-
10
- from typing import Any
11
- import sys
12
- import os
13
- from pathlib import Path
14
- from functools import partial
15
- import shutil
16
- import subprocess
17
- import warnings
18
-
19
- import nox
20
- import nox_ext
21
- from nox_ext import print, pprint
22
-
23
- here = Path(__file__).resolve().parent
24
- env = os.environ
25
-
26
- # Configuration
27
-
28
- PKG = nox.get_package_data(here)
29
-
30
- PYPROJECT = nox.project.load_toml("pyproject.toml")
31
- PY_VERSIONS = nox.project.python_versions(PYPROJECT)
32
- PY_DEFAULT = "3.13"
33
-
34
- # Prevent Python from writing bytecode
35
- env["PYTHONDONTWRITEBYTECODE"] = "1"
36
- # env["PKG_INITIAL_BUILD"] = "1"
37
-
38
- # Helpers & Utils
39
-
40
- copytree = shutil.copytree
41
- rmtree = partial(shutil.rmtree, ignore_errors=True)
42
-
43
- # Sessions
44
-
45
- @nox.session(python=[PY_DEFAULT], default=False,
46
- requires=["cleanup"])
47
- def prepare(session: nox.Session) -> None:
48
- """Preparing the repository"""
49
- cmd = here/".aprep.cmd"
50
- if cmd.is_file(): subprocess.run([cmd])
51
-
52
- @nox.session(python=[PY_DEFAULT], default=False)
53
- def cleanup(session: nox.Session) -> None:
54
- """Cleaning the repository"""
55
- #no_package = true
56
- cmd = here/".clean.cmd"
57
- if cmd.is_file(): subprocess.run([cmd], stderr=subprocess.DEVNULL)
58
- rmtree(here/"build")
59
- rmtree(here/"dist")
60
- for item in here.glob("src/*.egg-info"): rmtree(item)
61
- for item in here.glob("**/__pycache__"): rmtree(item)
62
- for item in here.glob("**/.mypy_cache"): rmtree(item)
63
- rmtree(here/".tox")
64
- rmtree(here/".nox")
65
-
66
- @nox.session(python=[*PY_VERSIONS, "pypy3.10", "pypy3.11"])
67
- def tests(session: nox.Session) -> None:
68
- """Running tests"""
69
- session.install(".", "--group=test")
70
- session.py("--version")
71
- session.py("-m", "tests", *session.posargs)
72
-
73
- @nox.session(python=[PY_DEFAULT])
74
- def coverage(session: nox.Session) -> None:
75
- """Running code coverage analysis"""
76
- session.install(".", "--group=coverage")
77
- env_dir = Path(session.virtualenv.location)
78
- data_file = env_dir/".coverage"
79
- html_dir = env_dir/'.coverage.html'
80
- session.py("-m", "coverage", "erase", f"--data-file={data_file}")
81
- session.py("-m", "coverage", "run", f"--data-file={data_file}", "-m", "tests",
82
- *session.posargs, success_codes=range(0, 256))
83
- session.py("-m", "coverage", "html", f"--data-file={data_file}", f"--directory={html_dir}",
84
- success_codes=range(0, 256))
85
- session.py("-m", "coverage", "report", f"--data-file={data_file}")
86
-
87
- @nox.session(python=[PY_DEFAULT])
88
- def docs(session: nox.Session) -> None:
89
- """Building documentation and running doc tests"""
90
- session.install(".", "--group=docs")
91
- html_dir = here/"build/docs/html"
92
- session.py("-m", "sphinxlint", "-i", "#arch", "-i", ".nox", "-i", ".tox",
93
- "-i", "build", "-i", "dist", "-i", ".mypy_cache")
94
- #session.run("python","-m", "sphinx.apidoc", "-f", *[session.site_packages/f"{item}/"
95
- # for item in PKG.TOP_LEVELS])
96
- session.py("-m", "sphinx.cmd.build", "-W", "-a", "-b", "html", "-E", here/"docs", html_dir)
97
- session.py("-m", "sphinx.cmd.build", "-W", "-a", "-b", "doctest", here/"docs", html_dir)
98
- session.py("-m", "sphinx.cmd.build", "-W", "-a", "-b", "linkcheck", here/"docs", html_dir)
99
-
100
- for python in tests.python:
101
- @nox.session(name=f"build_py-{python}", python=[python], default=False,
102
- requires=[f"tests-{python}"])
103
- def build_py(session: nox.Session) -> None:
104
- """Building the package - for particular Python version"""
105
- session.install("--group=build-py")
106
- session.py("--version")
107
- session.py("-m", "build", "--wheel")
108
- session.py("-m", "pyc_wheel", "--quiet", f"dist/{PKG.FULLNAME}-{session.PKG_IMPL}{session.PKG_PVER}-*.whl")
109
-
110
- @nox.session(python=[PY_DEFAULT], default=False,
111
- requires=[f"build_py-{python}" for python in tests.python] + ["docs"])
112
- def build(session: nox.Session) -> None:
113
- """Building the package - final stage"""
114
- session.install("--group=build")
115
- session.py("-m", "check_manifest", "-v")
116
- session.py("-m", "build", "--sdist")
117
- # Verify distribution files
118
- session.py("-m", "twine", "check", "dist/*")
119
-
120
- @nox.session(python=[PY_DEFAULT], default=False,
121
- requires=["build"])
122
- def publish(session: nox.Session) -> None:
123
- """Publishing the package and documentation"""
124
- session.install("--group=publish")
125
- # Publish on PyPI
126
- session.py("-m", "twine", "upload", "dist/*")
127
- # Publish documentation on GitHub Pages
128
- # checkout gh-pages worktree
129
- env_dir = Path(session.virtualenv.location)
130
- gh_pages_dir = env_dir/"gh-pages"
131
- rmtree(gh_pages_dir)
132
- session.run("git", "worktree", "prune")
133
- #session.run("git", "worktree", "add", gh_pages_dir, "gh-pages")
134
- session.run("git", "worktree", "add", "-B", "gh-pages", gh_pages_dir)
135
- # clean old docs
136
- (gh_pages_dir/".nojekyll").touch()
137
- for fpath in gh_pages_dir.iterdir():
138
- if fpath.name not in (".git",".nojekyll"):
139
- if fpath.is_dir():
140
- rmtree(fpath)
141
- else:
142
- fpath.unlink(missing_ok=True)
143
- # copy new docs
144
- copytree(here/"build/docs/html", gh_pages_dir, dirs_exist_ok=True)
145
- # commit + push
146
- session.run("git", "-C", gh_pages_dir, "add", ".")
147
- session.run("git", "-C", gh_pages_dir, "commit", "-m", "Update documentation")
148
- session.run("git", "-C", gh_pages_dir, "push", "--force", "origin", "gh-pages")
149
- # remove worktree
150
- session.run("git", "worktree", "remove", "--force", gh_pages_dir)
151
- rmtree(gh_pages_dir)
152
- session.run("git", "worktree", "prune")
153
-
154
- @nox.session(python=[PY_DEFAULT])
155
- def typing(session: nox.Session) -> None:
156
- """Static type checking"""
157
- session.install(".", "--group=type")
158
- session.py("-m", "mypy")
159
-
160
- @nox.session(python=[PY_DEFAULT])
161
- def lint(session: nox.Session) -> None:
162
- """Checking code style and quality"""
163
- session.install(".", "--group=lint")
164
- out_file = env_dir/"flake8out.txt"
165
- session.py("-m", "flake8", "--output-file", out_file, here/"src/")
@@ -1,3 +0,0 @@
1
- typing-extensions>=4.15.0
2
- pkg-about>=2.3.0
3
- py-utlx>=2.3.0
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