diff options
| author | Roberto Bertó <463349+robertoberto@users.noreply.github.com> | 2026-05-19 02:35:08 +0000 |
|---|---|---|
| committer | Roberto Bertó <463349+robertoberto@users.noreply.github.com> | 2026-05-19 02:35:08 +0000 |
| commit | ea8c349f6dce955696850198b8544d0203b467fb (patch) | |
| tree | 856102b7a4c30c79434d521b9852bef1c055ce09 /docs/development/architecture.md | |
| parent | 0f76bcc7179976e893b1d9f296b1b1e7988b0031 (diff) | |
| download | pyvyos-ea8c349f6dce955696850198b8544d0203b467fb.tar.gz pyvyos-ea8c349f6dce955696850198b8544d0203b467fb.zip | |
chore: clean packaging and development tooling
This commit modernizes the project's tooling and packaging without
changing the runtime code. It addresses dead workflows, obsolete
helper scripts, duplicated configuration, and stale developer docs.
Removed:
- .github/workflows/python-app.yml: targeted Python 3.12, referenced a
non-existent requirements.txt, ran only flake8 with pytest commented out
- Makefile: hard-coded env/bin/python paths that do not work with uv
- run_tests.sh and run_tests.py: duplicated each other and referenced
removed modules (test_exceptions, test_quick)
- sphinx/ and .readthedocs.yaml: the RTD config pointed to
docs/source/conf.py while the sphinx tree lived under sphinx/source,
so the build never worked and no docs were ever published
- docs/development/architecture.md, refactor-roadmap.md, and
quality-and-utils.md: described the pre-cleanup proposal that
included specs/exceptions/request_id, now contradicted by the code
Edited:
- pyproject.toml:
- dropped the validation extra (Pydantic) — specs/ is gone
- dropped the duplicated [tool.hatch.metadata].dependencies block
- dropped the duplicated [dependency-groups].dev block
- declared the wheel package explicitly via
[tool.hatch.build.targets.wheel].packages
- bumped pytest floor to >=8.0 (Python 3.13 compatible)
- added richer classifiers (Development Status, audience, topic,
Typing :: Typed), keywords, license file pointer, and a Changelog URL
- .github/workflows/python-pr-validation.yml: upgraded to
actions/checkout@v4 and setup-python@v5, switched to astral-sh/setup-uv,
removed obsolete architecture argument
- .github/dependabot.yml: added the github-actions ecosystem so
workflow versions stay current
Added:
- pyvyos/py.typed: PEP 561 marker advertising the package as typed
- .pre-commit-config.yaml: neutral hooks only (whitespace, EOF, YAML/TOML
syntax, large-file guard); no formatters or linters yet
Kept:
- docs/development/vyos_api/: JSON reference for the VyOS HTTPS API,
useful for future contract tests
Tests still pass: 57/57.
Diffstat (limited to 'docs/development/architecture.md')
| -rw-r--r-- | docs/development/architecture.md | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/docs/development/architecture.md b/docs/development/architecture.md deleted file mode 100644 index aceda08..0000000 --- a/docs/development/architecture.md +++ /dev/null @@ -1,77 +0,0 @@ -# Development Architecture (Proposed) - -## Goals -- Strong separation of concerns (transport, domain, specs, utils) -- Backward compatibility for 0.3.0 via shims -- Clear public API surface and internal boundaries -- Minimal maintenance burden for a public, official SDK - -## Source Layout (file tree) -``` -pyvyos/ - __init__.py # public API exports (VyDevice, ApiResponse) - core/ # internal, stable layers - __init__.py - rest_client.py # RestClient, ApiResponse (transport layer) - device.py # VyDevice (domain layer) - specs/ # optional Pydantic models (validation) - __init__.py - models.py # base models (ApiRequest/Response) - commands/ # split by responsibility - __init__.py - configure.py # set, delete, multiple_op - retrieve.py # show_config, return_values - config_file.py # save, load (path: []) - show.py # show - generate.py # generate - reset.py # reset - system.py # reboot, poweroff - image.py # add, delete - utils/ # reusable helpers (no side effects) - __init__.py - json.py # safe_json, redact_key - http.py # timeouts, retries (future) - paths.py # path builder helpers - ids.py # request_id helpers - exceptions.py # typed exceptions (SDKError, HttpError, ApiError) - types.py # public typing aliases if needed - device.py # shim re-export (compat) - rest.py # shim re-export (compat) - vyos_api/ # JSON specs (docs/reference, optional at runtime) -``` - -## Layers & Responsibilities -- Transport (core.rest_client): HTTP, payload assembly, response validation -- Domain (core.device): high-level methods (configure, show, reset, etc.) -- Specs (specs.*): optional Pydantic models to validate requests/answers -- Utils: pure helpers (formatting, ids, path building) -- Shims (device.py, rest.py): ensure 0.3.0 compatibility - -## Public API Surface -- `from pyvyos import VyDevice, ApiResponse` -- Stable imports; internal moves hidden by shims - -## Compatibility Strategy -- Keep shims until 1.0.0 -- Deprecation policy: warn after N minors, remove at next major -- Document migration path (import from `pyvyos.core` for new code) - -## Data Validation Flow (optional) -- App builds `path` with utils.paths -- If validation enabled, use `specs.commands.*` models -- RestClient serializes payload and executes request -- Response validated (structure: success/data/error) - -## Testing Strategy -- Unit: core.rest_client and core.device isolated via monkeypatch -- Contract: JSON fixtures mirror VyOS responses -- E2E (future): optional with test VyOS VM - -## Packaging -- Include `vyos_api/` only if needed at runtime -- Otherwise treat it as docs/reference, not required by the package - -## Naming & Conventions -- Use underscores `_` in file and module names -- One responsibility per module (keep files small) -- Typed public APIs, specific exceptions, no prints (only logging) |
