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
14 changes: 7 additions & 7 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
# 最近更新时间 等 git 日志相关信息,需要拉取全部提交记录
# "最近更新时间" 等 git 日志相关信息,需要拉取全部提交记录
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
# 选择要使用的 node 版本
node-version: '18.8.0'
node-version: '20'
- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v4
with:
version: 7.17.0
version: 9
# 如果缓存没有命中,安装依赖
- name: Install dependencies
run: pnpm install --dir docs
Expand All @@ -44,7 +44,7 @@ jobs:
# 查看 workflow 的文档来获取更多信息
# @see https://github.com/crazy-max/ghaction-github-pages
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v2
uses: crazy-max/ghaction-github-pages@v4
with:
# 部署到 gh-pages 分支
target_branch: gh-pages
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

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

- name: Install Poetry
uses: snok/install-poetry@v1
Expand All @@ -32,7 +32,8 @@ jobs:
id: check-version
run: |
[[ "$(poetry version --short)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] \
|| echo ::set-output name=prerelease::true
&& echo "prerelease=false" >> $GITHUB_OUTPUT \
|| echo "prerelease=true" >> $GITHUB_OUTPUT

- name: Create Release
uses: ncipollo/release-action@v1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
fail-fast: true
matrix:
os: [ "ubuntu-latest" ]
python-version: [ "3.8", "3.9", "3.10" ]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
Expand Down
11 changes: 5 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ packages = [
]

[tool.poetry.dependencies]
python = "^3.7"
typing-extensions = [
{ version = "^4.0.0", python = ">=3.6,<3.7" },
{ version = "^4.5.0", python = ">=3.7" }
]
python = "^3.8"
typing-extensions = "^4.5.0"


[tool.poetry.group.test.dependencies]
Expand All @@ -27,9 +24,11 @@ ruff = "*"
pre-commit = "*"
pre-commit-hooks = "*"

[tool.ruff]
[tool.ruff.lint]
ignore = [
"E501", # line too long, handled by black
"F403", # star imports
"F405", # may be undefined from star imports
]

[build-system]
Expand Down
1 change: 0 additions & 1 deletion src/usepy/decorator/throttle.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def __init__(self, delay: int):
def __call__(self, func):
@wraps(func)
def wrapper(*args, **kwargs):
nonlocal self
current_time = time.time()
if current_time - self.last_called >= self.delay:
result = func(*args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion src/usepy/list/flatten.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import TypeVar, List, Union, Optional
from typing import TypeVar, List, Union

T = TypeVar("T")
D = TypeVar("D", int, float)
Expand Down
2 changes: 1 addition & 1 deletion src/usepy/misc/dynamic_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def dynamic_import(module_string: str):
function_name = ""
module = importlib.import_module(module_string)
except Exception as e:
raise ImportError(f"无法导入 {module_string}")
raise ImportError(f"无法导入 {module_string}: {e}") from e

function = getattr(module, function_name, None)
return module, function
2 changes: 2 additions & 0 deletions src/usepy/typing_.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
from typing import Union
else:
from typing_extensions import Union

__all__ = ["Union"]
Loading