Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 0 additions & 78 deletions .github/workflows/iconsdk-publish-test-pypi.yml

This file was deleted.

45 changes: 19 additions & 26 deletions .github/workflows/iconsdk-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: unittest and publish to pypi
on:
push:
branches: [master]
branches: ["master"]
pull_request:
branches: ["master"]
release:
types: [published]

Expand All @@ -11,47 +12,39 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version:
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Install uv and setup Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install dependency
run: |
python -m pip install --upgrade pip
pip install -e .[tests]
- name: Run Test
run: |
python -m pytest -ra
uv run --frozen pytest

deploy:
needs: unittest
if: github.event_name == 'release'
if: ${{ github.event_name == 'release' }}
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: "3.9"
cache: pip
- name: Install dependency
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
echo "::notice:: pip list"
pip list
uv sync --all-groups
- name: Build package
id: build_package
run: |
python setup.py sdist bdist_wheel
echo "::notice:: ls -al dist"
ls -al dist
uv build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
run: |
uv publish
4 changes: 2 additions & 2 deletions iconsdk/wallet/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def load(file_path: PathLikeObject, password: str) -> KeyWallet:
:return: An instance of Wallet class.
"""
try:
with open(file_path, 'rb') as file:
with open(file_path, 'r') as file:
private_key: bytes = extract_key_from_keyfile(file, bytes(password, 'utf-8'))
private_key_object = PrivateKey(private_key)
wallet = KeyWallet(private_key_object)
Expand Down Expand Up @@ -154,7 +154,7 @@ def to_dict(self, password: str) -> Dict[str, Any]:

@classmethod
def from_dict(cls, jso: Dict[str, Any], password: str) -> KeyWallet:
private_key: bytes = decode_keyfile_json(jso, password)
private_key: bytes = decode_keyfile_json(jso, bytes(password, 'utf-8'))
return KeyWallet.load(private_key)

def get_private_key(self, hexadecimal: bool = True) -> Union[str, bytes]:
Expand Down
50 changes: 50 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "iconsdk"
version = "2.6.0rc1"
description = """
ICON SDK for Python is a collection of libraries that allow you to
interact with local or remote ICON nodes using HTTP connections.
"""
authors = [
{ name = "ICON Foundation", email = "[email protected]" }
]
requires-python = ">=3.9"
dependencies = [
"aiohttp>=3.12.13",
"coincurve>=21.0.0",
"eth-keyfile>=0.9.1",
"multimethod>=2.0",
"requests>=2.32.4",
"websocket-client>=1.8.0",
]
license = { text = "Apache License 2.0" }
readme = "README.md"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Operating System :: OS Independent",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
]

[project.urls]
Repository = "https://github.com/icon-project/icon-sdk-python"
Releases = "https://github.com/icon-project/icon-sdk-python/releases"

[dependency-groups]
dev = [
"pytest>=8.4.0",
"requests-mock>=1.12.1",
]

[tool.hatch.build.targets.wheel]
packages = ["iconsdk"]
7 changes: 0 additions & 7 deletions requirements.txt

This file was deleted.

2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

41 changes: 0 additions & 41 deletions setup.py

This file was deleted.

Loading