Skip to content

Commit a62c823

Browse files
authored
Merge branch 'main' into feat/pixml
2 parents 967c923 + c549a94 commit a62c823

11 files changed

Lines changed: 278 additions & 9 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"TZ": "Etc/UTC",
1212
"POETRY_HOME": "/opt/poetry",
1313
"VIRTUAL_ENV": "/home/vscode/.venv",
14-
"POETRY_VIRTUALENVS_CREATE": "false"
14+
"POETRY_VIRTUALENVS_CREATE": "false",
15+
"PYTHONPATH": "${containerWorkspaceFolder}"
1516
},
1617
"postCreateCommand": "git config --global --add safe.directory \"$(pwd)\" && poetry install --with dev --no-interaction",
1718
"customizations": {

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/.github/CODEOWNERS charles.r.graham@usace.army.mil eric.v.novotny@usace.army.mil # Protect ownership rules themselves
77
/maintainers.toml charles.r.graham@usace.army.mil eric.v.novotny@usace.army.mil # Primary configuration file for ownership metadata
88
/scripts/sync_ownership.py charles.r.graham@usace.army.mil eric.v.novotny@usace.army.mil # Ownership metadata generator
9+
/scripts/preview_docs.py charles.r.graham@usace.army.mil eric.v.novotny@usace.army.mil mitchell.s.weier@usace.army.mil # Local docs preview helper
910
/AGENTS.md charles.r.graham@usace.army.mil eric.v.novotny@usace.army.mil # Repository ownership maintenance guidance
1011
/cwmscli/commands/csv2cwms/ charles.r.graham@usace.army.mil
1112
/docs/cli/csv2cwms*.rst charles.r.graham@usace.army.mil
@@ -18,6 +19,7 @@
1819
/docs/cli/load_*.rst charles.r.graham@usace.army.mil eric.v.novotny@usace.army.mil
1920
/tests/load/ charles.r.graham@usace.army.mil eric.v.novotny@usace.army.mil
2021
/tests/commands/test_load_*.py charles.r.graham@usace.army.mil eric.v.novotny@usace.army.mil
22+
/tests/test_preview_docs.py charles.r.graham@usace.army.mil eric.v.novotny@usace.army.mil # Local docs preview helper tests
2123
/cwmscli/usgs/ eric.v.novotny@usace.army.mil
2224
/tests/usgs/ eric.v.novotny@usace.army.mil
2325
/tests/cli/test_usgs_*.py eric.v.novotny@usace.army.mil

.github/workflows/docs.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ name: Docs Validation
22

33
on:
44
pull_request:
5-
paths: ["docs/**", "cwmscli/**", "pyproject.toml"]
65
push:
76
branches: [main]
8-
paths: ["docs/**", "cwmscli/**", "pyproject.toml"]
7+
paths:
8+
- "docs/**"
9+
- "cwmscli/**"
10+
- "pyproject.toml"
11+
- "scripts/**"
12+
- "CONTRIBUTING.md"
913
schedule:
1014
- cron: "0 6 * * *"
1115
workflow_dispatch:

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.7.4"
2+
".": "0.8.0"
33
}

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,36 @@
11
# Changelog
22

