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
40 changes: 40 additions & 0 deletions .github/tests/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"""
Verify that pyproject.toml version is greater than `main` branch want
"""
import tomllib
import urllib.request
from packaging.version import Version
from pathlib import Path

def read_version(raw: bytes) -> str:
"""
Extract the `version` from `pyproject.toml`
"""
return tomllib.loads(raw.decode())["project"]["version"]


def fetch_current_version() -> str:
"""
Read `pyproject.toml` file from the working tree.
"""
pyproject = Path(__file__).resolve().parents[2] / "pyproject.toml"
return read_version(pyproject.read_bytes())


def fetch_base_version(repo: str = "status-im/status-python-sdk", branch: str = "master") -> str:
"""
Fetch `pyproject.toml` file from Github.
"""
url = f"https://raw.githubusercontent.com/{repo}/{branch}/pyproject.toml"

with urllib.request.urlopen(url, timeout=30) as response:
return read_version(response.read())



if __name__ == "__main__":
current_version = Version(fetch_current_version())
uploaded_version = Version(fetch_base_version())

if current_version <= uploaded_version:
raise Exception(f"Branch version ({current_version}) must be greater than GitHub `master` ({uploaded_version}). Please update pyproject.toml")
26 changes: 26 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Tests

on:
pull_request:
branches: [master]
types: [opened, synchronize, reopened]

jobs:
version:
name: Verify Version Bump
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install packaging
run: python -m pip install --upgrade packaging

- name: Compare versions
run: python .github/tests/version.py
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Status Python SDK

![Status Python SDK header image](./docs/images/overview-header.png)
![Status Python SDK header image](./docs/images/readme/overview.png)

[Status](http://status.app/) is a decentralized, open-source super app combining a crypto wallet, messenger, and community spaces. It uses peer-to-peer technology so no central server can censor your messages or access your data.

Expand All @@ -26,7 +26,9 @@ graph TB


subgraph bot[status-im/status-python-sdk]
REQUIREMENTS[requirements.txt]
GROUP_CHAT[class GroupChat]
COMMUNITY[class Community]
CHANNEL[class Channel]
SDK[class Account]
SIGNAL[class Signal]
end
Expand All @@ -37,6 +39,9 @@ graph TB
INFURA[Infura]
end

COMMUNITY --> CHANNEL
COMMUNITY <--> |logged in Account| SDK
GROUP_CHAT <--> |logged in Account| SDK
SDK --> SIGNAL
SDK --> |Port 8080| RPC
SDK --> |Port 8080| HTTP
Expand Down Expand Up @@ -71,6 +76,14 @@ sequenceDiagram

#### Install

##### [PyPI](https://pypi.org/project/status-sdk/)

```
pip install status-sdk
```

##### Locally

Clone the repository and move into it:

```
Expand Down
Loading
Loading