File: Taskfile.yml

package info (click to toggle)
python-odmantic 1.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,488 kB
  • sloc: python: 8,646; sh: 110; javascript: 45; makefile: 34; xml: 13
file content (118 lines) | stat: -rw-r--r-- 2,448 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# https://taskfile.dev

version: "3"

silent: true

includes:
  release: ./.github
  mongodb:
    taskfile: ./mongodb-cluster/Taskfile.yml
    dir: ./mongodb-cluster
    optional: true

tasks:
  full-test:
    desc: Run the tests against all supported versions.
    deps:
      - task: "mongodb:check"
    cmds:
      - tox --parallel auto

  test:
    desc: |
      Run the tests with the current version.
    deps:
      - task: "mongodb:check"
    cmds:
      - uv run python -m pytest -rs -n auto

  bench:
    desc: |
      Run the benches with the current version.
    deps:
      - task: "mongodb:check"
    cmds:
      - uv run python -m pytest --benchmark-enable --benchmark-only

  default:
    desc: |
      Run the tests related to changes with the current version.
    deps:
      - task: mongodb
    cmds:
      - uv run python -m pytest -rs --testmon

  coverage:
    desc: Get the test coverage (xml and html) with the current version.
    deps:
      - task: "mongodb:check"
    cmds:
      - coverage run -m pytest -rs
      - coverage report -m
      - coverage xml
      - 'echo "Generated XML report: ./coverage.xml"'
      - coverage html
      - 'echo "Generated HTML report: ./htmlcov/index.html"'

  docs:
    desc: Start the local documentation server.
    cmds:
      - mkdocs serve -f ./mkdocs.yml

  lint:
    desc: Run the linting checks.
    cmds:
      - pre-commit run --all-files

  format:
    desc: Format the code (and imports).
    cmds:
      - uv run python -m ruff check odmantic tests

  setup:
    desc: Configure the development environment.
    cmds:
      - task: setup:git-lfs
      - task: setup:git-submodules
      - task: setup:pre-commit-hook
      - task: setup:deps-setup

  setup:git-lfs:
    cmds:
      - git lfs install
      - git lfs pull
    status:
      - test -d .git/lfs/

  setup:git-submodules:
    cmds:
      - git submodule update --init
    status:
      - test -f .mongodb-cluster-action/README.md

  setup:pre-commit-hook:
    cmds:
      - pre-commit install
    status:
      - test -f .git/hooks/pre-commit

  setup:deps-setup:
    deps:
      - task: setup:uv
    cmds:
      - uv sync --all-extras --dev
    sources:
      - pyproject.toml

  setup:uv:
    cmds:
      - pip install uv
    status:
      - which uv

  clean:
    cmds:
      - rm -rf dist/
      - rm -rf htmlcov/ ./.coverage ./coverage.xml
      - rm -rf .task/ ./__release_notes__.md ./__version__.txt