88
99@task
1010def test (c : Context ) -> None :
11- """
12- Run pytest via Poetry with coverage reporting for the 'gen_surv' package.
11+ """Run the test suite with coverage reporting.
12+
13+ This task executes ``pytest`` and generates a coverage report.
1314
14- This task will:
15- 1. Execute 'pytest' through Poetry.
16- 2. Generate a terminal coverage report.
17- 3. Write an XML coverage report to 'coverage.xml'.
15+ Args:
16+ c: Invoke context used to run shell commands.
1817
19- :param c: Invoke context used to run shell commands.
20- :raises TypeError: If 'c' is not an Invoke Context.
18+ Raises:
19+ TypeError: If ``c`` is not an Invoke :class:` Context` .
2120 """
2221 # Ensure we were passed a valid Context object.
2322 if not isinstance (c , Context ):
@@ -52,16 +51,16 @@ def test(c: Context) -> None:
5251
5352@task
5453def checkversion (c : Context ) -> None :
55- """Validate that ``pyproject.toml`` matches the latest git tag.
54+ """Check that ``pyproject.toml`` matches the latest Git tag.
5655
57- This task runs the ``scripts/check_version_match.py`` helper using Poetry
58- and reports whether the version numbers are aligned .
56+ This task executes ``scripts/check_version_match.py`` to ensure the version
57+ declared in ``pyproject.toml`` agrees with the most recent tag .
5958
6059 Args:
6160 c: Invoke context used to run shell commands.
6261
63- Returns :
64- None
62+ Raises :
63+ TypeError: If ``c`` is not an Invoke :class:`Context`.
6564 """
6665 if not isinstance (c , Context ):
6766 raise TypeError (f"Expected Invoke Context, got { type (c ).__name__ !r} " )
@@ -79,17 +78,13 @@ def checkversion(c: Context) -> None:
7978
8079@task
8180def docs (c : Context ) -> None :
82- """
83- Build Sphinx documentation for the project using Poetry.
81+ """Build the Sphinx documentation.
8482
85- This task will:
86- 1. Run 'sphinx-build' via Poetry.
87- 2. Read source files from 'docs/source'.
88- 3. Output HTML (or other format) into 'docs/build'.
83+ Args:
84+ c: Invoke context used to run shell commands.
8985
90- :param c: Invoke context, used to run shell commands.
91- :type c: Context
92- :raises TypeError: If 'c' is not an Invoke Context.
86+ Raises:
87+ TypeError: If ``c`` is not an Invoke :class:`Context`.
9388 """
9489 # Verify we have a proper Invoke Context.
9590 if not isinstance (c , Context ):
@@ -118,15 +113,13 @@ def docs(c: Context) -> None:
118113
119114@task
120115def stubs (c : Context ) -> None :
121- """
122- Generate type stubs for the 'gen_surv' package using stubgen and Poetry.
116+ """Generate type stubs for the ``gen_surv`` package.
123117
124- This task will:
125- 1. Run 'stubgen' via Poetry to analyze 'gen_surv'.
126- 2. Output the generated stubs into the 'stubs' directory.
118+ Args:
119+ c: Invoke context used to run shell commands.
127120
128- :param c: Invoke context used to run shell commands.
129- :raises TypeError: If 'c' is not an Invoke Context.
121+ Raises:
122+ TypeError: If ``c`` is not an Invoke :class:` Context` .
130123 """
131124 # Verify that 'c' is the correct Invoke Context.
132125 if not isinstance (c , Context ):
@@ -155,15 +148,13 @@ def stubs(c: Context) -> None:
155148
156149@task
157150def build (c : Context ) -> None :
158- """
159- Build the project distributions using Poetry.
151+ """Build distribution artifacts using Poetry.
160152
161- This task will:
162- 1. Run 'poetry build' to create source and wheel packages.
163- 2. Place the built artifacts in the 'dist/' directory.
153+ Args:
154+ c: Invoke context used to run shell commands.
164155
165- :param c: Invoke context used to run shell commands.
166- :raises TypeError: If 'c' is not an Invoke Context.
156+ Raises:
157+ TypeError: If ``c`` is not an Invoke :class:` Context` .
167158 """
168159 # Verify that we received a valid Invoke Context.
169160 if not isinstance (c , Context ):
@@ -191,16 +182,10 @@ def build(c: Context) -> None:
191182
192183@task
193184def publish (c : Context ) -> None :
194- """
195- Build and publish the package to PyPI using Poetry.
196-
197- This task will:
198- 1. Build the distribution via 'poetry publish --build'.
199- 2. Attach to a pseudo-TTY so you can enter credentials or confirm prompts.
200- 3. Not abort immediately if an error occurs; instead, it will print diagnostics.
185+ """Build and upload the package to PyPI.
201186
202- :param c: Invoke context, used to run shell commands.
203- :type c: Context
187+ Args:
188+ c: Invoke context used to run shell commands.
204189 """
205190 # Run the poetry publish command.
206191 # - warn=True: do not abort on non-zero exit, so we can inspect and report.
@@ -227,17 +212,13 @@ def publish(c: Context) -> None:
227212
228213@task
229214def clean (c : Context ) -> None :
230- """
231- Remove build artifacts, caches, and generated files.
215+ """Remove build artifacts and caches.
232216
233- This task will:
234- 1. Delete the 'dist' and 'build' directories.
235- 2. Remove generated documentation in 'docs/build'.
236- 3. Clear pytest and mypy caches.
237- 4. Delete coverage reports and stub files.
217+ Args:
218+ c: Invoke context used to run shell commands.
238219
239- :param c: Invoke context used to run shell commands.
240- :raises TypeError: If 'c' is not an Invoke Context.
220+ Raises:
221+ TypeError: If ``c`` is not an Invoke :class:` Context` .
241222 """
242223 # Verify the argument is an Invoke Context.
243224 if not isinstance (c , Context ):
@@ -276,18 +257,13 @@ def clean(c: Context) -> None:
276257
277258@task
278259def gitpush (c : Context ) -> None :
279- """
280- Stage all changes, prompt for a commit message, create a signed commit, and push to the remote repository.
260+ """Commit and push all staged changes.
281261
282- This task will:
283- 1. Verify that 'c' is an Invoke Context.
284- 2. Run 'git add .' to stage all unstaged changes.
285- 3. Prompt the user for a commit message; abort if empty.
286- 4. Sanitize the message, then run 'git commit -S -m <message>'.
287- 5. Run 'git push' to publish commits.
262+ Args:
263+ c: Invoke context used to run shell commands.
288264
289- :param c: Invoke Context used to run shell commands.
290- :raises TypeError: If 'c' is not an Invoke Context.
265+ Raises:
266+ TypeError: If ``c`` is not an Invoke :class:` Context` .
291267 """
292268 # Verify the argument is a valid Invoke Context.
293269 if not isinstance (c , Context ):
0 commit comments