From aadf769f5c4bdad2c97a9a76a1c7a74d2415f584 Mon Sep 17 00:00:00 2001 From: Waket Zheng Date: Thu, 24 Oct 2024 18:00:28 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Migrate=20version=20plugin=20to?= =?UTF-8?q?=20poetry-dynamic-versioning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- pyproject.toml | 12 ++++++------ scripts/test.py | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d8485e..2fc1aa6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: run: | python -m pip install --upgrade pip poetry poetry config virtualenvs.create false - poetry self add poetry-version-plugin + poetry self add "poetry-dynamic-versioning[plugin]" - name: Install requirements run: | poetry install diff --git a/pyproject.toml b/pyproject.toml index a2b1f58..c392364 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "fastapi-cdn-host" -version = "0" # Handled by poetry-version-plugin with value in fastapi_cdn_host/__init__.py +version = "0.0.0" # Managed by poetry-dynamic-versioning with value in fastapi_cdn_host/__init__.py description = "Auto choose the fastest cdn host for fastapi project docs." homepage = "https://github.com/waketzheng/fastapi-cdn-host" repository = "https://github.com/waketzheng/fastapi-cdn-host.git" @@ -30,9 +30,12 @@ bandit = "^1.7.10" trio = ">=0.26.2,<0.28.0" fastapi-cli = "*" + +[tool.poetry-dynamic-versioning] +enable = true [build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" +requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] +build-backend = "poetry_dynamic_versioning.backend" [tool.mypy] pretty = true @@ -69,6 +72,3 @@ fastcdn = "fastapi_cdn_host:cli.main" [tool.bandit] exclude_dirs = ["tests", "fastapi_cdn_host/cli.py"] - -[tool.poetry-version-plugin] -source = "init" diff --git a/scripts/test.py b/scripts/test.py index c54e171..1d423b1 100755 --- a/scripts/test.py +++ b/scripts/test.py @@ -64,12 +64,12 @@ def combine_result_files(shell=COMBINE) -> None: if not folder.is_dir(): continue chdir(folder) - run_command("coverage run -m pytest -s", tool="") + run_command("coverage run -m pytest -s") else: run_command(CMD) for eg in ("normal", "offline"): chdir(work_dir / "examples" / eg) - run_command("coverage run -m pytest -s", tool="") + run_command("coverage run -m pytest -s") os.chdir(str(work_dir)) remove_outdate_files(started_at) combine_result_files()