Skip to content

Commit

Permalink
Merge pull request #1 from atsphinx/feature/use-gotask
Browse files Browse the repository at this point in the history
Default taskdef is go-task
  • Loading branch information
attakei authored Oct 6, 2024
2 parents 0ead823 + e5e2f92 commit 6c8e77f
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 73 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v2
- uses: arduino/setup-task@v2
- name: Create demo project
run: |
uvx cookiecutter --no-input --output-dir=var .
Expand All @@ -27,6 +28,4 @@ jobs:
cd var/demo
git init
uv sync --python='${{ steps.setup-python.outputs.python-path }}'
uv run pytest
uv run make -C docs dirhtml
uvx pre-commit run --all-files
task verify
6 changes: 5 additions & 1 deletion cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@
"author_name": "Kazuya Takei",
"author_email": "[email protected]",
"version": "0.0.0",
"requires_python": ["3.9", "3.10", "3.11", "3.12"]
"requires_python": ["3.9", "3.10", "3.11", "3.12"],
"_copy_without_render": [
"Taskfile.yaml",
"**/Taskfile.yaml"
]
}
4 changes: 2 additions & 2 deletions {{cookiecutter.project_basename}}/.github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v2
- uses: arduino/setup-task@v2
- name: Run tests
run: |
uv sync --frozen
uv run make -C docs linkcheck dirhtml
task setup docs:build-linkcheck docs:build-dirhtml
build-test:
runs-on: ubuntu-latest
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v2
- name: Run tests
- uses: arduino/setup-task@v2
- name: Build document
run: |
uv sync --frozen
uv run make -C docs dirhtml
task setup docs:build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/_build/dirhtml
path: docs/_build/mini18n-dirhtml
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Expand Down
30 changes: 30 additions & 0 deletions {{cookiecutter.project_basename}}/Taskfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: '3'

vars:
# If you run bare environment or activated venv, set '' (blank string)
RUN_PYTHON: 'uv run'

tasks:
setup:
desc: 'Setup workspace'
cmds:
- 'uv sync --frozen'
verify:
desc: 'Verify environment by all procs'
cmds:
- 'uvx pre-commit run --all-files'
- '{{.RUN_PYTHON}} pytest'
- task: 'docs:intl'
- task: 'docs:build-linkcheck'
- task: 'docs:build-dirhtml'
- 'uv build'
release-*:
desc: 'Run elease process'
vars:
LEVEL: '{{index .MATCH 0}}'
cmds:
- 'age {{.LEVEL}}'
- 'uv sync' # To write out as lock-file

includes:
docs: './docs'
28 changes: 0 additions & 28 deletions {{cookiecutter.project_basename}}/docs/Makefile

This file was deleted.

44 changes: 44 additions & 0 deletions {{cookiecutter.project_basename}}/docs/Taskfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
version: '3'

vars:
# If you run bare environment or activated venv, set '' (blank string)
# RUN_PYTHON: ''
SPHINX_DEFAULT_BUILD: 'mini18n-dirhtml'
SPHINX_OPTIONS: ''
SPHINX_LANGUAGES:
- 'ja'

env:
SPHINXINTL_TRANSLATOR: "Kazuya Takei <[email protected]>"

tasks:
intl:
desc: 'Sync i18n environment'
dir: '{{.TASKFILE_DIR}}'
cmds:
- '{{.RUN_PYTHON}} sphinx-build -M gettext . _build {{.SPHINX_OPTIONS}}'
- '{{.RUN_PYTHON}} sphinx-intl update --language={{.SPHINX_LANGUAGES | join ","}}'
dev:
desc: 'Run docs server'
dir: '{{.TASKFILE_DIR}}'
cmds:
- '{{.RUN_PYTHON}} sphinx-autobuild -b dirhtml . _build/dirhtml'
build-*:
desc: 'Make docs'
dir: '{{.TASKFILE_DIR}}'
vars:
TARGET: '{{index .MATCH 0}}'
cmds:
- '{{.RUN_PYTHON}} sphinx-build -M {{.TARGET}} . _build'
build:
desc: 'Make docs (default target)'
deps:
- 'build-{{.SPHINX_DEFAULT_BUILD}}'
help:
desc: 'Display help of docs'
deps:
- 'build-help'
clean:
desc: 'Clean build files of docs'
deps:
- 'build-clean'
35 changes: 0 additions & 35 deletions {{cookiecutter.project_basename}}/docs/make.bat

This file was deleted.

0 comments on commit 6c8e77f

Please sign in to comment.