cchecksum 0.3.0__tar.gz → 0.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.

Potentially problematic release.


This version of cchecksum might be problematic. Click here for more details.

Files changed (44) hide show
  1. {cchecksum-0.3.0 → cchecksum-0.3.1}/.github/workflows/pytest.yaml +1 -4
  2. {cchecksum-0.3.0/cchecksum.egg-info → cchecksum-0.3.1}/PKG-INFO +1 -1
  3. {cchecksum-0.3.0 → cchecksum-0.3.1}/cchecksum/__init__.py +3 -1
  4. cchecksum-0.3.1/cchecksum/monkey_patch.py +47 -0
  5. {cchecksum-0.3.0 → cchecksum-0.3.1/cchecksum.egg-info}/PKG-INFO +1 -1
  6. {cchecksum-0.3.0 → cchecksum-0.3.1}/cchecksum.egg-info/SOURCES.txt +5 -2
  7. {cchecksum-0.3.0 → cchecksum-0.3.1}/docs/index.rst +1 -1
  8. cchecksum-0.3.1/requirements-dev.txt +3 -0
  9. cchecksum-0.3.1/tests/test_monkey_patch.py +23 -0
  10. {cchecksum-0.3.0 → cchecksum-0.3.1}/.github/workflows/black.yaml +0 -0
  11. {cchecksum-0.3.0 → cchecksum-0.3.1}/.github/workflows/deploy-docs.yaml +0 -0
  12. {cchecksum-0.3.0 → cchecksum-0.3.1}/.github/workflows/release.yaml +0 -0
  13. {cchecksum-0.3.0 → cchecksum-0.3.1}/.gitignore +0 -0
  14. {cchecksum-0.3.0 → cchecksum-0.3.1}/LICENSE +0 -0
  15. {cchecksum-0.3.0 → cchecksum-0.3.1}/Makefile +0 -0
  16. {cchecksum-0.3.0 → cchecksum-0.3.1}/README.md +0 -0
  17. {cchecksum-0.3.0 → cchecksum-0.3.1}/cchecksum/_checksum.c +0 -0
  18. {cchecksum-0.3.0 → cchecksum-0.3.1}/cchecksum/_checksum.pyi +0 -0
  19. {cchecksum-0.3.0 → cchecksum-0.3.1}/cchecksum/_checksum.pyx +0 -0
  20. {cchecksum-0.3.0 → cchecksum-0.3.1}/cchecksum/py.typed +0 -0
  21. {cchecksum-0.3.0 → cchecksum-0.3.1}/cchecksum.egg-info/dependency_links.txt +0 -0
  22. {cchecksum-0.3.0 → cchecksum-0.3.1}/cchecksum.egg-info/not-zip-safe +0 -0
  23. {cchecksum-0.3.0 → cchecksum-0.3.1}/cchecksum.egg-info/requires.txt +0 -0
  24. {cchecksum-0.3.0 → cchecksum-0.3.1}/cchecksum.egg-info/top_level.txt +0 -0
  25. {cchecksum-0.3.0 → cchecksum-0.3.1}/docs/Makefile +0 -0
  26. {cchecksum-0.3.0 → cchecksum-0.3.1}/docs/_build/html/_static/alabaster.css +0 -0
  27. {cchecksum-0.3.0 → cchecksum-0.3.1}/docs/_build/html/_static/basic.css +0 -0
  28. {cchecksum-0.3.0 → cchecksum-0.3.1}/docs/_build/html/_static/custom.css +0 -0
  29. {cchecksum-0.3.0 → cchecksum-0.3.1}/docs/_build/html/_static/doctools.js +0 -0
  30. {cchecksum-0.3.0 → cchecksum-0.3.1}/docs/_build/html/_static/documentation_options.js +0 -0
  31. {cchecksum-0.3.0 → cchecksum-0.3.1}/docs/_build/html/_static/file.png +0 -0
  32. {cchecksum-0.3.0 → cchecksum-0.3.1}/docs/_build/html/_static/language_data.js +0 -0
  33. {cchecksum-0.3.0 → cchecksum-0.3.1}/docs/_build/html/_static/minus.png +0 -0
  34. {cchecksum-0.3.0 → cchecksum-0.3.1}/docs/_build/html/_static/plus.png +0 -0
  35. {cchecksum-0.3.0 → cchecksum-0.3.1}/docs/_build/html/_static/pygments.css +0 -0
  36. {cchecksum-0.3.0 → cchecksum-0.3.1}/docs/_build/html/_static/searchtools.js +0 -0
  37. {cchecksum-0.3.0 → cchecksum-0.3.1}/docs/_build/html/_static/sphinx_highlight.js +0 -0
  38. {cchecksum-0.3.0 → cchecksum-0.3.1}/docs/conf.py +0 -0
  39. {cchecksum-0.3.0 → cchecksum-0.3.1}/docs/make.bat +0 -0
  40. {cchecksum-0.3.0 → cchecksum-0.3.1}/pyproject.toml +0 -0
  41. {cchecksum-0.3.0 → cchecksum-0.3.1}/requirements.txt +0 -0
  42. {cchecksum-0.3.0 → cchecksum-0.3.1}/setup.cfg +0 -0
  43. {cchecksum-0.3.0 → cchecksum-0.3.1}/setup.py +0 -0
  44. {cchecksum-0.3.0 → cchecksum-0.3.1/tests}/test_checksum.py +0 -0
