From ba9c0bcb2245ed8beeb94d5990719b9a9b9ed53a Mon Sep 17 00:00:00 2001 From: tohru <65994850+Tohrusky@users.noreply.github.com> Date: Wed, 27 Dec 2023 22:20:33 +0800 Subject: [PATCH] build: update pyproject.toml --- .github/workflows/CI-Linux-x64-Clang.yml | 2 +- .github/workflows/CI-Linux-x64-GCC.yml | 2 +- .github/workflows/CI-MacOS-Universal-Clang.yml | 2 +- .github/workflows/CI-Windows-x64-MSVC.yml | 2 +- pyproject.toml | 17 ++++++++--------- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/CI-Linux-x64-Clang.yml b/.github/workflows/CI-Linux-x64-Clang.yml index 5cd83dc..316ee7f 100644 --- a/.github/workflows/CI-Linux-x64-Clang.yml +++ b/.github/workflows/CI-Linux-x64-Clang.yml @@ -69,7 +69,7 @@ jobs: - name: Test run: | cp src/build/waifu2x_ncnn_vulkan_wrapper.*.so src/waifu2x_ncnn_py - pdm run dev + pdm install pdm run test - name: dist diff --git a/.github/workflows/CI-Linux-x64-GCC.yml b/.github/workflows/CI-Linux-x64-GCC.yml index def20e6..6377653 100644 --- a/.github/workflows/CI-Linux-x64-GCC.yml +++ b/.github/workflows/CI-Linux-x64-GCC.yml @@ -66,7 +66,7 @@ jobs: - name: Test run: | cp src/build/waifu2x_ncnn_vulkan_wrapper.*.so src/waifu2x_ncnn_py - pdm run dev + pdm install pdm run test - name: dist diff --git a/.github/workflows/CI-MacOS-Universal-Clang.yml b/.github/workflows/CI-MacOS-Universal-Clang.yml index f2246eb..3f3a5b3 100644 --- a/.github/workflows/CI-MacOS-Universal-Clang.yml +++ b/.github/workflows/CI-MacOS-Universal-Clang.yml @@ -107,7 +107,7 @@ jobs: - name: Test run: | - pdm run dev + pdm install pdm run test - name: dist diff --git a/.github/workflows/CI-Windows-x64-MSVC.yml b/.github/workflows/CI-Windows-x64-MSVC.yml index e49d22d..102722a 100644 --- a/.github/workflows/CI-Windows-x64-MSVC.yml +++ b/.github/workflows/CI-Windows-x64-MSVC.yml @@ -67,7 +67,7 @@ jobs: run: | echo F | xcopy .\src\build\Release\waifu2x_ncnn_vulkan_wrapper.*.pyd .\src\waifu2x_ncnn_py echo F | xcopy .\tests\vulkan-1.dll .\src\waifu2x_ncnn_py - pdm run dev + pdm install pdm run test - name: dist diff --git a/pyproject.toml b/pyproject.toml index ac173a6..53b22c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,21 +50,20 @@ test = [ "scikit-image" ] -[tool.pdm.scripts.dev] -composite = [ - "pdm install --dev", - "pre-commit install" -] -help = "Install the dev packages" - [tool.pdm.scripts.lint] composite = [ + "mypy src/waifu2x_ncnn_py tests", "ruff check . --fix --exit-non-zero-on-fix", - "ruff format .", - "mypy src/waifu2x_ncnn_py tests" + "ruff format ." ] help = "Check code style against linters" +[tool.pdm.scripts.post_install] +composite = [ + "pre-commit install" +] +help = "Install the pre-commit hook" + [tool.pdm.scripts.test] cmd = "pytest tests --cov=src --cov-report=xml --cov-report=html" help = "Run tests with coverage"