diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 7c5a8be..e802081 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -24,4 +24,6 @@ jobs: uses: pdm-project/setup-pdm@v4 - name: Build and Publish distribution 📦 to PyPI - run: pdm publish + run: |- + pdm render + pdm pub-all diff --git a/packages/nonebot-plugin-nailongremove-gpu/.gitignore b/packages/nonebot-plugin-nailongremove-gpu/.gitignore deleted file mode 100644 index cc736a3..0000000 --- a/packages/nonebot-plugin-nailongremove-gpu/.gitignore +++ /dev/null @@ -1 +0,0 @@ -pyproject.toml diff --git a/packages/nonebot-plugin-nailongremove-gpu/pyproject.template.toml b/packages/nonebot-plugin-nailongremove-gpu/pyproject.template.toml deleted file mode 100644 index 197193d..0000000 --- a/packages/nonebot-plugin-nailongremove-gpu/pyproject.template.toml +++ /dev/null @@ -1,30 +0,0 @@ -[project] -name = "nonebot-plugin-nailongremove-gpu" -version = "%%version%%" -description = "识别目标并撤回图片插件" -authors = [ - { name = "445", email = "2877834692@qq.com" }, - { name = "student_2333", email = "lgc2333@126.com" }, -] -requires-python = "<4.0,>=3.9" -dependencies = [ - "nonebot-plugin-nailongremove-base==%%version%%", - "%%torch%%", - "onnxruntime-gpu>=1.19.2", -] -license = { text = "MIT" } -readme = "README.md" -keywords = ["nonebot", "plugin", "image"] - -[project.urls] -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" - -[tool.pdm.build] -includes = [] diff --git a/packages/nonebot-plugin-nailongremove-cpu/.gitignore b/packages/nonebot-plugin-nailongremove/.gitignore similarity index 100% rename from packages/nonebot-plugin-nailongremove-cpu/.gitignore rename to packages/nonebot-plugin-nailongremove/.gitignore diff --git a/packages/nonebot-plugin-nailongremove/README.md b/packages/nonebot-plugin-nailongremove/README.md new file mode 120000 index 0000000..552b4d8 --- /dev/null +++ b/packages/nonebot-plugin-nailongremove/README.md @@ -0,0 +1 @@ +../nonebot-plugin-nailongremove-base/README.md \ No newline at end of file diff --git a/packages/nonebot-plugin-nailongremove-cpu/pyproject.template.toml b/packages/nonebot-plugin-nailongremove/pyproject.template.toml similarity index 100% rename from packages/nonebot-plugin-nailongremove-cpu/pyproject.template.toml rename to packages/nonebot-plugin-nailongremove/pyproject.template.toml diff --git a/pyproject.toml b/pyproject.toml index 1089966..7313f09 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,8 +11,8 @@ dev = [ "httpx>=0.27.2", "beautifulsoup4>=4.12.3", "lxml>=5.3.0", - # "-e file:///${PROJECT_ROOT}/packages/nonebot-plugin-nailongremove-base#egg=nonebot-plugin-nailongremove-base", - # "-e file:///${PROJECT_ROOT}/packages/nonebot-plugin-nailongremove-cpu#egg=nonebot-plugin-nailongremove", + "-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", # "-e file:///${PROJECT_ROOT}/packages/nonebot-plugin-nailongremove-gpu#egg=nonebot-plugin-nailongremove-gpu", ] @@ -25,13 +25,4 @@ distribution = false [tool.pdm.scripts] render = { call = "scripts.render:main" } - -install-base = { shell = "cd packages/nonebot-plugin-nailongremove-base && pdm install && cd ../.." } -install-cpu-s = { shell = "cd packages/nonebot-plugin-nailongremove-cpu && pdm install && cd ../.." } -install-gpu-s = { shell = "cd packages/nonebot-plugin-nailongremove-gpu && pdm install && cd ../.." } -install-cpu = { composite = ["install-base", "install-cpu"] } -install-gpu = { composite = ["install-base", "install-gpu"] } - -lock-base = { shell = "cd packages/nonebot-plugin-nailongremove-base && pdm lock && cd ../.." } - pub-all = { call = "scripts.pub_all:main" } diff --git a/scripts/render.py b/scripts/render.py index 22de581..cad9789 100644 --- a/scripts/render.py +++ b/scripts/render.py @@ -98,14 +98,15 @@ def get_torch_deps() -> str: return "\n ".join(f'"{x}",' for x in deps).strip(",") -TORCH = get_torch_deps() +# TORCH = get_torch_deps() def process(file_path: Path): file_path.with_name(file_path.name.replace(".template", "")).write_text( - file_path.read_text(encoding="u8") - .replace("%%version%%", VERSION) - .replace('"%%torch%%"', TORCH), + ( + file_path.read_text(encoding="u8").replace("%%version%%", VERSION) + # .replace('"%%torch%%"', TORCH) + ), "u8", )