netdoc-sdk 0.2.2__tar.gz → 0.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- netdoc_sdk-0.2.4/.editorconfig +33 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/.github/workflows/cd.yml +1 -5
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/.github/workflows/ci.yml +0 -15
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/.gitignore +5 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/.markdownlint.yaml +3 -6
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/.pre-commit-config.yaml +23 -14
- netdoc_sdk-0.2.4/.release-please-manifest.json +3 -0
- netdoc_sdk-0.2.4/.yamlfmt +8 -0
- netdoc_sdk-0.2.4/CHANGELOG.md +16 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/Makefile +4 -1
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/PKG-INFO +1 -1
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/poetry.lock +3 -485
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/pyproject.toml +8 -9
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/src/netdoc_sdk/client.py +7 -1
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/src/netdoc_sdk/exceptions.py +5 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/src/netdoc_sdk/models/core.py +19 -32
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/src/netdoc_sdk/models/discovery.py +6 -26
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/src/netdoc_sdk/models/inventory.py +69 -83
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/src/netdoc_sdk/models/snapshots.py +6 -12
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/integration/core/test_002_tenant.py +6 -2
- netdoc_sdk-0.2.4/tests/integration/core/test_003_user.py +29 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/integration/core/test_005_profile.py +1 -3
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/integration/discovery/test_001_credentials.py +1 -1
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/integration/discovery/test_003_discovery_run.py +4 -1
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/integration/discovery/test_004_discovery_job.py +4 -1
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/integration/inventory/test_002_canonical_device.py +1 -1
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/unit/test_010_response_parsing.py +0 -1
- netdoc_sdk-0.2.2/.release-please-manifest.json +0 -3
- netdoc_sdk-0.2.2/CHANGELOG.md +0 -77
- netdoc_sdk-0.2.2/tests/integration/core/test_003_user.py +0 -15
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/.github/CODEOWNERS +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/.pylintrc +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/.snyk +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/CONTRIBUTING.md +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/LICENSE +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/README.md +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/release-please-config.json +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/src/netdoc_sdk/__init__.py +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/src/netdoc_sdk/models/__init__.py +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/integration/conftest.py +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/integration/core/test_001_authentication.py +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/integration/core/test_004_token.py +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/integration/core/test_006_audit_log.py +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/integration/discovery/test_002_collector.py +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/integration/inventory/test_001_site.py +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/unit/conftest.py +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/unit/test_001_normalize_base_url.py +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/unit/test_002_headers.py +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/unit/test_003_api_path.py +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/unit/test_004_clean_params.py +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/unit/test_005_serialize_body.py +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/unit/test_006_context_manager.py +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/unit/test_007_error_mapping.py +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/unit/test_008_network_errors.py +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/unit/test_009_query_params.py +0 -0
- {netdoc_sdk-0.2.2 → netdoc_sdk-0.2.4}/tests/unit/test_011_from_credentials.py +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# EditorConfig is awesome: https://editorconfig.org
|
|
2
|
+
|
|
3
|
+
# top-most EditorConfig file
|
|
4
|
+
root = true
|
|
5
|
+
|
|
6
|
+
# Unix-style newlines with a newline ending every file
|
|
7
|
+
[*]
|
|
8
|
+
end_of_line = lf
|
|
9
|
+
insert_final_newline = true
|
|
10
|
+
|
|
11
|
+
# Matches multiple files with brace expansion notation
|
|
12
|
+
# Set default charset
|
|
13
|
+
[*.{js,py}]
|
|
14
|
+
charset = utf-8
|
|
15
|
+
|
|
16
|
+
# 4 space indentation
|
|
17
|
+
[*.py]
|
|
18
|
+
indent_style = space
|
|
19
|
+
indent_size = 4
|
|
20
|
+
|
|
21
|
+
# Tab indentation (no size specified)
|
|
22
|
+
[Makefile]
|
|
23
|
+
indent_style = tab
|
|
24
|
+
|
|
25
|
+
# Indentation override for all JS under lib directory
|
|
26
|
+
[lib/**.js]
|
|
27
|
+
indent_style = space
|
|
28
|
+
indent_size = 2
|
|
29
|
+
|
|
30
|
+
# Matches the exact files either package.json or .travis.yml
|
|
31
|
+
[{package.json,.travis.yml}]
|
|
32
|
+
indent_style = space
|
|
33
|
+
indent_size = 2
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
name: Release (CD)
|
|
2
|
-
|
|
3
2
|
on:
|
|
4
3
|
push:
|
|
5
4
|
branches: [main]
|
|
6
|
-
|
|
7
5
|
permissions:
|
|
8
6
|
contents: write
|
|
9
7
|
pull-requests: write
|
|
10
|
-
|
|
11
8
|
jobs:
|
|
12
9
|
release:
|
|
13
10
|
runs-on: ubuntu-latest
|
|
@@ -20,7 +17,6 @@ jobs:
|
|
|
20
17
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
21
18
|
config-file: release-please-config.json
|
|
22
19
|
manifest-file: .release-please-manifest.json
|
|
23
|
-
|
|
24
20
|
publish:
|
|
25
21
|
needs: release
|
|
26
22
|
if: ${{ needs.release.outputs.release_created }}
|
|
@@ -28,7 +24,7 @@ jobs:
|
|
|
28
24
|
steps:
|
|
29
25
|
- uses: actions/checkout@v6
|
|
30
26
|
- uses: actions/setup-python@v6
|
|
31
|
-
with: {
|
|
27
|
+
with: {python-version: "3.12"}
|
|
32
28
|
- run: pip install build twine
|
|
33
29
|
- run: python -m build
|
|
34
30
|
- run: twine upload dist/*
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
name: Tests (CI)
|
|
2
|
-
|
|
3
2
|
env:
|
|
4
3
|
PYTHON_VERSION: 3.12
|
|
5
|
-
|
|
6
4
|
on:
|
|
7
5
|
pull_request:
|
|
8
6
|
types: [opened, synchronize, reopened]
|
|
9
|
-
|
|
10
7
|
# Cancel any existing runs of this workflow for this same branch
|
|
11
8
|
concurrency:
|
|
12
9
|
group: ci-${{ github.ref }}
|
|
13
10
|
cancel-in-progress: true
|
|
14
|
-
|
|
15
11
|
jobs:
|
|
16
12
|
tests:
|
|
17
13
|
runs-on: ubuntu-latest
|
|
@@ -20,7 +16,6 @@ jobs:
|
|
|
20
16
|
uses: actions/checkout@v6
|
|
21
17
|
with:
|
|
22
18
|
path: netdoc-sdk
|
|
23
|
-
|
|
24
19
|
- name: Checkout backend
|
|
25
20
|
uses: actions/checkout@v6
|
|
26
21
|
with:
|
|
@@ -28,47 +23,37 @@ jobs:
|
|
|
28
23
|
path: netdoc
|
|
29
24
|
# Permission -> Content
|
|
30
25
|
token: ${{ secrets.NETDOC_REPO_TOKEN }}
|
|
31
|
-
|
|
32
26
|
- name: Setup Python3
|
|
33
27
|
uses: actions/setup-python@v6
|
|
34
28
|
with:
|
|
35
29
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
36
|
-
|
|
37
30
|
- name: Install Poetry
|
|
38
31
|
run: pip install --no-cache-dir poetry
|
|
39
32
|
working-directory: netdoc-sdk
|
|
40
|
-
|
|
41
33
|
- name: Display Poetry version
|
|
42
34
|
run: poetry --version
|
|
43
35
|
working-directory: netdoc-sdk
|
|
44
|
-
|
|
45
36
|
- name: Configure Poetry
|
|
46
37
|
run: poetry config virtualenvs.in-project true
|
|
47
38
|
working-directory: netdoc-sdk
|
|
48
|
-
|
|
49
39
|
- name: Install
|
|
50
40
|
run: make install
|
|
51
41
|
working-directory: netdoc-sdk
|
|
52
|
-
|
|
53
42
|
- name: Code linting (make lint)
|
|
54
43
|
run: make lint
|
|
55
44
|
working-directory: netdoc-sdk
|
|
56
|
-
|
|
57
45
|
- name: Run checks (pre-commit)
|
|
58
46
|
run: make check
|
|
59
47
|
working-directory: netdoc-sdk
|
|
60
|
-
|
|
61
48
|
- name: Run tests
|
|
62
49
|
run: make coverage
|
|
63
50
|
working-directory: netdoc-sdk
|
|
64
|
-
|
|
65
51
|
snyk:
|
|
66
52
|
needs: tests
|
|
67
53
|
runs-on: ubuntu-latest
|
|
68
54
|
steps:
|
|
69
55
|
- name: Checkout
|
|
70
56
|
uses: actions/checkout@v6
|
|
71
|
-
|
|
72
57
|
- name: Setup Snyk
|
|
73
58
|
uses: snyk/actions/python@master
|
|
74
59
|
env:
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
# MD013 - Line length
|
|
2
2
|
MD013:
|
|
3
|
-
|
|
3
|
+
heading_line_length: 80
|
|
4
|
+
line_length: 10000
|
|
4
5
|
code_blocks: false
|
|
5
6
|
tables: false
|
|
6
|
-
strict:
|
|
7
|
-
|
|
7
|
+
strict: false
|
|
8
8
|
# MD024 - No duplicate headings (useful in changelogs where ## Added repeats)
|
|
9
9
|
MD024:
|
|
10
10
|
siblings_only: true # allows duplicate headings in different sections
|
|
11
|
-
|
|
12
11
|
# MD033 - No inline HTML (keep markdown portable)
|
|
13
12
|
MD033: false # set to true if you want to forbid <br>, <details> etc.
|
|
14
|
-
|
|
15
13
|
# MD046 - Code block style: enforce fenced blocks (```) over indented
|
|
16
14
|
MD046:
|
|
17
15
|
style: fenced
|
|
18
|
-
|
|
19
16
|
# MD048 - Code fence style: enforce backticks over tildes
|
|
20
17
|
MD048:
|
|
21
18
|
style: backtick
|
|
@@ -16,9 +16,7 @@ exclude: >-
|
|
|
16
16
|
.*\.qcow2$|
|
|
17
17
|
.*\.vma$
|
|
18
18
|
)$
|
|
19
|
-
|
|
20
19
|
repos:
|
|
21
|
-
|
|
22
20
|
# --------------------------------------------------------------------------
|
|
23
21
|
# General file hygiene
|
|
24
22
|
# Handles: trailing whitespace, EOF newline, BOM, CRLF, merge conflicts,
|
|
@@ -29,13 +27,20 @@ repos:
|
|
|
29
27
|
hooks:
|
|
30
28
|
- id: check-added-large-files
|
|
31
29
|
- id: check-case-conflict
|
|
32
|
-
- id: check-
|
|
33
|
-
- id: check-toml
|
|
30
|
+
- id: check-json
|
|
34
31
|
- id: check-merge-conflict
|
|
32
|
+
- id: check-toml
|
|
33
|
+
- id: check-yaml
|
|
34
|
+
args: [--allow-multiple-documents]
|
|
35
35
|
- id: detect-private-key
|
|
36
36
|
- id: end-of-file-fixer
|
|
37
37
|
- id: trailing-whitespace
|
|
38
|
-
|
|
38
|
+
- repo: https://github.com/google/yamlfmt
|
|
39
|
+
rev: v0.21.0
|
|
40
|
+
hooks:
|
|
41
|
+
- id: yamlfmt
|
|
42
|
+
args: [-conf, .yamlfmt]
|
|
43
|
+
exclude: .pre-commit-config.yaml
|
|
39
44
|
# --------------------------------------------------------------------------
|
|
40
45
|
# Python formatting + linting (single tool, replaces black + flake8 + pyupgrade)
|
|
41
46
|
# - ruff-format: drop-in replacement for black (respects pyproject.toml config)
|
|
@@ -45,22 +50,27 @@ repos:
|
|
|
45
50
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
46
51
|
rev: v0.11.13
|
|
47
52
|
hooks:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
- id: ruff-check
|
|
54
|
+
name: ruff (check)
|
|
55
|
+
args: [--output-format=full]
|
|
56
|
+
- repo: https://github.com/pre-commit/pygrep-hooks
|
|
57
|
+
rev: v1.10.0
|
|
58
|
+
hooks:
|
|
59
|
+
- id: python-check-blanket-noqa
|
|
60
|
+
- id: python-no-eval
|
|
61
|
+
- id: text-unicode-replacement-char
|
|
62
|
+
- id: python-use-type-annotations
|
|
52
63
|
# --------------------------------------------------------------------------
|
|
53
64
|
# Security: static analysis for common vulnerabilities.
|
|
54
65
|
# Ruff has partial coverage (S ruleset) but bandit is more thorough.
|
|
55
|
-
# Config lives in
|
|
66
|
+
# Config lives in pyproject.toml [tool.bandit].
|
|
56
67
|
# --------------------------------------------------------------------------
|
|
57
68
|
- repo: https://github.com/PyCQA/bandit
|
|
58
69
|
rev: 1.9.4
|
|
59
70
|
hooks:
|
|
60
71
|
- id: bandit
|
|
61
|
-
args: ["-c", "pyproject.toml"]
|
|
62
|
-
exclude:
|
|
63
|
-
|
|
72
|
+
args: ["-c", "pyproject.toml"]
|
|
73
|
+
exclude: "tests|scripts"
|
|
64
74
|
# --------------------------------------------------------------------------
|
|
65
75
|
# Markdown linting.
|
|
66
76
|
# Config in .markdownlint.yaml.
|
|
@@ -70,7 +80,6 @@ repos:
|
|
|
70
80
|
hooks:
|
|
71
81
|
- id: markdownlint
|
|
72
82
|
args: ["--config=.markdownlint.yaml"]
|
|
73
|
-
|
|
74
83
|
# --------------------------------------------------------------------------
|
|
75
84
|
# Commit message: enforce Conventional Commits format.
|
|
76
85
|
# Required by release-please for automatic versioning.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
formatter:
|
|
2
|
+
type: basic # Use the basic formatter type
|
|
3
|
+
include_document_start: false # Do not insert '---' at the beginning of files
|
|
4
|
+
pad_line_comments: 2 # Pad comments with 2 spaces for better readability
|
|
5
|
+
indent: 2 # Use 2 spaces for indentation (common YAML style)
|
|
6
|
+
wrap_comments: true # Enable wrapping long comments for clarity
|
|
7
|
+
align_colons: true # Align colons in mappings for better visual structure
|
|
8
|
+
trim_trailing_whitespace: true # Remove trailing spaces at line ends
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.2.4](https://github.com/NetDocLab/netdoc-sdk/compare/v0.2.3...v0.2.4) (2026-05-30)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* add content-type to post/put/patch methods / fix tests on collector ([a3d99d4](https://github.com/NetDocLab/netdoc-sdk/commit/a3d99d460486ff45d34496be15a013583ed6295c))
|
|
9
|
+
|
|
10
|
+
## [0.2.3](https://github.com/NetDocLab/netdoc-sdk/compare/v0.2.2...v0.2.3) (2026-05-29)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* remove metadata field and fix tests ([906f070](https://github.com/NetDocLab/netdoc-sdk/commit/906f070563397ac04148b9ec600f8e303a4063fd))
|
|
16
|
+
* remove metadata from tests + improve exceptions ([36fe348](https://github.com/NetDocLab/netdoc-sdk/commit/36fe348dcc804bdf5f9676945f04f48576b777c6))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Makefile
|
|
2
|
-
.PHONY: install uninstall check coverage fmt lint tests
|
|
2
|
+
.PHONY: install uninstall check coverage doc fmt lint tests
|
|
3
3
|
|
|
4
4
|
install:
|
|
5
5
|
poetry install --no-interaction --no-ansi
|
|
@@ -16,6 +16,9 @@ check: ## Run all pre-commit tests
|
|
|
16
16
|
coverage: ## Run tests and show coverage report
|
|
17
17
|
poetry run pytest tests --cov=netdoc_sdk --cov-report=term-missing --cov-fail-under=80
|
|
18
18
|
|
|
19
|
+
doc: ## build the documentation into site/
|
|
20
|
+
poetry run mkdocs build --strict
|
|
21
|
+
|
|
19
22
|
fmt: ## Code formatting
|
|
20
23
|
poetry run ruff format .
|
|
21
24
|
poetry run ruff check --fix
|