Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99aefa0cda | ||
|
|
9ff559b85e | ||
|
|
99fccb3b0e | ||
|
|
c0afb20503 | ||
|
|
90bd223664 | ||
|
|
aacd12bafe |
39
.github/workflows/python-publish.yml
vendored
Normal file
39
.github/workflows/python-publish.yml
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
# This workflow will upload a Python Package using Twine when a release is created
|
||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
|
||||
|
||||
# This workflow uses actions that are not certified by GitHub.
|
||||
# They are provided by a third-party and are governed by
|
||||
# separate terms of service, privacy policy, and support
|
||||
# documentation.
|
||||
|
||||
name: Upload Python Package
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install build
|
||||
- name: Build package
|
||||
run: python -m build
|
||||
- name: Publish package
|
||||
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
||||
@ -1,6 +1,6 @@
|
||||
__title__ = "pocketbase"
|
||||
__description__ = "PocketBase client SDK for python."
|
||||
__version__ = "0.8.0"
|
||||
__version__ = "0.8.1"
|
||||
|
||||
|
||||
from .client import Client
|
||||
|
||||
@ -35,10 +35,12 @@ class Client:
|
||||
base_url: str = "/",
|
||||
lang: str = "en-US",
|
||||
auth_store: BaseAuthStore | None = None,
|
||||
timeout: float = 120,
|
||||
) -> None:
|
||||
self.base_url = base_url
|
||||
self.lang = lang
|
||||
self.auth_store = auth_store or BaseAuthStore() # LocalAuthStore()
|
||||
self.timeout = timeout
|
||||
# services
|
||||
self.admins = AdminService(self)
|
||||
self.collections = CollectionService(self)
|
||||
@ -94,7 +96,7 @@ class Client:
|
||||
json=body,
|
||||
data=data,
|
||||
files=files,
|
||||
timeout=120,
|
||||
timeout=self.timeout,
|
||||
)
|
||||
except Exception as e:
|
||||
raise ClientResponseError(
|
||||
|
||||
@ -2,12 +2,13 @@ from __future__ import annotations
|
||||
|
||||
from pocketbase.models.utils.base_model import BaseModel
|
||||
from pocketbase.utils import camel_to_snake
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
|
||||
@dataclass
|
||||
class Record(BaseModel):
|
||||
collection_id: str
|
||||
collection_name: str
|
||||
expand: dict
|
||||
collection_name: str = ""
|
||||
expand: dict = field(default_factory=dict)
|
||||
|
||||
def load(self, data: dict) -> None:
|
||||
super().load(data)
|
||||
|
||||
@ -207,7 +207,7 @@ class RecordService(CrudService):
|
||||
}
|
||||
)
|
||||
response_data = self.client.send(
|
||||
self.base_collection_path() + "/auth-with-password",
|
||||
self.base_collection_path() + "/auth-with-oauth2",
|
||||
{
|
||||
"method": "POST",
|
||||
"params": query_params,
|
||||
|
||||
@ -29,7 +29,7 @@ dynamic = ["readme", "version"]
|
||||
|
||||
[tool.poetry]
|
||||
name = "pocketbase"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
description = "PocketBase SDK for python."
|
||||
authors = ["Vithor Jaeger <vaphes@gmail.com>"]
|
||||
readme = "README.md"
|
||||
|
||||
@ -5,7 +5,7 @@ from pocketbase.utils import camel_to_snake, to_datetime
|
||||
|
||||
|
||||
def test_version():
|
||||
assert __version__ == "0.8.0"
|
||||
assert __version__ == "0.8.1"
|
||||
|
||||
|
||||
def test_utils():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user