forked from LedgerHQ/app-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[add] Python client packaging first draft
- Loading branch information
1 parent
6bb2d8a
commit e5c82d9
Showing
52 changed files
with
177 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Python client checks, package build and deployment | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- develop | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
name: Linting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone | ||
uses: actions/checkout@v3 | ||
- run: pip install flake8 | ||
- name: Flake8 lint Python code | ||
run: find client/src/ -type f -name '*.py' -exec flake8 --max-line-length=120 '{}' '+' | ||
|
||
mypy: | ||
name: Type checking | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone | ||
uses: actions/checkout@v3 | ||
- run: pip install mypy | ||
- name: Mypy type checking | ||
run: mypy client/src | ||
|
||
build: | ||
name: Building the package | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone | ||
uses: actions/checkout@v3 | ||
- run: pip install --upgrade pip build twine | ||
- name: Build and test the package | ||
run: | | ||
cd client/ | ||
python -m build . | ||
python -m twine check dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*egg-info | ||
dist | ||
*wheel | ||
*~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include src/ledger_app_clients/ethereum/keychain/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Ethereum app Python client | ||
|
||
This package allows to communicate with the Ethereum application, either on a | ||
real device, or emulated on Speculos. | ||
|
||
## Installation | ||
|
||
This package is deployed: | ||
|
||
- on `pypi.org` for the stable version. This version will work with the | ||
application available on the `master` branch. | ||
```bash | ||
pip install ledger_app_clients.ethereum` | ||
``` | ||
- on `test.pypi.org` for the rolling release. This verison will work with the | ||
application code on the `develop` branch. | ||
```bash | ||
pip install --extra-index-url https://test.pypi.org/simple/ ledger_app_clients.ethereum` | ||
``` | ||
|
||
### Installation from sources | ||
|
||
You can install the client from this repo: | ||
|
||
```bash | ||
cd client/ | ||
pip install . | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools>=45", | ||
"setuptools_scm[toml]>=6.2", | ||
"wheel" | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "ledger_app_clients.ethereum" | ||
authors = [ | ||
{ name = "Ledger", email = "[email protected]" } | ||
] | ||
description = "Ledger Ethereum Python client" | ||
readme = { file = "README.md", content-type = "text/markdown" } | ||
# license = { file = "LICENSE" } | ||
classifiers = [ | ||
"License :: OSI Approved :: Apache License 2.0", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Operating System :: POSIX :: Linux", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: MacOS :: MacOS X", | ||
] | ||
dynamic = [ "version" ] | ||
requires-python = ">=3.7" | ||
dependencies = [ | ||
"ragger[speculos]", | ||
"simple-rlp", | ||
] | ||
|
||
[tools.setuptools] | ||
include-package-data = true | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "ledger_app_clients.ethereum.__version__"} | ||
|
||
[project.urls] | ||
Home = "https://github.com/LedgerHQ/app-ethereum" | ||
|
||
# [tool.setuptools_scm] | ||
# write_to = "ledgerwallet/__version__.py" | ||
# local_scheme = "no-local-version" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = "0.0.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .struct import EIP712FieldType # noqa |
1 change: 1 addition & 0 deletions
1
tests/ragger/app/eip712.py → ...ger_app_clients/ethereum/eip712/struct.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
from enum import IntEnum, auto | ||
|
||
|
||
class EIP712FieldType(IntEnum): | ||
CUSTOM = 0, | ||
INT = auto() | ||
|
3 changes: 2 additions & 1 deletion
3
tests/ragger/keychain.py → ...c/ledger_app_clients/ethereum/keychain.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
tests/ragger/app/settings.py → ...c/ledger_app_clients/ethereum/settings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ragger[speculos] | ||
pytest | ||
ecdsa | ||
simple-rlp | ||
./client/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters