mirror of
https://github.com/Refound-445/nonebot-plugin-nailongremove.git
synced 2025-09-27 00:59:13 +08:00
up
This commit is contained in:
parent
75153acbc5
commit
b925734181
24
.github/workflows/pre-commit.yml
vendored
Normal file
24
.github/workflows/pre-commit.yml
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
name: Pre Commit Check
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
pre-commit:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: true
|
||||
|
||||
- name: Install project dependencies
|
||||
run: |-
|
||||
pdm config python.use_venv false
|
||||
pdm --pep582
|
||||
pdm pre-install
|
||||
pdm install -G:all
|
||||
|
||||
- uses: pre-commit/action@v3.0.1
|
14
.pre-commit-config.yaml
Normal file
14
.pre-commit-config.yaml
Normal file
@ -0,0 +1,14 @@
|
||||
repos:
|
||||
- repo: https://github.com/DetachHead/basedpyright-pre-commit-mirror
|
||||
rev: v1.13.0
|
||||
hooks:
|
||||
- id: basedpyright
|
||||
language: system
|
||||
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.7.4
|
||||
hooks:
|
||||
- id: ruff-format
|
||||
- id: ruff
|
||||
args: ['--fix']
|
||||
- id: ruff-format
|
@ -5,7 +5,7 @@
|
||||
groups = ["default"]
|
||||
strategy = ["inherit_metadata"]
|
||||
lock_version = "4.5.0"
|
||||
content_hash = "sha256:58b9cabad0aef97f60e2e1974ac4d343dfe3109fb15d1e836f7ae19333f8ba39"
|
||||
content_hash = "sha256:2f74c56fbdcd0faabf96c80c486c987ddb72e2441143a8aa315fdae252e2b9ed"
|
||||
|
||||
[[metadata.targets]]
|
||||
requires_python = "~=3.9"
|
||||
|
@ -19,8 +19,8 @@ dependencies = [
|
||||
"githubkit>=0.11.14",
|
||||
"yarl>=1.17.1",
|
||||
"tqdm>=4.66.6",
|
||||
"huggingface-hub>=0.26",
|
||||
"ultralytics>=8.3",
|
||||
"huggingface-hub>=0.26.2",
|
||||
"ultralytics>=8.3.31",
|
||||
"gradio-client>=1.3.0",
|
||||
]
|
||||
license = { text = "MIT" }
|
||||
@ -31,8 +31,6 @@ keywords = ["nonebot", "plugin", "image"]
|
||||
homepage = "https://github.com/Refound-445/nonebot-plugin-nailongremove"
|
||||
repository = "https://github.com/Refound-445/nonebot-plugin-nailongremove"
|
||||
|
||||
[project.optional-dependencies]
|
||||
|
||||
[build-system]
|
||||
requires = ["pdm-backend"]
|
||||
build-backend = "pdm.backend"
|
||||
@ -42,4 +40,4 @@ includes = []
|
||||
|
||||
[tool.pdm.version]
|
||||
source = "file"
|
||||
path = "nonebot_plugin_nailongremove/__init__.py"
|
||||
path = "nonebot_plugin_nailongremove/__init__.py"
|
||||
|
@ -8,6 +8,13 @@ readme = "README.md"
|
||||
|
||||
[tool.pdm.dev-dependencies]
|
||||
dev = [
|
||||
# pip
|
||||
"setuptools>=73.0.1",
|
||||
"pip>=24.2",
|
||||
# tools
|
||||
"basedpyright>=1.17.0",
|
||||
"ruff>=0.6.2",
|
||||
# packages
|
||||
"-e file:///${PROJECT_ROOT}/packages/nonebot-plugin-nailongremove-base#egg=nonebot-plugin-nailongremove-base",
|
||||
"-e file:///${PROJECT_ROOT}/packages/nonebot-plugin-nailongremove#egg=nonebot-plugin-nailongremove",
|
||||
]
|
||||
@ -25,3 +32,88 @@ render = { call = "scripts.src.render:main" }
|
||||
pre-install = { composite = ["install-scripts", "render"] }
|
||||
pub-all-pub = { call = "scripts.src.pub_all:main" }
|
||||
pub-all = { composite = ["render", "pub-all-pub"] }
|
||||
|
||||
[tool.basedpyright]
|
||||
pythonVersion = "3.9"
|
||||
defineConstant = { PYDANTIC_V2 = true }
|
||||
typeCheckingMode = "standard"
|
||||
reportShadowedImports = false
|
||||
exclude = ["__pypackages__"]
|
||||
|
||||
[tool.ruff]
|
||||
target-version = "py39"
|
||||
|
||||
[tool.ruff.format]
|
||||
docstring-code-format = true
|
||||
line-ending = "lf"
|
||||
|
||||
[tool.ruff.lint]
|
||||
preview = true
|
||||
ignore = [
|
||||
"B008",
|
||||
"B905",
|
||||
# "COM812",
|
||||
"E501",
|
||||
"F821", # conflict with pyright
|
||||
"FBT001",
|
||||
"FBT002",
|
||||
"ISC001",
|
||||
"PERF203",
|
||||
"PGH003",
|
||||
"PLC04",
|
||||
"RUF001",
|
||||
"RUF002",
|
||||
"RUF003",
|
||||
"RUF006",
|
||||
"RUF029",
|
||||
"RUF100",
|
||||
"S101",
|
||||
"S311",
|
||||
"S404",
|
||||
"SIM117",
|
||||
"TRY002",
|
||||
"TRY003",
|
||||
]
|
||||
select = [
|
||||
"A",
|
||||
"ANN001",
|
||||
"ARG",
|
||||
"ASYNC",
|
||||
"B",
|
||||
"C4",
|
||||
"COM",
|
||||
"DTZ",
|
||||
"E",
|
||||
"F",
|
||||
"FBT",
|
||||
"FLY",
|
||||
"FURB",
|
||||
"I",
|
||||
"ISC",
|
||||
"N",
|
||||
"NPY",
|
||||
"PERF",
|
||||
"PIE",
|
||||
"PGH",
|
||||
# "PL",
|
||||
"PT",
|
||||
"PTH",
|
||||
"PYI",
|
||||
"Q",
|
||||
"RET",
|
||||
"RSE",
|
||||
"RUF",
|
||||
"S",
|
||||
"SIM",
|
||||
"SLF",
|
||||
"SLOT",
|
||||
"TCH",
|
||||
"TRY",
|
||||
"YTT",
|
||||
]
|
||||
|
||||
[tool.ruff.lint.isort]
|
||||
combine-as-imports = true
|
||||
detect-same-package = true
|
||||
extra-standard-library = ["typing_extensions"]
|
||||
split-on-trailing-comma = true
|
||||
|
@ -2,7 +2,10 @@ import re
|
||||
from pathlib import Path
|
||||
from typing import TypedDict
|
||||
|
||||
import tomllib
|
||||
try:
|
||||
import tomllib # pyright: ignore[reportMissingImports]
|
||||
except ModuleNotFoundError:
|
||||
import tomli as tomllib
|
||||
|
||||
from .utils import PACKAGES_PATH
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user