Skip to content

Commit

Permalink
wip: configure pypi in workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrrt committed Jan 5, 2025
1 parent 23a38ea commit 1dedc3c
Show file tree
Hide file tree
Showing 11 changed files with 401 additions and 9 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: sdk-python

env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

on:
push:
branches:
Expand Down Expand Up @@ -30,4 +33,8 @@ jobs:

- name: Run tests
run: uv run pytest test/
working-directory: python/

- name: Initialize PyPI config from token
run: echo $PYPI_TOKEN | uv run twine login --username __token__ --password-stdin
working-directory: python/
6 changes: 5 additions & 1 deletion python/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,8 @@ profile.json

__pycache__/
*.pyc
.pytest_cache/
.pytest_cache/

dist

*.egg-info
11 changes: 11 additions & 0 deletions python/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
clean:
rm -f *.pyc && rm -rf dist

build:
uv build

test:
uv run pytest test

publish: clean test build
uv run twine upload dist/*
3 changes: 1 addition & 2 deletions python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
### Usage

```python
from kadoa-sdk import Kadoa
from kadoa_sdk import Kadoa
kadoa_props = {
"api_key": None,
"team_api_key": os.getenv("KADOA_TEAM_API_KEY")
Expand All @@ -18,7 +18,6 @@ kadoa_client = Kadoa(**kadoa_props)
kadoa_client.realtime.listen(process_event)
```

installe
## Examples

### Requirements
Expand Down
2 changes: 1 addition & 1 deletion python/examples/realtime_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
mypath = os.path.join(os.path.dirname(__file__), "..")
sys.path.append(mypath)

from modules.core import Kadoa
from kadoa_sdk.core import Kadoa

def process_event(event):
print(f"Received event: {event['id']}, type: {event['type']}")
Expand Down
3 changes: 3 additions & 0 deletions python/kadoa_sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .core import Kadoa

__all__ = ["Kadoa"]
File renamed without changes.
File renamed without changes.
Empty file removed python/modules/__init__.py
Empty file.
10 changes: 7 additions & 3 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "kadoa-sdk"
version = "0.1.0"
description = "Kadoa python SDK"
version = "0.1.4"
description = "Kadoa official python SDK"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
Expand All @@ -10,12 +10,16 @@ dependencies = [
"websocket-client>=1.8.0",
]

[tool.setuptools]
packages = ["kadoa_sdk"]

[dependency-groups]
dev = [
"pytest>=8.3.4",
"twine>=6.0.1",
]

[tool.pytest.ini_options]
pythonpath = [
"."
]
]
368 changes: 366 additions & 2 deletions python/uv.lock

Large diffs are not rendered by default.

0 comments on commit 1dedc3c

Please sign in to comment.