Compare commits
No commits in common. "master" and "v0.8.0" have entirely different histories.
39
.github/workflows/python-publish.yml
vendored
39
.github/workflows/python-publish.yml
vendored
@ -1,39 +0,0 @@
|
|||||||
# 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"
|
__title__ = "pocketbase"
|
||||||
__description__ = "PocketBase client SDK for python."
|
__description__ = "PocketBase client SDK for python."
|
||||||
__version__ = "0.8.1"
|
__version__ = "0.8.0"
|
||||||
|
|
||||||
|
|
||||||
from .client import Client
|
from .client import Client
|
||||||
|
|||||||
@ -35,12 +35,10 @@ class Client:
|
|||||||
base_url: str = "/",
|
base_url: str = "/",
|
||||||
lang: str = "en-US",
|
lang: str = "en-US",
|
||||||
auth_store: BaseAuthStore | None = None,
|
auth_store: BaseAuthStore | None = None,
|
||||||
timeout: float = 120,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
self.base_url = base_url
|
self.base_url = base_url
|
||||||
self.lang = lang
|
self.lang = lang
|
||||||
self.auth_store = auth_store or BaseAuthStore() # LocalAuthStore()
|
self.auth_store = auth_store or BaseAuthStore() # LocalAuthStore()
|
||||||
self.timeout = timeout
|
|
||||||
# services
|
# services
|
||||||
self.admins = AdminService(self)
|
self.admins = AdminService(self)
|
||||||
self.collections = CollectionService(self)
|
self.collections = CollectionService(self)
|
||||||
@ -96,7 +94,7 @@ class Client:
|
|||||||
json=body,
|
json=body,
|
||||||
data=data,
|
data=data,
|
||||||
files=files,
|
files=files,
|
||||||
timeout=self.timeout,
|
timeout=120,
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise ClientResponseError(
|
raise ClientResponseError(
|
||||||
|
|||||||
@ -2,13 +2,12 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from pocketbase.models.utils.base_model import BaseModel
|
from pocketbase.models.utils.base_model import BaseModel
|
||||||
from pocketbase.utils import camel_to_snake
|
from pocketbase.utils import camel_to_snake
|
||||||
from dataclasses import dataclass, field
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class Record(BaseModel):
|
class Record(BaseModel):
|
||||||
collection_id: str
|
collection_id: str
|
||||||
collection_name: str = ""
|
collection_name: str
|
||||||
expand: dict = field(default_factory=dict)
|
expand: dict
|
||||||
|
|
||||||
def load(self, data: dict) -> None:
|
def load(self, data: dict) -> None:
|
||||||
super().load(data)
|
super().load(data)
|
||||||
|
|||||||
@ -207,7 +207,7 @@ class RecordService(CrudService):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
response_data = self.client.send(
|
response_data = self.client.send(
|
||||||
self.base_collection_path() + "/auth-with-oauth2",
|
self.base_collection_path() + "/auth-with-password",
|
||||||
{
|
{
|
||||||
"method": "POST",
|
"method": "POST",
|
||||||
"params": query_params,
|
"params": query_params,
|
||||||
|
|||||||
@ -29,7 +29,7 @@ dynamic = ["readme", "version"]
|
|||||||
|
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "pocketbase"
|
name = "pocketbase"
|
||||||
version = "0.8.1"
|
version = "0.8.0"
|
||||||
description = "PocketBase SDK for python."
|
description = "PocketBase SDK for python."
|
||||||
authors = ["Vithor Jaeger <vaphes@gmail.com>"]
|
authors = ["Vithor Jaeger <vaphes@gmail.com>"]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|||||||
@ -5,7 +5,7 @@ from pocketbase.utils import camel_to_snake, to_datetime
|
|||||||
|
|
||||||
|
|
||||||
def test_version():
|
def test_version():
|
||||||
assert __version__ == "0.8.1"
|
assert __version__ == "0.8.0"
|
||||||
|
|
||||||
|
|
||||||
def test_utils():
|
def test_utils():
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user