aports/testing/py3-duniterpy/Support_py3-libnacl_1.9.0.patch
Celeste ade8f560e6 testing/py3-duniterpy: fix build
- Add py3-jsonschema and py3-attrs to depends
  (py3-jsonschema is no longer a dependency of poetry since 1.7.0,
   and in that case is wrongly a part of makedepends anyway;
   py3-attrs is listed under "Requirements" in README.md)

- Apply https://git.duniter.org/clients/python/duniterpy/-/commit/5dbf13c6
  to fix compatibility with new poetry

- Apply relevant parts of
  https://git.duniter.org/clients/python/duniterpy/-/commit/ad8f6a26
  to fix compatibility with new py3-libnacl
2023-12-14 15:45:21 +00:00

25 lines
827 B
Diff

diff --git a/duniterpy/key/ascii_armor.py b/duniterpy/key/ascii_armor.py
index 9ab3efe47b0224179926f04bc3c2be03674fbccd..84b8c68335d83dad70d8e61a7b013d6a830c6047 100644
--- a/duniterpy/key/ascii_armor.py
+++ b/duniterpy/key/ascii_armor.py
@@ -14,11 +14,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import base64
+import importlib.metadata
import re
from typing import Any, Dict, List, Optional
import libnacl
-from libnacl.version import version as libnacl_version
from .encryption_key import PublicKey
from .signing_key import SigningKey
@@ -33,6 +33,7 @@ HEADER_PREFIX = "-----"
DASH_ESCAPE_PREFIX = "\x2D\x20"
# Version field value
+libnacl_version = importlib.metadata.version("libnacl")
VERSION_FIELD_VALUE = f"Python Libnacl {libnacl_version}"
# Parser cursor status