ods-exd-api-box 1.0.1__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.
Files changed (50) hide show
  1. ods_exd_api_box-1.0.1/.commitlintrc.json +55 -0
  2. ods_exd_api_box-1.0.1/.devcontainer/devcontainer.json +52 -0
  3. ods_exd_api_box-1.0.1/.gitattribute +2 -0
  4. ods_exd_api_box-1.0.1/.github/dependabot.yml +22 -0
  5. ods_exd_api_box-1.0.1/.github/workflows/build.yml +105 -0
  6. ods_exd_api_box-1.0.1/.github/workflows/pr-validation.yml +85 -0
  7. ods_exd_api_box-1.0.1/.gitignore +7 -0
  8. ods_exd_api_box-1.0.1/.pre-commit-config.yaml +56 -0
  9. ods_exd_api_box-1.0.1/.releaserc.json +111 -0
  10. ods_exd_api_box-1.0.1/.vscode/settings.json +51 -0
  11. ods_exd_api_box-1.0.1/CHANGELOG.md +1 -0
  12. ods_exd_api_box-1.0.1/LICENSE +21 -0
  13. ods_exd_api_box-1.0.1/MANIFEST.in +5 -0
  14. ods_exd_api_box-1.0.1/PKG-INFO +252 -0
  15. ods_exd_api_box-1.0.1/README.md +211 -0
  16. ods_exd_api_box-1.0.1/ods_exd_api_box/__init__.py +34 -0
  17. ods_exd_api_box-1.0.1/ods_exd_api_box/external_data_reader.py +189 -0
  18. ods_exd_api_box-1.0.1/ods_exd_api_box/file_handler_registry.py +147 -0
  19. ods_exd_api_box-1.0.1/ods_exd_api_box/file_interface.py +47 -0
  20. ods_exd_api_box-1.0.1/ods_exd_api_box/proto/.update_stubs.sh +17 -0
  21. ods_exd_api_box-1.0.1/ods_exd_api_box/proto/__init__.py +5 -0
  22. ods_exd_api_box-1.0.1/ods_exd_api_box/proto/ods_external_data_pb2.py +65 -0
  23. ods_exd_api_box-1.0.1/ods_exd_api_box/proto/ods_external_data_pb2.pyi +140 -0
  24. ods_exd_api_box-1.0.1/ods_exd_api_box/proto/ods_external_data_pb2_grpc.py +293 -0
  25. ods_exd_api_box-1.0.1/ods_exd_api_box/proto/ods_pb2.py +220 -0
  26. ods_exd_api_box-1.0.1/ods_exd_api_box/proto/ods_pb2.pyi +1030 -0
  27. ods_exd_api_box-1.0.1/ods_exd_api_box/proto/ods_pb2_grpc.py +24 -0
  28. ods_exd_api_box-1.0.1/ods_exd_api_box/proto/py.typed +0 -0
  29. ods_exd_api_box-1.0.1/ods_exd_api_box/py.typed +0 -0
  30. ods_exd_api_box-1.0.1/ods_exd_api_box/server.py +250 -0
  31. ods_exd_api_box-1.0.1/ods_exd_api_box.egg-info/PKG-INFO +252 -0
  32. ods_exd_api_box-1.0.1/ods_exd_api_box.egg-info/SOURCES.txt +48 -0
  33. ods_exd_api_box-1.0.1/ods_exd_api_box.egg-info/dependency_links.txt +1 -0
  34. ods_exd_api_box-1.0.1/ods_exd_api_box.egg-info/requires.txt +18 -0
  35. ods_exd_api_box-1.0.1/ods_exd_api_box.egg-info/top_level.txt +1 -0
  36. ods_exd_api_box-1.0.1/pyproject.toml +142 -0
  37. ods_exd_api_box-1.0.1/setup.cfg +4 -0
  38. ods_exd_api_box-1.0.1/tests/Dockerfile.test +17 -0
  39. ods_exd_api_box-1.0.1/tests/Dockerfile_regenerate.test +28 -0
  40. ods_exd_api_box-1.0.1/tests/__init__.py +0 -0
  41. ods_exd_api_box-1.0.1/tests/certs/client.crt +19 -0
  42. ods_exd_api_box-1.0.1/tests/certs/client.key +28 -0
  43. ods_exd_api_box-1.0.1/tests/certs/server.crt +19 -0
  44. ods_exd_api_box-1.0.1/tests/certs/server.key +28 -0
  45. ods_exd_api_box-1.0.1/tests/data/dummy.exd_api_test +1 -0
  46. ods_exd_api_box-1.0.1/tests/external_data_file.py +279 -0
  47. ods_exd_api_box-1.0.1/tests/mock_servicer_context.py +83 -0
  48. ods_exd_api_box-1.0.1/tests/test_docker_integration.py +327 -0
  49. ods_exd_api_box-1.0.1/tests/test_docker_integration_tls.py +356 -0
  50. ods_exd_api_box-1.0.1/tests/test_exd_api.py +87 -0
