Skip to content

Commit 4264c0e

Browse files
committed
Merge branch 'master' into develop
2 parents 6dbb53c + a87863d commit 4264c0e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+436
-448
lines changed

.github/workflows/deploy.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: deploy
1+
name: 🚀 Deploy Docs
22
on:
33
push:
44
branches:
@@ -10,22 +10,22 @@ jobs:
1010
deploy:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Checkout
13+
- name: 🛒 Checkout
1414
uses: actions/checkout@master
15-
- name: Set up Python 3.8
15+
- name: 🐍 Set up Python 3.10
1616
uses: actions/setup-python@v4
1717
with:
18-
python-version: 3.8
19-
- name: Install dependencies
18+
python-version: '3.10'
19+
- name: 🧰 Install dependencies
2020
run: make install IGNORE_VENV=1
21-
- name: Build Docs
21+
- name: 📚 Build Docs
2222
run: |
2323
make docs
2424
touch docs/build/html/.nojekyll
25-
- name: Deploy Docs
25+
- name: 🚀 Deploy Docs
2626
uses: peaceiris/[email protected]
2727
env:
28-
PERSONAL_TOKEN: ${{ secrets.ACCESS_TOKEN }}
28+
PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2929
PUBLISH_BRANCH: gh-pages
3030
PUBLISH_DIR: docs/build/html
3131
#- name: Build Package

.github/workflows/testing.yml

+14-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
1-
name: testing
1+
name: 🧪 Test
22

33
on: [push]
44

55
jobs:
66
test:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v1
10-
- name: Set up Python 3.8
9+
- name: 🛒 Checkout
10+
uses: actions/checkout@v3
11+
- name: 🐍 Set up Python 3.10
1112
uses: actions/setup-python@v4
1213
with:
13-
python-version: 3.8
14-
- name: Install dependencies
14+
python-version: '3.10'
15+
- name: 🧰 Install dependencies
1516
run: make install IGNORE_VENV=1
16-
- name: Lint
17+
- name: 👮 Lint
1718
run: make lint
18-
- name: Test
19+
- name: 🔍 Type check
20+
uses: jakebailey/pyright-action@v1
21+
with:
22+
version: 1.1.317
23+
python-version: '3.10'
24+
warnings: true
25+
- name: 🧪 Test
1926
run: make tests

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ build/
66
dist/
77
/.vscode/
88
/.idea/
9+
/venv/

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
IGNORE_VENV ?= FALSE
99

10-
PACKAGE_FOLDERS = convex_api tools
10+
PACKAGE_FOLDERS = convex_api tools tests
1111

1212
FLAKE8_PARAMETERS = --max-line-length=132 --statistics $(PACKAGE_FOLDERS)
1313

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Convex API
22

33
![](https://github.com/Convex-Dev/convex-api-py/workflows/testing/badge.svg)
4+
[![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)
45

56
[Documentation](https://convex-dev.github.io/convex-api-py)
67

convex_api/account.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
55
66
"""
7+
from __future__ import annotations
78

89
import re
9-
from typing import Union
1010
from convex_api.key_pair import KeyPair
1111

1212

1313
class Account:
1414

1515
@staticmethod
16-
def is_address(text: Union[int, str]) -> bool:
16+
def is_address(text: int | str) -> bool:
1717
"""
1818
Returns True if the text value is a valid address.
1919
@@ -25,9 +25,9 @@ def is_address(text: Union[int, str]) -> bool:
2525
return Account.to_address(text) >= 0
2626

2727
@staticmethod
28-
def to_address(value: Union['Account', int, str]) -> int:
28+
def to_address(value: Account | int | str) -> int:
2929
"""
30-
Convert address text with possible leading '#' to an interger address value.
30+
Convert address text with possible leading '#' to an integer address value.
3131
3232
:param str text: Address text to convert
3333
@@ -47,7 +47,7 @@ def to_address(value: Union['Account', int, str]) -> int:
4747
raise ValueError(f'Invalid address {value}')
4848
return address
4949

50-
def __init__(self, key_pair: KeyPair, address: Union['Account', int, str], name: Union[str, None] = None):
50+
def __init__(self, key_pair: KeyPair, address: Account | int | str, name: str | None = None):
5151
"""
5252
5353
Create a new account with a private key KeyPair.
@@ -133,7 +133,7 @@ def address(self) -> int:
133133
return self._address
134134

135135
@address.setter
136-
def address(self, value: Union['Account', int, str]) -> None:
136+
def address(self, value: Account | int | str) -> None:
137137
"""
138138
139139
Sets the network address of this account
@@ -154,7 +154,7 @@ def address(self, value: Union['Account', int, str]) -> None:
154154
self._address = Account.to_address(value)
155155

156156
@property
157-
def name(self) -> Union[str, None]:
157+
def name(self) -> str | None:
158158
return self._name
159159

160160
@name.setter

0 commit comments

Comments
 (0)