Skip to content

Commit 1beb0ea

Browse files
hohPsycojoker
andauthored
feat: update our fork with upstream version 3.13.4
* Fix: Restore __init__.py to fork version * Fix: Broken imports * feat: add a ci file to run pytests * fix: add needed pysodium dependency --------- Co-authored-by: Laurent Peuch <[email protected]>
1 parent be97c24 commit 1beb0ea

File tree

4 files changed

+43
-37
lines changed

4 files changed

+43
-37
lines changed

.github/workflows/pytest.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test/Coverage with Python
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- "*"
10+
11+
jobs:
12+
tests:
13+
runs-on: ubuntu-22.04
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Python 3.12
18+
id: setup-python
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: 3.12
22+
23+
- name: Install needed debian packages
24+
run: sudo apt install libsodium-dev libgmp-dev
25+
26+
- name: Install project
27+
run: pip install -e .
28+
29+
- name: Install pytest and pytest-cov
30+
run: pip install pytest pytest-cov
31+
32+
- name: Run tests
33+
run: pytest

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ install_requires =
5656
coincurve >= 20.0.0
5757
typing_extensions
5858
fastecdsa
59+
pysodium
5960

6061
[options.packages.find]
6162
where = src

src/aleph_pytezos/__init__.py

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,7 @@
1-
"""
2-
Welcome to PyTezos!
1+
from importlib.metadata import version
32

4-
To start playing with the Tezos blockchain you need to get a PyTezosClient instance.
5-
Just type:
3+
# Change here if project is renamed and does not equal the package name
4+
dist_name = "aleph-pytezos"
5+
__version__ = version(dist_name)
66

7-
>>> from pytezos import pytezos
8-
>>> pytezos
9-
10-
And follow the interactive documentation.
11-
"""
12-
13-
import importlib.metadata
14-
15-
from pytezos.client import PyTezosClient
16-
from pytezos.contract.interface import Contract
17-
from pytezos.contract.interface import ContractInterface
18-
from pytezos.crypto.key import Key
19-
from pytezos.logging import logger
20-
from pytezos.michelson.forge import forge_micheline
21-
from pytezos.michelson.forge import unforge_micheline
22-
from pytezos.michelson.format import micheline_to_michelson
23-
from pytezos.michelson.micheline import MichelsonRuntimeError
24-
from pytezos.michelson.parse import michelson_to_micheline
25-
from pytezos.michelson.types.base import MichelsonType
26-
from pytezos.michelson.types.base import Undefined
27-
from pytezos.michelson.types.core import Unit
28-
29-
__version__ = importlib.metadata.version('pytezos')
30-
31-
pytezos = PyTezosClient()
7+
__all__ = ["__version__"]

src/aleph_pytezos/crypto/key.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@
1313

1414
from mnemonic import Mnemonic
1515

16-
from pytezos.crypto.encoding import base58_decode
17-
from pytezos.crypto.encoding import base58_encode
18-
from pytezos.crypto.encoding import scrub_input
19-
from pytezos.jupyter import InlineDocstring
20-
from pytezos.jupyter import get_class_docstring
16+
from aleph_pytezos.crypto.encoding import base58_decode, scrub_input, base58_encode
2117

2218
VALID_MNEMONIC_LENGTHS = [12, 15, 18, 21, 24]
2319
DEFAULT_LANGUAGE = 'english'
@@ -100,7 +96,7 @@ def validate_mnemonic(mnemonic: str, language: str = DEFAULT_LANGUAGE) -> None:
10096
raise ValueError('Mnemonic checksum verification failed')
10197

10298

103-
class Key(metaclass=InlineDocstring):
99+
class Key:
104100
"""Represents a public or secret key for Tezos. Ed25519, Secp256k1 and P256
105101
are supported.
106102
"""
@@ -122,8 +118,8 @@ def __repr__(self) -> str:
122118
super().__repr__(),
123119
'\nPublic key hash',
124120
self.public_key_hash(),
125-
'\nHelpers',
126-
get_class_docstring(self.__class__),
121+
'\nClass',
122+
self.__class__,
127123
]
128124
return '\n'.join(res)
129125

0 commit comments

Comments
 (0)