@@ -0,0 +1,55 @@
1
+ {
2
+ "extends": [
3
+ "@commitlint/config-conventional"
4
+ ],
5
+ "rules": {
6
+ "type-enum": [
7
+ 2,
8
+ "always",
9
+ [
10
+ "feat",
11
+ "fix",
12
+ "docs",
13
+ "style",
14
+ "refactor",
15
+ "perf",
16
+ "test",
17
+ "chore",
18
+ "ci",
19
+ "revert"
20
+ ]
21
+ ],
22
+ "type-case": [
23
+ 2,
24
+ "always",
25
+ "always-lowercase"
26
+ ],
27
+ "type-empty": [
28
+ 2,
29
+ "never"
30
+ ],
31
+ "subject-empty": [
32
+ 2,
33
+ "never"
34
+ ],
35
+ "subject-full-stop": [
36
+ 2,
37
+ "never",
38
+ "."
39
+ ],
40
+ "subject-case": [
41
+ 2,
42
+ "never",
43
+ [
44
+ "start-case",
45
+ "pascal-case",
46
+ "upper-case"
47
+ ]
48
+ ],
49
+ "header-max-length": [
50
+ 2,
51
+ "always",
52
+ 100
53
+ ]
54
+ }
55
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "ODS EXD API Box Dev Container",
3
+ "image": "mcr.microsoft.com/vscode/devcontainers/python:3.12-bookworm",
4
+ "features": {
5
+ "docker-in-docker": {
6
+ "version": "latest",
7
+ "moby": true,
8
+ "dockerDashComposeVersion": "v1"
9
+ }
10
+ },
11
+ "customizations": {
12
+ "vscode": {
13
+ "extensions": [
14
+ "ms-python.python",
15
+ "ms-python.vscode-pylance",
16
+ "ms-python.debugpy",
17
+ "ms-python.black-formatter",
18
+ "charliermarsh.ruff",
19
+ "ms-vscode.makefile-tools",
20
+ "github.copilot",
21
+ "github.copilot-chat",
22
+ "ms-python.isort",
23
+ "ms-python.mypy-type-checker",
24
+ "streetsidesoftware.code-spell-checker"
25
+ ],
26
+ "settings": {
27
+ "python.defaultInterpreterPath": "/usr/local/bin/python",
28
+ "python.linting.enabled": true,
29
+ "python.linting.pylintEnabled": false,
30
+ "python.linting.flake8Enabled": true,
31
+ "python.formatting.provider": "black",
32
+ "[python]": {
33
+ "editor.defaultFormatter": "ms-python.python",
34
+ "editor.formatOnSave": true,
35
+ "editor.codeActionsOnSave": {
36
+ "source.organizeImports": "explicit"
37
+ }
38
+ },
39
+ "python.testing.unittestArgs": [
40
+ "-v",
41
+ "-s",
42
+ "./tests",
43
+ "-p",
44
+ "test_*.py"
45
+ ],
46
+ "python.testing.unittestEnabled": true
47
+ }
48
+ }
49
+ },
50
+ "postCreateCommand": "pip install --upgrade pip && pip install -e . && pip install -e '.[dev]' && pre-commit install --install-hooks && pre-commit install --hook-type commit-msg",
51
+ "remoteUser": "vscode"
52
+ }
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
@@ -0,0 +1,22 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: pip
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ open-pull-requests-limit: 10
8
+ reviewers:
9
+ - totonga
10
+ allow:
11
+ - dependency-type: direct
12
+ - dependency-type: indirect
13
+ commit-message:
14
+ prefix: "fix: "
15
+ target-branch: develop
16
+ - package-ecosystem: "github-actions"
17
+ directory: "/"
18
+ schedule:
19
+ interval: "weekly"
20
+ commit-message:
21
+ prefix: "fix: "
22
+ target-branch: develop
@@ -0,0 +1,105 @@
1
+ name: Build, Test and Release
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - develop
8
+ pull_request:
9
+ branches:
10
+ - main
11
+ - develop
12
+
13
+ permissions:
14
+ contents: write
15
+ packages: write
16
+ id-token: write
17
+
18
+ jobs:
19
+ build-and-test:
20
+ runs-on: ubuntu-latest
21
+
22
+ strategy:
23
+ matrix:
24
+ python-version: ["3.13"]
25
+
26
+ steps:
27
+ - uses: actions/checkout@v6
28
+ with:
29
+ fetch-depth: 0
30
+ fetch-tags: true
31
+
32
+ - name: Set up Python ${{ matrix.python-version }}
33
+ uses: actions/setup-python@v6
34
+ with:
35
+ python-version: ${{ matrix.python-version }}
36
+
37
+ - name: Install build dependencies
38
+ run: |
39
+ python -m pip install --upgrade pip
40
+ pip install build wheel setuptools setuptools-scm
41
+
42
+ - name: Install package with dev dependencies
43
+ run: |
44
+ pip install -e '.[dev]'
45
+
46
+ - name: Run tests
47
+ run: |
48
+ python -m unittest
49
+
50
+ - name: Build distributions
51
+ run: |
52
+ python -m build
53
+
54
+ - name: Upload artifacts
55
+ uses: actions/upload-artifact@v6
56
+ with:
57
+ name: python-package-distributions
58
+ path: dist/
59
+ retention-days: 7
60
+
61
+ release:
62
+ needs: build-and-test
63
+ runs-on: ubuntu-latest
64
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
65
+
66
+ steps:
67
+ - uses: actions/checkout@v6
68
+ with:
69
+ fetch-depth: 0
70
+ fetch-tags: true
71
+ token: ${{ secrets.GITHUB_TOKEN }}
72
+
73
+ - name: Release
74
+ id: release
75
+ uses: python-semantic-release/python-semantic-release@v10.5.3
76
+ with:
77
+ github_token: ${{ secrets.GITHUB_TOKEN }}
78
+ git_committer_name: "github-actions"
79
+ git_committer_email: "actions@users.noreply.github.com"
80
+
81
+ - name: Install build dependencies
82
+ if: steps.release.outputs.released == 'true'
83
+ run: |
84
+ python -m pip install --upgrade pip
85
+ pip install build wheel setuptools setuptools-scm
86
+
87
+ - name: Rebuild distributions (if released)
88
+ if: steps.release.outputs.released == 'true'
89
+ run: |
90
+ rm -rf dist/
91
+ python -m build
92
+
93
+ - name: Create Release with artifacts
94
+ if: steps.release.outputs.released == 'true'
95
+ uses: softprops/action-gh-release@v2
96
+ with:
97
+ tag_name: v${{ steps.release.outputs.version }}
98
+ files: dist/*
99
+ token: ${{ github.token }}
100
+
101
+ - name: Publish to PyPI
102
+ if: steps.release.outputs.released == 'true'
103
+ uses: pypa/gh-action-pypi-publish@release/v1
104
+ with:
105
+ packages-dir: dist/
@@ -0,0 +1,85 @@
1
+ name: PR Validation
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - main
7
+ - develop
8
+
9
+ permissions:
10
+ pull-requests: read
11
+ contents: read
12
+
13
+ jobs:
14
+ validate-commits:
15
+ runs-on: ubuntu-latest
16
+
17
+ steps:
18
+ - uses: actions/checkout@v6
19
+ with:
20
+ fetch-depth: 0
21
+ fetch-tags: true
22
+
23
+ - name: Set up Node.js (for commitlint)
24
+ uses: actions/setup-node@v4
25
+ with:
26
+ node-version: '20'
27
+
28
+ - name: Install commitlint
29
+ run: |
30
+ npm install --global @commitlint/cli @commitlint/config-conventional
31
+
32
+ - name: Validate PR title (as fallback)
33
+ run: |
34
+ TITLE="${{ github.event.pull_request.title }}"
35
+ VALID_PREFIXES=("feat" "fix" "docs" "style" "refactor" "perf" "test" "chore" "ci" "revert")
36
+
37
+ PREFIX=$(echo "$TITLE" | sed -n 's/^\([a-z]*\).*/\1/p')
38
+
39
+ if [[ ! " ${VALID_PREFIXES[@]} " =~ " ${PREFIX} " ]]; then
40
+ echo "❌ PR title must start with a valid conventional commit prefix!"
41
+ echo "Valid prefixes: ${VALID_PREFIXES[*]}"
42
+ echo "Your PR title: $TITLE"
43
+ echo ""
44
+ echo "Examples of valid titles:"
45
+ echo " - feat: add new data query feature"
46
+ echo " - fix: resolve connection timeout issue"
47
+ echo " - docs: update API documentation"
48
+ exit 1
49
+ fi
50
+
51
+ echo "✅ PR title follows conventional commit format: '$TITLE'"
52
+
53
+ - name: Validate commit messages
54
+ run: |
55
+ # Get all commits in the PR
56
+ commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }}
57
+ continue-on-error: true
58
+
59
+ lint-python:
60
+ runs-on: ubuntu-latest
61
+
62
+ steps:
63
+ - uses: actions/checkout@v6
64
+
65
+ - name: Set up Python
66
+ uses: actions/setup-python@v6
67
+ with:
68
+ python-version: "3.13"
69
+
70
+ - name: Install dependencies
71
+ run: |
72
+ python -m pip install --upgrade pip
73
+ pip install -e '.[dev]'
74
+
75
+ - name: Run flake8
76
+ run: |
77
+ flake8 ods_exd_api_box/ tests/ || true
78
+
79
+ - name: Run black check
80
+ run: |
81
+ black --check ods_exd_api_box/ tests/ || true
82
+
83
+ - name: Run isort check
84
+ run: |
85
+ isort --check-only ods_exd_api_box/ tests/ || true
@@ -0,0 +1,7 @@
1
+ *.proto
2
+ .venv/
3
+ __pycache__
4
+ build/
5
+ dist/
6
+ *.egg-info/
7
+ .mypy_cache/
@@ -0,0 +1,56 @@
1
+ repos:
2
+ # Commit message linting
3
+ - repo: https://github.com/compilerla/conventional-pre-commit
4
+ rev: v3.1.0
5
+ hooks:
6
+ - id: conventional-pre-commit
7
+ stages: [commit-msg]
8
+
9
+ # Code formatting
10
+ - repo: https://github.com/psf/black
11
+ rev: 24.10.0
12
+ hooks:
13
+ - id: black
14
+ language_version: python3.12
15
+ exclude: ^ods_exd_api_box/proto/
16
+
17
+ # Import sorting
18
+ - repo: https://github.com/PyCQA/isort
19
+ rev: 5.13.2
20
+ hooks:
21
+ - id: isort
22
+ args: ["--profile", "black"]
23
+ exclude: ^ods_exd_api_box/proto/
24
+
25
+ # Linting
26
+ - repo: https://github.com/PyCQA/flake8
27
+ rev: 7.1.1
28
+ hooks:
29
+ - id: flake8
30
+ args: ["--max-line-length=119", "--extend-ignore=E203,W503,W293"]
31
+ exclude: ^ods_exd_api_box/proto/
32
+
33
+ # Type checking
34
+ - repo: https://github.com/pre-commit/mirrors-mypy
35
+ rev: v1.14.0
36
+ hooks:
37
+ - id: mypy
38
+ additional_dependencies: ["pandas-stubs"]
39
+ args: [--python-version=3.12, --no-error-summary]
40
+ exclude: ^(tests/|ods_exd_api_box/proto/)
41
+
42
+ # General file checks
43
+ - repo: https://github.com/pre-commit/pre-commit-hooks
44
+ rev: v4.6.0
45
+ hooks:
46
+ - id: trailing-whitespace
47
+ - id: end-of-file-fixer
48
+ - id: check-yaml
49
+ - id: check-json
50
+ - id: check-merge-conflict
51
+ - id: debug-statements
52
+ - id: detect-private-key
53
+
54
+ # Local configuration
55
+ default_stages: [pre-commit]
56
+ fail_fast: false
@@ -0,0 +1,111 @@
1
+ {
2
+ "extends": [
3
+ "semantic-release:commit-analyzer-default"
4
+ ],
5
+ "branches": [
6
+ "main",
7
+ {
8
+ "name": "develop",
9
+ "prerelease": "alpha"
10
+ }
11
+ ],
12
+ "plugins": [
13
+ [
14
+ "@semantic-release/commit-analyzer",
15
+ {
16
+ "preset": "conventional",
17
+ "releaseRules": [
18
+ {
19
+ "type": "feat",
20
+ "release": "minor"
21
+ },
22
+ {
23
+ "type": "fix",
24
+ "release": "patch"
25
+ },
26
+ {
27
+ "type": "perf",
28
+ "release": "patch"
29
+ },
30
+ {
31
+ "type": "docs",
32
+ "scope": "README",
33
+ "release": "patch"
34
+ },
35
+ {
36
+ "type": "refactor",
37
+ "release": "patch"
38
+ }
39
+ ]
40
+ }
41
+ ],
42
+ [
43
+ "@semantic-release/release-notes-generator",
44
+ {
45
+ "preset": "conventionalcommits",
46
+ "presetConfig": {
47
+ "types": [
48
+ {
49
+ "type": "feat",
50
+ "section": "Features",
51
+ "hidden": false
52
+ },
53
+ {
54
+ "type": "fix",
55
+ "section": "Bug Fixes",
56
+ "hidden": false
57
+ },
58
+ {
59
+ "type": "perf",
60
+ "section": "Performance",
61
+ "hidden": false
62
+ },
63
+ {
64
+ "type": "docs",
65
+ "section": "Documentation",
66
+ "hidden": false
67
+ },
68
+ {
69
+ "type": "refactor",
70
+ "section": "Refactoring",
71
+ "hidden": false
72
+ },
73
+ {
74
+ "type": "test",
75
+ "section": "Tests",
76
+ "hidden": true
77
+ },
78
+ {
79
+ "type": "chore",
80
+ "section": "Chores",
81
+ "hidden": true
82
+ }
83
+ ]
84
+ }
85
+ }
86
+ ],
87
+ [
88
+ "@semantic-release/changelog",
89
+ {
90
+ "changelogFile": "CHANGELOG.md"
91
+ }
92
+ ],
93
+ [
94
+ "@semantic-release/git",
95
+ {
96
+ "assets": [
97
+ "CHANGELOG.md",
98
+ "pyproject.toml"
99
+ ],
100
+ "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
101
+ }
102
+ ],
103
+ "@semantic-release/github",
104
+ [
105
+ "@semantic-release/npm",
106
+ {
107
+ "npmPublish": false
108
+ }
109
+ ]
110
+ ]
111
+ }
@@ -0,0 +1,51 @@
1
+ {
2
+ "editor.formatOnSave": true,
3
+ "editor.formatOnPaste": true,
4
+ "files.trimTrailingWhitespace": true,
5
+ "files.autoSave": "onFocusChange",
6
+ "flake8.args": [
7
+ "--max-line-length=119"
8
+ ],
9
+ "black-formatter.args": [
10
+ "--line-length=119"
11
+ ],
12
+ "pylint.args": [
13
+ "--max-line-length=119"
14
+ ],
15
+ "editor.codeActionsOnSave": {
16
+ "source.organizeImports": "explicit"
17
+ },
18
+ "cSpell.words": [
19
+ "appuser",
20
+ "DCOMPLEX",
21
+ "dtypes",
22
+ "grpcio",
23
+ "isort",
24
+ "issubdtype",
25
+ "jupyterlab",
26
+ "mypy",
27
+ "nptdms",
28
+ "protoc",
29
+ "pylint",
30
+ "pyproject",
31
+ "setuptools",
32
+ "Tdms",
33
+ "tobytes",
34
+ "totonga"
35
+ ],
36
+ "[python]": {
37
+ "editor.formatOnSave": true,
38
+ "editor.defaultFormatter": "ms-python.black-formatter",
39
+ "editor.rulers": [
40
+ 119
41
+ ]
42
+ },
43
+ "python.testing.unittestArgs": [
44
+ "-v",
45
+ "-s",
46
+ "./tests",
47
+ "-p",
48
+ "test_*.py"
49
+ ],
50
+ "python.testing.unittestEnabled": true
51
+ }
@@ -0,0 +1 @@
1
+ # CHANGELOG
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Andreas K
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,5 @@
1
+
2
+ # Project documentation and metadata
3
+ include README.md
4
+ include LICENSE
5
+ include pyproject.toml