Skip to content

Commit 0b04c18

Browse files
authored
docs: Create proof of concept mkdocs for docs/ dir (#864)
* Use mkdocstrings for library API reference * Update a selection of docstrings to improve formatting in the generated docs. * Clean up some of the docstrings, type hints, etc. * Use mkdocs-click for CLI reference * Did a pass through all the command docstrings and the result in the CLI reference to clean things up. Added minimal markdown * By default, mkdocs-click generates a big page with all the sub-commands included. For commands like `deadline job get` and `deadline queue get`, the anchor links get named like `#get` and `#get_1`, so won't be stable. It's also a lot to scroll through. I worked out a way to put each subcommand on its own page. * Clean up the click main() function exposure. * Rename the primary handler from main() to deadline() internally, so that click uses the name 'deadline' without having to override prog_name. * Remove the file _deadline_cli.py as it is not necessary to avoid circular imports. * Update the MCP tests to run based on the Python version, not whether the mcp library successfully imported. * While reviewing the commands, updated 'deadline job wait' to print more information while polling. Example: Current status: SUCCEEDED (52/52 tasks succeeded, 0 workers running). [65.2s elapsed] Signed-off-by: Mark <[email protected]>
1 parent 08c1e89 commit 0b04c18

File tree

100 files changed

+1485
-537
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+1485
-537
lines changed

.github/workflows/mkdocs.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build and Deploy MkDocs
2+
3+
on:
4+
push:
5+
branches:
6+
- mainline
7+
paths:
8+
- 'docs/**'
9+
- 'mkdocs.yml'
10+
- '.github/workflows/mkdocs.yml'
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
build-and-deploy:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v5
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v6
25+
with:
26+
python-version: '3.13'
27+
28+
- name: Install Hatch
29+
run: |
30+
pip install --upgrade hatch
31+
32+
- name: Build and deploy documentation
33+
run: hatch run docs:deploy --force
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: MkDocs Quality Check
2+
3+
on:
4+
pull_request:
5+
branches: [ mainline, release, feature_assets_cli, 'patch_*' ]
6+
workflow_call:
7+
inputs:
8+
branch:
9+
required: false
10+
type: string
11+
tag:
12+
required: false
13+
type: string
14+
permissions:
15+
contents: write
16+
17+
jobs:
18+
build-docs:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v5
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v6
26+
with:
27+
python-version: '3.13'
28+
29+
- name: Install Hatch
30+
run: |
31+
pip install --upgrade hatch
32+
33+
- name: Build documentation
34+
run: hatch run docs:build

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ __pycache__/
1313
.DS_Store
1414

1515
# Build artifacts
16-
/build
17-
/dist
16+
/build/
17+
/dist/
18+
/site/
1819
installer/components
1920

2021
# Misc extensions

DEVELOPMENT.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ This documentation provides guidance on developer workflows for working with the
55
Table of Contents:
66
* [Development Environment Setup](#development-environment-setup)
77
* [The Development Loop](#the-development-loop)
8-
* [Code Organization](#code-organization)
8+
* [Documentation](#documentation)
9+
* [Code Organization](#code-organization)
910
* [Testing](#testing)
1011
* [Writing tests](#writing-tests)
1112
* [Unit tests](#unit-tests)
@@ -70,9 +71,17 @@ Note: Hatch uses [environments](https://hatch.pypa.io/1.12/environment/) to isol
7071
for this package from your system or virtual environment Python. If your build/test run is not making sense, then
7172
sometimes pruning (`hatch env prune`) all of these environments for the package can fix the issue.
7273

73-
## Code Organization
74+
## Documentation
7475

75-
Please see [code organization](docs/code_organization.md).
76+
Work-in-progress documentation for the Deadline Cloud client library is in progress in the [docs](docs/index.html) directory.
77+
Documentation is written in Markdown using [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/).
78+
You can run the command `hatch run docs:serve` to start a server for viewing the documentation on localhost. When the command
79+
starts, it prints the URL for viewing the docs locally, and will automatically update them when the `mkdocs.yml` configuration
80+
or various markdown files are modified. The `hatch run docs:build` will build the documentation to static html content.
81+
82+
### Code Organization
83+
84+
Please see [code organization](docs/code_reference/code_organization.md).
7685

7786
## Testing
7887

@@ -337,6 +346,6 @@ class MyCustomWidget(QWidget):
337346

338347
# Profiling in Deadline Cloud
339348

340-
Instead of runnning a deadline command as `deadline ...` run `pyinstrument -r html -m deadline ...`.
349+
Instead of runnning a deadline command as `deadline ...` run `pyinstrument -r html -m deadline ...`.
341350

342-
This will profile the current `deadline` command and open the results in an interactive window.
351+
This will profile the current `deadline` command and open the results in an interactive window.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Deadline CLI Reference
2+
3+
::: mkdocs-click
4+
:module: deadline.client.cli._groups.attachment_group
5+
:command: cli_attachment
6+
:prog_name: deadline attachment
7+
:depth: 1
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Deadline CLI Reference
2+
3+
::: mkdocs-click
4+
:module: deadline.client.cli._groups.auth_group
5+
:command: cli_auth
6+
:prog_name: deadline auth
7+
:depth: 1
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Deadline CLI Reference
2+
3+
::: mkdocs-click
4+
:module: deadline.client.cli._groups.bundle_group
5+
:command: cli_bundle
6+
:prog_name: deadline bundle
7+
:depth: 1
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Deadline CLI Reference
2+
3+
::: mkdocs-click
4+
:module: deadline.client.cli._groups.config_group
5+
:command: cli_config
6+
:prog_name: deadline config
7+
:depth: 1
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Deadline CLI Reference
2+
3+
::: mkdocs-click
4+
:module: deadline.client.cli._groups.farm_group
5+
:command: cli_farm
6+
:prog_name: deadline farm
7+
:depth: 1
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Deadline CLI Reference
2+
3+
::: mkdocs-click
4+
:module: deadline.client.cli._groups.fleet_group
5+
:command: cli_fleet
6+
:prog_name: deadline fleet
7+
:depth: 1

0 commit comments

Comments
 (0)