Skip to content

Commit

Permalink
Update github actions and README.md
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Bair <[email protected]>
  • Loading branch information
rbair23 committed Dec 20, 2024
1 parent e8dc25f commit 58056df
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 21 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@ jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# See https://docs.astral.sh/uv/guides/integration/github/#caching For information on `uv`
- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Setup Python
run: uv python install

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
run: uv sync --all-extras --dev

- name: Prepare Hedera Solo
id: solo
Expand Down
34 changes: 22 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,22 @@ This is a Python SDK for interacting with the Hedera Hashgraph platform. It allo

## Installation

0. Install Poetry:
0. Install `uv`:

`uv` is an ultra-fast Python package and project manager. It replaces `pip`, `pip-tools`, `pipx`, `poetry`, `pyenv`,
`virtualenv`, and more.

```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```

If on macOS, you can also install `uv` using Homebrew:

```bash
pipx install poetry
brew install uv
```

Other installation methods can be found [here](https://python-poetry.org/docs/#installation).
Other installation methods can be found [here](https://docs.astral.sh/uv/getting-started/installation/).

1. Clone this repository:

Expand All @@ -35,16 +44,17 @@ cd hedera_sdk_python

2. Install dependencies:

NOTE: On macOS, you may need to set up the .venv first, so it can find python. Mac comes with python 3.9+,
but under the name `python3` instead of `python`, which `poetry` expects. To fix this, run:
One of the really nice features of `uv` is that it will download and manage the correct version of python and build
with the correct version of python based on the `.python-version` file in the project. This means you don't have to
worry about managing multiple versions of python on your machine!

```bash
python3 -m venv .venv
uv sync
./generate_proto.sh
```

```
poetry install
```
To update to a newer version of the protobuf libraries, edit the `generate_proto.sh` file and change the version number
and then rerun it.

## Environment Setup

Expand All @@ -56,6 +66,7 @@ OPERATOR_ID=0.0.1234xx
OPERATOR_KEY=302e020100300506032b657004220420...
RECIPIENT_ID=0.0.789xx
TOKEN_ID=0.0.100xx
NETWORK=testnet
```

A [sample .env](.env.example) file is provided in the root of this project. If you do not have an account on
Expand All @@ -66,7 +77,7 @@ testnet [here](https://docs.hedera.com/guides/testnet).

To run the test suite for the SDK, use the following command:
```
pytest ./tests
uv run pytest
```

The test file in the root of this project will be automatically run when pushing onto a branch.
Expand All @@ -75,7 +86,7 @@ This is done by running 'Hedera Solo'. Read more about it here:
- [Github Marketplace](https://github.com/marketplace/actions/hedera-solo)
- [Blog Post by Hendrik Ebbers](https://dev.to/hendrikebbers/ci-for-hedera-based-projects-2nja)


```bash

#### Output:
```
Expand All @@ -87,7 +98,6 @@ Token association successful.
Token transfer successful.
```

## Usage
Below are examples of how to use the SDK for creating tokens, associating them with accounts, and transferring tokens (also see 'examples' directiory)
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 58056df

Please sign in to comment.