@@ -39,12 +39,9 @@ jobs:
39
39
  with:
40
40
  python-version: ${{ matrix.pyversion }}
41
41
 
42
- - name: Install test dependencies
43
- run: pip install pytest eth-utils
44
-
45
42
  - name: Install cchecksum
46
43
  run: |
47
- pip install -r requirements.txt
44
+ pip install -r requirements.txt -r requirements-dev.txt
48
45
  pip install -e .
49
46
 
50
47
  - name: Run test suite
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cchecksum
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: A ~8x faster drop-in replacement for eth_utils.to_checksum_address. Raises the exact same Exceptions. Implemented in C.
5
5
  Home-page: https://github.com/BobTheBuidler/cchecksum
6
6
  Author: BobTheBuidler
@@ -5,5 +5,7 @@ It keeps the exact same API as the existing implementation, exceptions and all.
5
5
  """
6
6
 
7
7
  from cchecksum._checksum import to_checksum_address
8
+ from cchecksum.monkey_patch import monkey_patch_eth_utils, monkey_patch_web3py
8
9
 
9
- __all__ = ["to_checksum_address"]
10
+
11
+ __all__ = ["to_checksum_address", "monkey_patch_eth_utils", "monkey_patch_web3py"]
@@ -0,0 +1,47 @@
1
+ from cchecksum._checksum import to_checksum_address
2
+
3
+
4
+ def monkey_patch_eth_utils() -> None:
5
+ """Monkey patch eth_utils to use cchecksum's implementation internally."""
6
+ import eth_utils
7
+ import eth_utils.address
8
+
9
+ eth_utils.to_checksum_address = to_checksum_address
10
+ eth_utils.address.to_checksum_address = to_checksum_address
11
+
12
+
13
+ def monkey_patch_web3py() -> None:
14
+ """Monkey patch web3.py to use cchecksum's implementation internally."""
15
+ import web3._utils as web3_utils
16
+ import web3.main as web3_main
17
+ import web3.middleware as web3_middleware
18
+
19
+ web3_main.to_checksum_address = to_checksum_address
20
+ web3_utils.ens.to_checksum_address = to_checksum_address
21
+ web3_utils.method_formatters.to_checksum_address = to_checksum_address
22
+ web3_utils.normalizers.to_checksum_address = to_checksum_address
23
+ web3_middleware.signing.to_checksum_address = to_checksum_address
24
+
25
+ try:
26
+ import web3.utils.address as web3_address
27
+
28
+ web3_address.to_checksum_address = to_checksum_address
29
+ except ModuleNotFoundError:
30
+ # youre on an older web3py, no monkey patch for you
31
+ pass
32
+
33
+ try:
34
+ import ens.ens
35
+
36
+ ens.ens.to_checksum_address = to_checksum_address
37
+ except ModuleNotFoundError:
38
+ # youre on an older web3py, no monkey patch for you
39
+ pass
40
+
41
+ try:
42
+ import ens.async_ens
43
+
44
+ ens.async_ens.to_checksum_address = to_checksum_address
45
+ except ModuleNotFoundError:
46
+ # youre on an older web3py, no monkey patch for you
47
+ pass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cchecksum
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: A ~8x faster drop-in replacement for eth_utils.to_checksum_address. Raises the exact same Exceptions. Implemented in C.
5
5
  Home-page: https://github.com/BobTheBuidler/cchecksum
6
6
  Author: BobTheBuidler
@@ -3,9 +3,9 @@ LICENSE
3
3
  Makefile
4
4
  README.md
5
5
  pyproject.toml
6
+ requirements-dev.txt
6
7
  requirements.txt
7
8
  setup.py
8
- test_checksum.py
9
9
  .github/workflows/black.yaml
10
10
  .github/workflows/deploy-docs.yaml
11
11
  .github/workflows/pytest.yaml
@@ -14,6 +14,7 @@ cchecksum/__init__.py
14
14
  cchecksum/_checksum.c
15
15
  cchecksum/_checksum.pyi
16
16
  cchecksum/_checksum.pyx
17
+ cchecksum/monkey_patch.py
17
18
  cchecksum/py.typed
18
19
  cchecksum.egg-info/PKG-INFO
19
20
  cchecksum.egg-info/SOURCES.txt
@@ -36,4 +37,6 @@ docs/_build/html/_static/minus.png
36
37
  docs/_build/html/_static/plus.png
37
38
  docs/_build/html/_static/pygments.css
38
39
  docs/_build/html/_static/searchtools.js
39
- docs/_build/html/_static/sphinx_highlight.js
40
+ docs/_build/html/_static/sphinx_highlight.js
41
+ tests/test_checksum.py
42
+ tests/test_monkey_patch.py
@@ -6,7 +6,7 @@
6
6
  cchecksum
7
7
  =============================================
8
8
 
9
- A ~2x faster drop-in replacement for eth_utils.to_checksum_address. Raises the exact same Exceptions. Implemented in C.
9
+ A ~8x faster drop-in replacement for eth_utils.to_checksum_address. Raises the exact same Exceptions. Implemented in C.
10
10
 
11
11
  .. automodule:: cchecksum
12
12
  :members:
@@ -0,0 +1,3 @@
1
+ eth-utils
2
+ pytest
3
+ web3
@@ -0,0 +1,23 @@
1
+ import eth_utils
2
+ import eth_utils.address
3
+ import web3.main as web3_main
4
+ import web3.middleware as web3_middleware
5
+ import web3._utils as web3_utils
6
+
7
+ import cchecksum
8
+
9
+
10
+ def test_monkey_patch_eth_utils():
11
+ cchecksum.monkey_patch_eth_utils()
12
+ assert eth_utils.to_checksum_address is cchecksum.to_checksum_address
13
+ assert eth_utils.address.to_checksum_address is cchecksum.to_checksum_address
14
+
15
+
16
+ def test_monkey_patch_web3py():
17
+ cchecksum.monkey_patch_web3py()
18
+
19
+ assert web3_main.to_checksum_address is cchecksum.to_checksum_address
20
+ assert web3_utils.ens.to_checksum_address is cchecksum.to_checksum_address
21
+ assert web3_utils.method_formatters.to_checksum_address is cchecksum.to_checksum_address
22
+ assert web3_utils.normalizers.to_checksum_address is cchecksum.to_checksum_address
23
+ assert web3_middleware.signing.to_checksum_address is cchecksum.to_checksum_address
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