siphashc 2.3__tar.gz → 2.5__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,6 +1,16 @@
1
1
  Changes
2
2
  =======
3
3
 
4
+ 2.5
5
+ ---
6
+
7
+ * Python 3.13 compatiblity.
8
+
9
+ 2.4
10
+ ---
11
+
12
+ * Added type annotations.
13
+
4
14
  2.3
5
15
  ---
6
16
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: siphashc
3
- Version: 2.3
3
+ Version: 2.5
4
4
  Summary: Python module (in c) for siphash-2-4
5
5
  Author-email: Michal Čihař <michal@cihar.com>
6
6
  License: ISC
@@ -16,7 +16,7 @@ description = "Python module (in c) for siphash-2-4"
16
16
  keywords = ["siphash", "siphash-2-4"]
17
17
  name = "siphashc"
18
18
  requires-python = ">=3.8"
19
- version = "2.3"
19
+ version = "2.5"
20
20
 
21
21
  [[project.authors]]
22
22
  email = "michal@cihar.com"
@@ -48,21 +48,26 @@ profile = "black"
48
48
 
49
49
  [tool.ruff]
50
50
  ignore = [
51
- "ANN", # TODO: missing type annotations
52
- "PLR2004", # TODO: Magic value used in comparison
53
- "PT011", # TODO: `pytest.raises(ValueError)` is too broad
54
51
  "S101", # CONFIG: using pytest
55
52
  "D203", # CONFIG: incompatible with D211
56
- "D212", # CONFIG: incompatible with D213
57
- "T201" # WONTFIX: using print() (maybe add noqa)
53
+ "D212" # CONFIG: incompatible with D213
58
54
  ]
59
- output-format = "github"
60
55
  select = ["ALL"]
61
56
 
57
+ [tool.ruff.lint.isort]
58
+ known-first-party = ["siphashc"]
59
+ known-third-party = ["pytest"]
60
+
62
61
  [tool.ruff.mccabe]
63
62
  max-complexity = 16
64
63
 
64
+ [tool.ruff.per-file-ignores]
65
+ "benchmark.py" = ["T201"]
66
+
65
67
  [tool.setuptools]
66
- include-package-data = false
67
- py-modules = []
68
+ include-package-data = true
68
69
  zip-safe = true
70
+
71
+ [tool.setuptools.packages.find]
72
+ include = ["siphashc*"]
73
+ namespaces = true
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env python
2
2
  """Setup for the siphashc module."""
3
3
 
4
-
5
4
  from setuptools import Extension, setup
6
5
 
7
6
  setup(
@@ -0,0 +1 @@
1
+ def siphash(key: str | bytes, plaintext: str | bytes) -> int: ...
File without changes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: siphashc
3
- Version: 2.3
3
+ Version: 2.5
4
4
  Summary: Python module (in c) for siphash-2-4
5
5
  Author-email: Michal Čihař <michal@cihar.com>
6
6
  License: ISC
@@ -9,6 +9,8 @@ test_siphashc.py
9
9
  siphash/siphash.c
10
10
  siphash/siphash.h
11
11
  siphash/siphash_impl.h
12
+ siphashc/__init__.pyi
13
+ siphashc/py.typed
12
14
  siphashc.egg-info/PKG-INFO
13
15
  siphashc.egg-info/SOURCES.txt
14
16
  siphashc.egg-info/dependency_links.txt
@@ -1,31 +1,44 @@
1
1
  """Test for siphashc module."""
2
+
3
+ from __future__ import annotations
4
+
2
5
  import unittest
3
6
 
4
7
  import pytest
8
+
5
9
  from siphashc import siphash
6
10
 
7
11
 
8
12
  class TestSiphashC(unittest.TestCase):
9
13
  """Test for siphashc module."""
10
14
 
11
- def test_hash(self):
15
+ def test_hash(self: TestSiphashC) -> None:
12
16
  """Test simple hashing."""
13
17
  result = siphash("sixteencharstrng", "i need a hash of this")
14
- assert result == 10796923698683394048
18
+ assert result == 10796923698683394048 # noqa: PLR2004
15
19
 
16
20
  result = siphash("0123456789ABCDEF", "a")
17
- assert result == 12398370950267227270
21
+ assert result == 12398370950267227270 # noqa: PLR2004
18
22
 
19
- def test_errors(self):
23
+ def test_errors(self: TestSiphashC) -> None:
20
24
  """Test error handling."""
21
- with pytest.raises(ValueError):
25
+ with pytest.raises(
26
+ ValueError,
27
+ match=r"key must be exactly 128 bits long \(16 chars\)",
28
+ ):
22
29
  siphash("not long enough", "a")
23
- with pytest.raises(ValueError):
30
+ with pytest.raises(
31
+ ValueError,
32
+ match=r"key must be exactly 128 bits long \(16 chars\)",
33
+ ):
24
34
  siphash("toooooooooooooooooooooooo long", "a")
25
- with pytest.raises(ValueError):
35
+ with pytest.raises(
36
+ ValueError,
37
+ match=r"key must be exactly 128 bits long \(16 chars\)",
38
+ ):
26
39
  siphash("", "a")
27
40
 
28
- def test_reference_vectors(self):
41
+ def test_reference_vectors(self: TestSiphashC) -> None:
29
42
  """Test reference vectors."""
30
43
  vectors = [
31
44
  0x726FDB47DD0E0E31,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes