Skip to content

Commit

Permalink
🔨 Migrate version plugin to poetry-dynamic-versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
waketzheng committed Oct 24, 2024
1 parent bc78b85 commit aadf769
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
4 changes: 2 additions & 2 deletions scripts/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit aadf769

Please sign in to comment.