3+
## [0.8.0](https://github.com/HydrologicEngineeringCenter/cwms-cli/compare/v0.7.4...v0.8.0) (2026-08-10)
4+
5+
6+
### Features
7+
8+
* Add CDA Environment Manager ([#209](https://github.com/HydrologicEngineeringCenter/cwms-cli/issues/209)) ([a89bfb1](https://github.com/HydrologicEngineeringCenter/cwms-cli/commit/a89bfb12d117f25d38904918d6153a28ca1ce441))
9+
* add dev helper script to preview docs ([#253](https://github.com/HydrologicEngineeringCenter/cwms-cli/issues/253)) ([749fedc](https://github.com/HydrologicEngineeringCenter/cwms-cli/commit/749fedc89df69ed6dc7e462c03cc728eb4775e6b))
10+
* Add modern DSS transfer utilities ([#242](https://github.com/HydrologicEngineeringCenter/cwms-cli/issues/242)) ([89e01f4](https://github.com/HydrologicEngineeringCenter/cwms-cli/commit/89e01f48231d084a7989319f82d5d08d4137d940))
11+
* allow for line return tsid parsing ([#230](https://github.com/HydrologicEngineeringCenter/cwms-cli/issues/230)) ([39f7f6b](https://github.com/HydrologicEngineeringCenter/cwms-cli/commit/39f7f6be090201368f7e203edf8a80174721b1f5))
12+
* display CDA server stack traces in debug mode ([#247](https://github.com/HydrologicEngineeringCenter/cwms-cli/issues/247)) ([c3bfcf9](https://github.com/HydrologicEngineeringCenter/cwms-cli/commit/c3bfcf92b2f04b125a56a1d106fda07b26e21091))
13+
14+
15+
### Bug Fixes
16+
17+
* align formatting checks ([#229](https://github.com/HydrologicEngineeringCenter/cwms-cli/issues/229)) ([a6286b3](https://github.com/HydrologicEngineeringCenter/cwms-cli/commit/a6286b3d299545a587483aa68b2f68d4da57c5cc))
18+
* cover explicit blob media type ([#232](https://github.com/HydrologicEngineeringCenter/cwms-cli/issues/232)) ([1a3b26d](https://github.com/HydrologicEngineeringCenter/cwms-cli/commit/1a3b26dfeab07cd0030c59eea60f65d4608e2faa))
19+
* doc check, add link exception ([#255](https://github.com/HydrologicEngineeringCenter/cwms-cli/issues/255)) ([0101968](https://github.com/HydrologicEngineeringCenter/cwms-cli/commit/0101968de632377a8e621c8adb4c125b3305d4a6))
20+
* explain empty location loads ([#233](https://github.com/HydrologicEngineeringCenter/cwms-cli/issues/233)) ([a5b596c](https://github.com/HydrologicEngineeringCenter/cwms-cli/commit/a5b596c4be1ba3ba0c62b4fadb2abb7e2d48329e))
21+
* harden clob download error handling ([#235](https://github.com/HydrologicEngineeringCenter/cwms-cli/issues/235)) ([621f913](https://github.com/HydrologicEngineeringCenter/cwms-cli/commit/621f9139eb28991d38bc93665428798189f02887))
22+
* Improve version issue error message in deps.py ([#245](https://github.com/HydrologicEngineeringCenter/cwms-cli/issues/245)) ([f77b75f](https://github.com/HydrologicEngineeringCenter/cwms-cli/commit/f77b75f23782c200a5b6e35419937483aab675d1))
23+
* refresh ownership metadata ([#251](https://github.com/HydrologicEngineeringCenter/cwms-cli/issues/251)) ([3b31479](https://github.com/HydrologicEngineeringCenter/cwms-cli/commit/3b31479d18f326c467eef4b4074c9b6a266b46e1))
24+
* show update environment before confirmation ([#246](https://github.com/HydrologicEngineeringCenter/cwms-cli/issues/246)) ([500435c](https://github.com/HydrologicEngineeringCenter/cwms-cli/commit/500435c9eb1eb283424cb3071de99d851f59951d)), closes [#222](https://github.com/HydrologicEngineeringCenter/cwms-cli/issues/222)
25+
* validate blob list limits ([#231](https://github.com/HydrologicEngineeringCenter/cwms-cli/issues/231)) ([0917ce9](https://github.com/HydrologicEngineeringCenter/cwms-cli/commit/0917ce9ce133b48168b3d4ddb189b1887d63e6eb))
26+
* validate load target cda ([#236](https://github.com/HydrologicEngineeringCenter/cwms-cli/issues/236)) ([ff3e06a](https://github.com/HydrologicEngineeringCenter/cwms-cli/commit/ff3e06a22825a0d4f7b4d7b2653085d464118fe2))
27+
* wait for auth callback server readiness ([#249](https://github.com/HydrologicEngineeringCenter/cwms-cli/issues/249)) ([ca39d5b](https://github.com/HydrologicEngineeringCenter/cwms-cli/commit/ca39d5bebb437eb1b715f5f6c0dc703116ad02fd))
28+
29+
30+
### Documentation
31+
32+
* guide agents to shared color helpers ([#248](https://github.com/HydrologicEngineeringCenter/cwms-cli/issues/248)) ([ef03276](https://github.com/HydrologicEngineeringCenter/cwms-cli/commit/ef0327653a6b8b3220ff79d0e6162056c6ddaf27))
33+
334
## [0.7.4](https://github.com/HydrologicEngineeringCenter/cwms-cli/compare/v0.7.3...v0.7.4) (2026-06-25)
435

536

CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,25 @@ Ownership metadata is centralized in [maintainers.toml](/maintainers.toml).
2727

2828
To run tests you can run: `poetry run pytest`
2929

30+
## Preview Docs Locally
31+
32+
Install the repo's development dependencies and the Sphinx docs dependencies:
33+
34+
```sh
35+
poetry install --with dev --no-interaction
36+
python -m pip install -r docs/requirements.txt
37+
```
38+
39+
Build and preview the docs locally before pushing:
40+
41+
```sh
42+
python scripts/preview_docs.py
43+
```
44+
45+
The helper runs the same warnings-as-errors HTML build used in CI, then serves
46+
`docs/_build/html` at `http://127.0.0.1:8000/`. Stop the preview server with
47+
`Ctrl-C`.
48+
3049
## Releases
3150

3251
Releases are managed with `release-please`. Do not create releases or tags manually in the GitHub UI.

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ devcontainer exec --workspace-folder . poetry run pytest -q
6060

6161
The container installs project dependencies with Poetry and uses
6262
`/home/vscode/.venv`, so it does not reuse a host operating system's `.venv`.
63-
Poetry itself is kept in a separate `/opt/poetry` environment. Use the container
64-
for changes involving time zones, paths, native libraries, or other
65-
operating-system-dependent behavior. Standard Python 3.9 and Python 3.12
66-
installations remain covered by the existing CI matrix.
63+
Poetry itself is kept in a separate `/opt/poetry` environment. The workspace
64+
root is also added to `PYTHONPATH`, so the checked-out source and local test
65+
modules are available throughout a Codespace without copying them into the
66+
image. Use the container for changes involving time zones, paths, native
67+
libraries, or other operating-system-dependent behavior. Standard Python 3.9
68+
and Python 3.12 installations remain covered by the existing CI matrix.

maintainers.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ pattern = "/scripts/sync_ownership.py"
5555
owners = ["charles", "eric"]
5656
comment = "Ownership metadata generator"
5757

58+
[[codeowners.rule]]
59+
pattern = "/scripts/preview_docs.py"
60+
owners = ["charles", "eric", "mitch"]
61+
comment = "Local docs preview helper"
62+
5863
[[codeowners.rule]]
5964
pattern = "/AGENTS.md"
6065
owners = ["charles", "eric"]
@@ -104,6 +109,11 @@ owners = ["charles", "eric"]
104109
pattern = "/tests/commands/test_load_*.py"
105110
owners = ["charles", "eric"]
106111

112+
[[codeowners.rule]]
113+
pattern = "/tests/test_preview_docs.py"
114+
owners = ["charles", "eric"]
115+
comment = "Local docs preview helper tests"
116+
107117
[[codeowners.rule]]
108118
pattern = "/cwmscli/usgs/"
109119
owners = ["eric"]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "cwms-cli"
33
repository = "https://github.com/HydrologicEngineeringCenter/cwms-cli"
44

5-
version = "0.7.4"
5+
version = "0.8.0"
66

77

88
packages = [

scripts/preview_docs.py

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#!/usr/bin/env python3
2+
from __future__ import annotations
3+
4+
import argparse
5+
import importlib.util
6+
import subprocess
7+
import sys
8+
from functools import partial
9+
from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer
10+
from pathlib import Path
11+
12+
ROOT = Path(__file__).resolve().parents[1]
13+
DOCS_DIR = ROOT / "docs"
14+
BUILD_DIR = DOCS_DIR / "_build" / "html"
15+
DEFAULT_HOST = "127.0.0.1"
16+
DEFAULT_PORT = 8000
17+
DOCS_MODULES = ("sphinx", "sphinx_rtd_theme", "sphinx_click")
18+
19+
20+
def parse_args(argv: list[str] | None = None) -> argparse.Namespace:
21+
parser = argparse.ArgumentParser(
22+
description="Build and preview the cwms-cli docs locally."
23+
)
24+
parser.add_argument(
25+
"--port",
26+
type=int,
27+
default=DEFAULT_PORT,
28+
help=f"Local port for the preview server (default: {DEFAULT_PORT}).",
29+
)
30+
return parser.parse_args(argv)
31+
32+
33+
def find_missing_docs_modules() -> list[str]:
34+
return [name for name in DOCS_MODULES if importlib.util.find_spec(name) is None]
35+
36+
37+
def build_docs() -> int:
38+
result = subprocess.run(
39+
[
40+
sys.executable,
41+
"-m",
42+
"sphinx",
43+
"-nW",
44+
"-b",
45+
"html",
46+
str(DOCS_DIR),
47+
str(BUILD_DIR),
48+
],
49+
cwd=ROOT,
50+
check=False,
51+
)
52+
return result.returncode
53+
54+
55+
def serve_docs(port: int) -> None:
56+
handler = partial(SimpleHTTPRequestHandler, directory=str(BUILD_DIR))
57+
server = ThreadingHTTPServer((DEFAULT_HOST, port), handler)
58+
print(f"Docs preview available at http://{DEFAULT_HOST}:{port}/")
59+
print(f"Serving files from {BUILD_DIR}")
60+
try:
61+
server.serve_forever()
62+
except KeyboardInterrupt:
63+
print("\nStopping docs preview server.")
64+
finally:
65+
server.server_close()
66+
67+
68+
def main(argv: list[str] | None = None) -> int:
69+
args = parse_args(argv)
70+
missing = find_missing_docs_modules()
71+
if missing:
72+
missing_list = ", ".join(missing)
73+
print(
74+
"Missing docs dependencies "
75+
f"({missing_list}). Install them with:\n"
76+
f"{sys.executable} -m pip install -r docs/requirements.txt",
77+
file=sys.stderr,
78+
)
79+
return 1
80+
81+
build_status = build_docs()
82+
if build_status != 0:
83+
return build_status
84+
85+
serve_docs(args.port)
86+
return 0
87+
88+
89+
if __name__ == "__main__":
90+
raise SystemExit(main())

0 commit comments

Comments
 (0)