Skip to content

Commit 3ebff84

Browse files
committed
chore: auto-versioning from git tags when release
1 parent f2ede88 commit 3ebff84

File tree

3 files changed

+26
-16
lines changed

3 files changed

+26
-16
lines changed

.github/workflows/release-build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222

2323
steps:
2424
- uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0 # Fetch all history for setuptools_scm to detect version from git tags
2527

2628
- name: Set up Go
2729
uses: actions/setup-go@v4
@@ -49,7 +51,7 @@ jobs:
4951

5052
- name: Install build tools
5153
run: |
52-
python3 -m pip install --upgrade pip setuptools wheel pybindgen build
54+
python3 -m pip install --upgrade pip setuptools wheel pybindgen build setuptools-scm
5355
5456
- name: Build gopy bindings
5557
run: make gopy_build

README.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,25 @@ If you need help, don't hesitate to [open an issue](https://github.com/trufnetwo
1515

1616
### Installation
1717

18-
Install the pre-built wheel for your platform by substituting the desired version and platform in the URL:
18+
**To install the latest version:**
1919

20-
```
21-
pip install https://github.com/trufnetwork/sdk-py/releases/download/v<version>/trufnetwork_sdk_py-<platform>.whl
22-
```
20+
1. Visit the [**releases page**](https://github.com/trufnetwork/sdk-py/releases/latest)
21+
2. Download the wheel file (`.whl`) for your platform:
22+
- **Linux**: `*manylinux*.whl`
23+
- **macOS**: `*macosx*.whl`
24+
3. Install using pip:
25+
```bash
26+
pip install /path/to/downloaded/wheel.whl
27+
```
2328

24-
Examples:
25-
- Linux:
26-
```
27-
pip install https://github.com/trufnetwork/sdk-py/releases/download/v0.3.2/trufnetwork_sdk_py-0.3.2-py3-none-manylinux_2_28_x86_64.whl
28-
```
29-
- macOS:
30-
```
31-
pip install https://github.com/trufnetwork/sdk-py/releases/download/v0.3.2/trufnetwork_sdk_py-0.3.2-py3-none-macosx_11_0_universal2.whl
32-
```
29+
Or install directly from the URL (right-click the wheel file → copy link):
30+
```bash
31+
pip install https://github.com/trufnetwork/sdk-py/releases/download/vX.X.X/trufnetwork_sdk_py-X.X.X-....whl
32+
```
3333

34-
Alternatively, if you are using a `pyproject.toml` file for dependency management, add the following:
34+
**Alternative: Install from source** (always gets the latest from the `main` branch):
35+
36+
If you are using a `pyproject.toml` file for dependency management, add the following:
3537

3638
```toml
3739
[project]
@@ -48,6 +50,8 @@ Then install the dependencies:
4850
pip install .
4951
```
5052

53+
> **Note:** This approach requires Go to be installed for compiling C bindings during installation.
54+
5155
## Development
5256

5357
It is recommended to use a virtual environment to develop the SDK.

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "trufnetwork_sdk_py"
7-
version = "0.3.3"
7+
dynamic = ["version"]
88
authors = [{ name = "Truf Network", email = "developer@truf.network" }]
99
description = "A Python SDK for Truf Network"
1010
readme = "README.md"
@@ -39,6 +39,10 @@ python_files = ["test_*.py"]
3939
python_classes = ["Test*"]
4040
python_functions = ["test_*"]
4141

42+
[tool.setuptools_scm]
43+
version_scheme = "post-release"
44+
local_scheme = "no-local-version"
45+
4246
[tool.pyright]
4347
type_checking_mode = "strict"
4448
reportUnknownArgumentType = false

0 commit comments

Comments
 (0)