pyBDL 1.0.0__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.
- pybdl-1.0.0/.github/CODEOWNERS +1 -0
- pybdl-1.0.0/.github/workflows/pr_checks.yml +150 -0
- pybdl-1.0.0/.github/workflows/release.yml +272 -0
- pybdl-1.0.0/.github/workflows/sphinx.yml +80 -0
- pybdl-1.0.0/.gitignore +198 -0
- pybdl-1.0.0/.pre-commit-config.yaml +252 -0
- pybdl-1.0.0/.yamllint +7 -0
- pybdl-1.0.0/CHANGELOG.md +11 -0
- pybdl-1.0.0/LICENSE +21 -0
- pybdl-1.0.0/Makefile +17 -0
- pybdl-1.0.0/PKG-INFO +142 -0
- pybdl-1.0.0/README.md +123 -0
- pybdl-1.0.0/docs/Makefile +20 -0
- pybdl-1.0.0/docs/_static/.gitkeep +2 -0
- pybdl-1.0.0/docs/access_layer.rst +676 -0
- pybdl-1.0.0/docs/api_clients.rst +221 -0
- pybdl-1.0.0/docs/appendix.rst +287 -0
- pybdl-1.0.0/docs/changelog.md +4 -0
- pybdl-1.0.0/docs/conf.py +41 -0
- pybdl-1.0.0/docs/config.rst +477 -0
- pybdl-1.0.0/docs/examples.ipynb +801 -0
- pybdl-1.0.0/docs/index.rst +95 -0
- pybdl-1.0.0/docs/main_client.rst +191 -0
- pybdl-1.0.0/docs/make.bat +35 -0
- pybdl-1.0.0/docs/rate_limiting.rst +365 -0
- pybdl-1.0.0/git-conventional-commits.yaml +34 -0
- pybdl-1.0.0/pybdl/__init__.py +6 -0
- pybdl-1.0.0/pybdl/access/__init__.py +23 -0
- pybdl-1.0.0/pybdl/access/aggregates.py +110 -0
- pybdl-1.0.0/pybdl/access/attributes.py +91 -0
- pybdl-1.0.0/pybdl/access/base.py +304 -0
- pybdl-1.0.0/pybdl/access/data.py +473 -0
- pybdl-1.0.0/pybdl/access/enrichment.py +404 -0
- pybdl-1.0.0/pybdl/access/levels.py +91 -0
- pybdl-1.0.0/pybdl/access/measures.py +91 -0
- pybdl-1.0.0/pybdl/access/subjects.py +165 -0
- pybdl-1.0.0/pybdl/access/units.py +375 -0
- pybdl-1.0.0/pybdl/access/variables.py +210 -0
- pybdl-1.0.0/pybdl/access/years.py +91 -0
- pybdl-1.0.0/pybdl/api/__init__.py +23 -0
- pybdl-1.0.0/pybdl/api/aggregates.py +130 -0
- pybdl-1.0.0/pybdl/api/attributes.py +130 -0
- pybdl-1.0.0/pybdl/api/client.py +1157 -0
- pybdl-1.0.0/pybdl/api/data.py +675 -0
- pybdl-1.0.0/pybdl/api/exceptions.py +81 -0
- pybdl-1.0.0/pybdl/api/levels.py +130 -0
- pybdl-1.0.0/pybdl/api/measures.py +130 -0
- pybdl-1.0.0/pybdl/api/subjects.py +211 -0
- pybdl-1.0.0/pybdl/api/units.py +408 -0
- pybdl-1.0.0/pybdl/api/variables.py +226 -0
- pybdl-1.0.0/pybdl/api/version.py +41 -0
- pybdl-1.0.0/pybdl/api/years.py +130 -0
- pybdl-1.0.0/pybdl/client.py +117 -0
- pybdl-1.0.0/pybdl/config.py +403 -0
- pybdl-1.0.0/pybdl/utils/cache.py +77 -0
- pybdl-1.0.0/pybdl/utils/http_cache/__init__.py +12 -0
- pybdl-1.0.0/pybdl/utils/http_cache/client_factory.py +62 -0
- pybdl-1.0.0/pybdl/utils/http_cache/paths.py +12 -0
- pybdl-1.0.0/pybdl/utils/http_cache/response.py +8 -0
- pybdl-1.0.0/pybdl/utils/rate_limiter/__init__.py +18 -0
- pybdl-1.0.0/pybdl/utils/rate_limiter/_async.py +104 -0
- pybdl-1.0.0/pybdl/utils/rate_limiter/_base.py +142 -0
- pybdl-1.0.0/pybdl/utils/rate_limiter/_cache.py +157 -0
- pybdl-1.0.0/pybdl/utils/rate_limiter/_decorators.py +46 -0
- pybdl-1.0.0/pybdl/utils/rate_limiter/_sync.py +73 -0
- pybdl-1.0.0/pyproject.toml +237 -0
- pybdl-1.0.0/tests/__init__.py +0 -0
- pybdl-1.0.0/tests/conftest.py +83 -0
- pybdl-1.0.0/tests/e2e/__init__.py +1 -0
- pybdl-1.0.0/tests/e2e/test_access_workflows.py +73 -0
- pybdl-1.0.0/tests/e2e/test_client_workflows.py +51 -0
- pybdl-1.0.0/tests/e2e/test_enrichment_e2e.py +49 -0
- pybdl-1.0.0/tests/integration/__init__.py +1 -0
- pybdl-1.0.0/tests/integration/access/__init__.py +1 -0
- pybdl-1.0.0/tests/integration/access/conftest.py +81 -0
- pybdl-1.0.0/tests/integration/access/samples/raw/samples_raw_aggregates.json +56 -0
- pybdl-1.0.0/tests/integration/access/samples/raw/samples_raw_attributes.json +118 -0
- pybdl-1.0.0/tests/integration/access/samples/raw/samples_raw_data.json +639 -0
- pybdl-1.0.0/tests/integration/access/samples/raw/samples_raw_levels.json +40 -0
- pybdl-1.0.0/tests/integration/access/samples/raw/samples_raw_measures.json +379 -0
- pybdl-1.0.0/tests/integration/access/samples/raw/samples_raw_subjects.json +280 -0
- pybdl-1.0.0/tests/integration/access/samples/raw/samples_raw_units.json +218 -0
- pybdl-1.0.0/tests/integration/access/samples/raw/samples_raw_variables.json +220 -0
- pybdl-1.0.0/tests/integration/access/samples/raw/samples_raw_years.json +164 -0
- pybdl-1.0.0/tests/integration/access/test_access_with_api_client.py +52 -0
- pybdl-1.0.0/tests/integration/access/test_aggregates_access_integration.py +92 -0
- pybdl-1.0.0/tests/integration/access/test_attributes_access_integration.py +78 -0
- pybdl-1.0.0/tests/integration/access/test_data_access_integration.py +189 -0
- pybdl-1.0.0/tests/integration/access/test_enrichment_integration.py +79 -0
- pybdl-1.0.0/tests/integration/access/test_levels_access_integration.py +75 -0
- pybdl-1.0.0/tests/integration/access/test_measures_access_integration.py +74 -0
- pybdl-1.0.0/tests/integration/access/test_subjects_access_integration.py +100 -0
- pybdl-1.0.0/tests/integration/access/test_units_access_integration.py +204 -0
- pybdl-1.0.0/tests/integration/access/test_variables_access_integration.py +121 -0
- pybdl-1.0.0/tests/integration/access/test_years_access_integration.py +72 -0
- pybdl-1.0.0/tests/integration/api/__init__.py +1 -0
- pybdl-1.0.0/tests/unit/__init__.py +1 -0
- pybdl-1.0.0/tests/unit/access/__init__.py +1 -0
- pybdl-1.0.0/tests/unit/access/test_aggregates_access.py +58 -0
- pybdl-1.0.0/tests/unit/access/test_attributes_access.py +58 -0
- pybdl-1.0.0/tests/unit/access/test_data_access.py +181 -0
- pybdl-1.0.0/tests/unit/access/test_enrichment.py +262 -0
- pybdl-1.0.0/tests/unit/access/test_levels_access.py +75 -0
- pybdl-1.0.0/tests/unit/access/test_measures_access.py +58 -0
- pybdl-1.0.0/tests/unit/access/test_subjects_access.py +94 -0
- pybdl-1.0.0/tests/unit/access/test_units_access.py +114 -0
- pybdl-1.0.0/tests/unit/access/test_variables_access.py +72 -0
- pybdl-1.0.0/tests/unit/access/test_years_access.py +58 -0
- pybdl-1.0.0/tests/unit/api/__init__.py +1 -0
- pybdl-1.0.0/tests/unit/api/conftest.py +22 -0
- pybdl-1.0.0/tests/unit/api/test_api_aggregates.py +93 -0
- pybdl-1.0.0/tests/unit/api/test_api_aggregates_async.py +72 -0
- pybdl-1.0.0/tests/unit/api/test_api_attributes.py +65 -0
- pybdl-1.0.0/tests/unit/api/test_api_attributes_async.py +35 -0
- pybdl-1.0.0/tests/unit/api/test_api_client.py +535 -0
- pybdl-1.0.0/tests/unit/api/test_api_client_async.py +157 -0
- pybdl-1.0.0/tests/unit/api/test_api_client_cache.py +180 -0
- pybdl-1.0.0/tests/unit/api/test_api_data.py +588 -0
- pybdl-1.0.0/tests/unit/api/test_api_data_async.py +201 -0
- pybdl-1.0.0/tests/unit/api/test_api_levels.py +154 -0
- pybdl-1.0.0/tests/unit/api/test_api_levels_async.py +75 -0
- pybdl-1.0.0/tests/unit/api/test_api_measures.py +104 -0
- pybdl-1.0.0/tests/unit/api/test_api_measures_async.py +75 -0
- pybdl-1.0.0/tests/unit/api/test_api_subjects.py +143 -0
- pybdl-1.0.0/tests/unit/api/test_api_subjects_async.py +104 -0
- pybdl-1.0.0/tests/unit/api/test_api_units.py +164 -0
- pybdl-1.0.0/tests/unit/api/test_api_units_async.py +79 -0
- pybdl-1.0.0/tests/unit/api/test_api_variables.py +182 -0
- pybdl-1.0.0/tests/unit/api/test_api_variables_async.py +131 -0
- pybdl-1.0.0/tests/unit/api/test_api_version.py +42 -0
- pybdl-1.0.0/tests/unit/api/test_api_years.py +89 -0
- pybdl-1.0.0/tests/unit/api/test_api_years_async.py +75 -0
- pybdl-1.0.0/tests/unit/test_base_access.py +245 -0
- pybdl-1.0.0/tests/unit/test_client.py +225 -0
- pybdl-1.0.0/tests/unit/test_config.py +372 -0
- pybdl-1.0.0/tests/unit/utils/__init__.py +1 -0
- pybdl-1.0.0/tests/unit/utils/utils/rate_limiter/conftest.py +13 -0
- pybdl-1.0.0/tests/unit/utils/utils/rate_limiter/test_rate_limiter_cache.py +174 -0
- pybdl-1.0.0/tests/unit/utils/utils/rate_limiter/test_rate_limiter_concurrency.py +51 -0
- pybdl-1.0.0/tests/unit/utils/utils/rate_limiter/test_rate_limiter_core.py +145 -0
- pybdl-1.0.0/tests/unit/utils/utils/rate_limiter/test_rate_limiter_features.py +320 -0
- pybdl-1.0.0/tests/unit/utils/utils/rate_limiter/test_rate_limiter_integration.py +158 -0
- pybdl-1.0.0/tests/unit/utils/utils/rate_limiter/test_rate_limiter_lifecycle.py +161 -0
- pybdl-1.0.0/tests/unit/utils/utils/rate_limiter/test_rate_limiter_package.py +43 -0
- pybdl-1.0.0/tests/unit/utils/utils/test_http_cache.py +162 -0
- pybdl-1.0.0/tests/unit/utils/utils/test_utils_cache.py +65 -0
- pybdl-1.0.0/uv.lock +3317 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* @AN0DA
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: PR checks
|
|
3
|
+
|
|
4
|
+
"on":
|
|
5
|
+
pull_request:
|
|
6
|
+
branches: [main]
|
|
7
|
+
types:
|
|
8
|
+
- opened
|
|
9
|
+
- synchronize
|
|
10
|
+
- reopened
|
|
11
|
+
- edited
|
|
12
|
+
paths:
|
|
13
|
+
- "pybdl/**"
|
|
14
|
+
- "tests/**"
|
|
15
|
+
- "pyproject.toml"
|
|
16
|
+
- ".github/workflows/pr_checks.yml"
|
|
17
|
+
|
|
18
|
+
concurrency:
|
|
19
|
+
group: pr-${{ github.event.pull_request.number || github.ref }}
|
|
20
|
+
cancel-in-progress: true
|
|
21
|
+
|
|
22
|
+
permissions: {}
|
|
23
|
+
|
|
24
|
+
jobs:
|
|
25
|
+
conventional-pr:
|
|
26
|
+
name: Conventional PR title
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
permissions:
|
|
29
|
+
pull-requests: read # action-semantic-pull-request: read PR title
|
|
30
|
+
steps:
|
|
31
|
+
- name: Check PR title
|
|
32
|
+
uses: amannn/action-semantic-pull-request@e32d7e603df1aa1ba07e981f2a23455dee596825 # v5
|
|
33
|
+
env:
|
|
34
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
35
|
+
|
|
36
|
+
lint:
|
|
37
|
+
name: Linting (Python ${{ matrix.python-version }})
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
permissions:
|
|
40
|
+
contents: read
|
|
41
|
+
strategy:
|
|
42
|
+
fail-fast: false
|
|
43
|
+
matrix:
|
|
44
|
+
python-version: ["3.11", "3.12", "3.13", "3.14"]
|
|
45
|
+
steps:
|
|
46
|
+
- name: Checkout repo
|
|
47
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
48
|
+
with:
|
|
49
|
+
persist-credentials: false
|
|
50
|
+
|
|
51
|
+
- name: Install uv
|
|
52
|
+
uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
|
|
53
|
+
with:
|
|
54
|
+
enable-cache: true
|
|
55
|
+
cache-dependency-glob: "uv.lock"
|
|
56
|
+
|
|
57
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
58
|
+
env:
|
|
59
|
+
UV_PYTHON_VERSION: ${{ matrix.python-version }}
|
|
60
|
+
run: uv python install "${UV_PYTHON_VERSION}"
|
|
61
|
+
|
|
62
|
+
- name: Install project (dev + extras)
|
|
63
|
+
run: uv sync --all-extras --dev
|
|
64
|
+
|
|
65
|
+
- name: Ruff linter
|
|
66
|
+
run: uv run ruff check --config pyproject.toml --output-format=github pybdl/ tests/
|
|
67
|
+
|
|
68
|
+
- name: Ruff formatter (check only)
|
|
69
|
+
run: uv run ruff format --config pyproject.toml --check pybdl/ tests/
|
|
70
|
+
|
|
71
|
+
- name: Bandit
|
|
72
|
+
run: uv run bandit -c pyproject.toml -r pybdl/
|
|
73
|
+
|
|
74
|
+
mypy:
|
|
75
|
+
name: Mypy (Python ${{ matrix.python-version }})
|
|
76
|
+
runs-on: ubuntu-latest
|
|
77
|
+
permissions:
|
|
78
|
+
contents: read
|
|
79
|
+
strategy:
|
|
80
|
+
fail-fast: false
|
|
81
|
+
matrix:
|
|
82
|
+
python-version: ["3.11", "3.12", "3.13", "3.14"]
|
|
83
|
+
steps:
|
|
84
|
+
- name: Checkout repo
|
|
85
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
86
|
+
with:
|
|
87
|
+
persist-credentials: false
|
|
88
|
+
|
|
89
|
+
- name: Install uv
|
|
90
|
+
uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
|
|
91
|
+
with:
|
|
92
|
+
enable-cache: true
|
|
93
|
+
cache-dependency-glob: "uv.lock"
|
|
94
|
+
|
|
95
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
96
|
+
env:
|
|
97
|
+
UV_PYTHON_VERSION: ${{ matrix.python-version }}
|
|
98
|
+
run: uv python install "${UV_PYTHON_VERSION}"
|
|
99
|
+
|
|
100
|
+
- name: Install project (dev + extras)
|
|
101
|
+
run: uv sync --all-extras --dev
|
|
102
|
+
|
|
103
|
+
- name: Mypy
|
|
104
|
+
run: uv run mypy pybdl/ tests/
|
|
105
|
+
|
|
106
|
+
tests:
|
|
107
|
+
name: Tests (Python ${{ matrix.python-version }})
|
|
108
|
+
runs-on: ubuntu-latest
|
|
109
|
+
needs:
|
|
110
|
+
- lint
|
|
111
|
+
- mypy
|
|
112
|
+
- conventional-pr
|
|
113
|
+
strategy:
|
|
114
|
+
fail-fast: false
|
|
115
|
+
matrix:
|
|
116
|
+
python-version: ["3.11", "3.12", "3.13", "3.14"]
|
|
117
|
+
permissions:
|
|
118
|
+
contents: read
|
|
119
|
+
checks: write # publish-unit-test-result-action: create check runs
|
|
120
|
+
pull-requests: write # publish-unit-test-result-action: annotate PR
|
|
121
|
+
steps:
|
|
122
|
+
- name: Checkout repo
|
|
123
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
124
|
+
with:
|
|
125
|
+
persist-credentials: false
|
|
126
|
+
|
|
127
|
+
- name: Install uv
|
|
128
|
+
uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
|
|
129
|
+
with:
|
|
130
|
+
enable-cache: true
|
|
131
|
+
cache-dependency-glob: "uv.lock"
|
|
132
|
+
|
|
133
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
134
|
+
env:
|
|
135
|
+
UV_PYTHON_VERSION: ${{ matrix.python-version }}
|
|
136
|
+
run: uv python install "${UV_PYTHON_VERSION}"
|
|
137
|
+
|
|
138
|
+
- name: Install project (dev + extras)
|
|
139
|
+
run: uv sync --all-extras --dev
|
|
140
|
+
|
|
141
|
+
- name: Run tests with coverage
|
|
142
|
+
run: uv run coverage run -m pytest --junitxml=./test_results.xml
|
|
143
|
+
|
|
144
|
+
- name: Publish test results to GitHub
|
|
145
|
+
if: ${{ !cancelled() }}
|
|
146
|
+
uses: EnricoMi/publish-unit-test-result-action@2ceeed2b8f26e15b06c3846719f75354febd9e7b # v2
|
|
147
|
+
with:
|
|
148
|
+
files: ./test_results.xml
|
|
149
|
+
fail_on: nothing
|
|
150
|
+
pull_request_build: commit
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Release
|
|
3
|
+
|
|
4
|
+
"on":
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
|
|
7
|
+
permissions: {}
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
11
|
+
cancel-in-progress: false
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
quality-checks:
|
|
15
|
+
name: Quality checks (Python ${{ matrix.python-version }})
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
permissions:
|
|
18
|
+
contents: read
|
|
19
|
+
strategy:
|
|
20
|
+
fail-fast: false
|
|
21
|
+
matrix:
|
|
22
|
+
python-version: ["3.11", "3.12", "3.13", "3.14"]
|
|
23
|
+
|
|
24
|
+
steps:
|
|
25
|
+
- name: Checkout repository
|
|
26
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
27
|
+
with:
|
|
28
|
+
fetch-depth: 0
|
|
29
|
+
persist-credentials: false
|
|
30
|
+
|
|
31
|
+
- name: Install uv
|
|
32
|
+
uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
|
|
33
|
+
with:
|
|
34
|
+
enable-cache: false
|
|
35
|
+
|
|
36
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
37
|
+
env:
|
|
38
|
+
UV_PYTHON_VERSION: ${{ matrix.python-version }}
|
|
39
|
+
run: uv python install "${UV_PYTHON_VERSION}"
|
|
40
|
+
|
|
41
|
+
- name: Install dependencies
|
|
42
|
+
run: uv sync --all-extras --dev
|
|
43
|
+
|
|
44
|
+
- name: Run Ruff linter
|
|
45
|
+
if: ${{ !cancelled() }}
|
|
46
|
+
run: uv run ruff check --config pyproject.toml --output-format=github pybdl/ tests/
|
|
47
|
+
|
|
48
|
+
- name: Run Ruff formatter
|
|
49
|
+
if: ${{ !cancelled() }}
|
|
50
|
+
run: uv run ruff format --config pyproject.toml --check pybdl/ tests/
|
|
51
|
+
|
|
52
|
+
- name: Run Bandit security checks
|
|
53
|
+
if: ${{ !cancelled() }}
|
|
54
|
+
run: uv run bandit -c pyproject.toml -r pybdl/
|
|
55
|
+
|
|
56
|
+
- name: Run Mypy type checker
|
|
57
|
+
if: ${{ !cancelled() }}
|
|
58
|
+
run: uv run mypy pybdl/ tests/
|
|
59
|
+
|
|
60
|
+
test:
|
|
61
|
+
name: Test (Python ${{ matrix.python-version }})
|
|
62
|
+
runs-on: ubuntu-latest
|
|
63
|
+
strategy:
|
|
64
|
+
fail-fast: false
|
|
65
|
+
matrix:
|
|
66
|
+
python-version: ["3.11", "3.12", "3.13", "3.14"]
|
|
67
|
+
|
|
68
|
+
permissions:
|
|
69
|
+
contents: read
|
|
70
|
+
checks: write # publish-unit-test-result-action: create check runs
|
|
71
|
+
pull-requests: write # publish-unit-test-result-action: annotate PR
|
|
72
|
+
id-token: write # codecov-action: OIDC token when not using CODECOV_TOKEN
|
|
73
|
+
|
|
74
|
+
steps:
|
|
75
|
+
- name: Checkout repository
|
|
76
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
77
|
+
with:
|
|
78
|
+
persist-credentials: false
|
|
79
|
+
|
|
80
|
+
- name: Install uv
|
|
81
|
+
uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
|
|
82
|
+
with:
|
|
83
|
+
enable-cache: false
|
|
84
|
+
|
|
85
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
86
|
+
env:
|
|
87
|
+
UV_PYTHON_VERSION: ${{ matrix.python-version }}
|
|
88
|
+
run: uv python install "${UV_PYTHON_VERSION}"
|
|
89
|
+
|
|
90
|
+
- name: Install dependencies
|
|
91
|
+
run: uv sync --all-extras --dev
|
|
92
|
+
|
|
93
|
+
- name: Run tests with coverage
|
|
94
|
+
run: uv run coverage run -m pytest --junitxml=./test_results.xml
|
|
95
|
+
|
|
96
|
+
- name: Generate coverage report
|
|
97
|
+
if: ${{ !cancelled() }}
|
|
98
|
+
run: |
|
|
99
|
+
uv run coverage report
|
|
100
|
+
uv run coverage xml
|
|
101
|
+
|
|
102
|
+
- name: Publish test results
|
|
103
|
+
uses: EnricoMi/publish-unit-test-result-action@2ceeed2b8f26e15b06c3846719f75354febd9e7b # v2
|
|
104
|
+
if: ${{ !cancelled() }}
|
|
105
|
+
with:
|
|
106
|
+
files: ./test_results.xml
|
|
107
|
+
check_name: Test Results (Python ${{ matrix.python-version }})
|
|
108
|
+
|
|
109
|
+
- name: Upload coverage to Codecov
|
|
110
|
+
if: matrix.python-version == '3.12'
|
|
111
|
+
uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5
|
|
112
|
+
with:
|
|
113
|
+
files: ./coverage.xml
|
|
114
|
+
flags: unittests
|
|
115
|
+
name: codecov-umbrella
|
|
116
|
+
fail_ci_if_error: false
|
|
117
|
+
|
|
118
|
+
release:
|
|
119
|
+
name: Semantic release
|
|
120
|
+
runs-on: ubuntu-latest
|
|
121
|
+
needs: [quality-checks, test]
|
|
122
|
+
if: github.ref == 'refs/heads/main'
|
|
123
|
+
|
|
124
|
+
environment: release
|
|
125
|
+
|
|
126
|
+
permissions:
|
|
127
|
+
contents: write # semantic-release: tag, commit version bumps, push to main
|
|
128
|
+
|
|
129
|
+
outputs:
|
|
130
|
+
released: ${{ steps.release.outputs.released }}
|
|
131
|
+
version: ${{ steps.release.outputs.version }}
|
|
132
|
+
tag: ${{ steps.release.outputs.tag }}
|
|
133
|
+
|
|
134
|
+
steps:
|
|
135
|
+
- name: Generate GitHub App Token
|
|
136
|
+
id: app-token
|
|
137
|
+
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
|
|
138
|
+
with:
|
|
139
|
+
app-id: ${{ vars.GH_APP_RW_ACCESS_APP_ID }}
|
|
140
|
+
private-key: ${{ secrets.GH_APP_RW_ACCESS_PRIVATE_KEY }}
|
|
141
|
+
|
|
142
|
+
- name: Checkout repository
|
|
143
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
144
|
+
with:
|
|
145
|
+
fetch-depth: 0
|
|
146
|
+
token: ${{ steps.app-token.outputs.token }}
|
|
147
|
+
persist-credentials: true # zizmor: ignore[artipacked]
|
|
148
|
+
|
|
149
|
+
- name: Install uv
|
|
150
|
+
uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
|
|
151
|
+
with:
|
|
152
|
+
enable-cache: false
|
|
153
|
+
|
|
154
|
+
- name: Set up Python
|
|
155
|
+
run: uv python install
|
|
156
|
+
|
|
157
|
+
- name: Install dependencies
|
|
158
|
+
run: uv sync --dev
|
|
159
|
+
|
|
160
|
+
- name: Setup Git
|
|
161
|
+
run: |
|
|
162
|
+
git config --global user.name "github-actions[bot]"
|
|
163
|
+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
164
|
+
|
|
165
|
+
- name: Python Semantic Release
|
|
166
|
+
id: release
|
|
167
|
+
uses: python-semantic-release/python-semantic-release@fb90716c1b3afbd1d88f48d7f88ba7365914a86e # v10.5.2
|
|
168
|
+
with:
|
|
169
|
+
github_token: ${{ steps.app-token.outputs.token }}
|
|
170
|
+
verbosity: "2"
|
|
171
|
+
|
|
172
|
+
build:
|
|
173
|
+
name: Build distribution
|
|
174
|
+
runs-on: ubuntu-latest
|
|
175
|
+
needs: release
|
|
176
|
+
if: needs.release.outputs.released == 'true'
|
|
177
|
+
|
|
178
|
+
permissions:
|
|
179
|
+
contents: read
|
|
180
|
+
|
|
181
|
+
steps:
|
|
182
|
+
- name: Checkout repository
|
|
183
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
184
|
+
with:
|
|
185
|
+
ref: main
|
|
186
|
+
fetch-depth: 0
|
|
187
|
+
persist-credentials: false
|
|
188
|
+
|
|
189
|
+
- name: Install uv
|
|
190
|
+
uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
|
|
191
|
+
with:
|
|
192
|
+
enable-cache: false
|
|
193
|
+
|
|
194
|
+
- name: Set up Python
|
|
195
|
+
run: uv python install
|
|
196
|
+
|
|
197
|
+
- name: Build package
|
|
198
|
+
run: uv build
|
|
199
|
+
|
|
200
|
+
- name: Store distribution packages
|
|
201
|
+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
|
202
|
+
with:
|
|
203
|
+
name: python-package-distributions
|
|
204
|
+
path: dist/
|
|
205
|
+
retention-days: 7
|
|
206
|
+
|
|
207
|
+
publish-pypi:
|
|
208
|
+
name: Publish to PyPI
|
|
209
|
+
runs-on: ubuntu-latest
|
|
210
|
+
needs: [release, build]
|
|
211
|
+
if: needs.release.outputs.released == 'true'
|
|
212
|
+
|
|
213
|
+
environment:
|
|
214
|
+
name: pypi
|
|
215
|
+
url: https://pypi.org/p/pybdl
|
|
216
|
+
|
|
217
|
+
permissions:
|
|
218
|
+
id-token: write # Trusted publishing to PyPI
|
|
219
|
+
|
|
220
|
+
steps:
|
|
221
|
+
- name: Download distributions
|
|
222
|
+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
|
|
223
|
+
with:
|
|
224
|
+
name: python-package-distributions
|
|
225
|
+
path: dist/
|
|
226
|
+
|
|
227
|
+
- name: Publish to PyPI
|
|
228
|
+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1
|
|
229
|
+
|
|
230
|
+
publish-github:
|
|
231
|
+
name: Upload to GitHub Release
|
|
232
|
+
runs-on: ubuntu-latest
|
|
233
|
+
needs: [release, build]
|
|
234
|
+
if: needs.release.outputs.released == 'true'
|
|
235
|
+
|
|
236
|
+
environment: release
|
|
237
|
+
|
|
238
|
+
permissions:
|
|
239
|
+
contents: write # gh release upload: attach assets to GitHub Release
|
|
240
|
+
id-token: write # sigstore/gh-action-sigstore-python: OIDC for signing
|
|
241
|
+
|
|
242
|
+
steps:
|
|
243
|
+
- name: Download distributions
|
|
244
|
+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
|
|
245
|
+
with:
|
|
246
|
+
name: python-package-distributions
|
|
247
|
+
path: dist/
|
|
248
|
+
|
|
249
|
+
- name: Sign distributions with Sigstore
|
|
250
|
+
uses: sigstore/gh-action-sigstore-python@f514d46b907ebcd5bedc05145c03b69c1edd8b46 # v3.0.0
|
|
251
|
+
with:
|
|
252
|
+
inputs: >-
|
|
253
|
+
./dist/*.tar.gz
|
|
254
|
+
./dist/*.whl
|
|
255
|
+
|
|
256
|
+
- name: Generate GitHub App Token
|
|
257
|
+
id: app-token
|
|
258
|
+
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
|
|
259
|
+
with:
|
|
260
|
+
app-id: ${{ vars.GH_APP_RW_ACCESS_APP_ID }}
|
|
261
|
+
private-key: ${{ secrets.GH_APP_RW_ACCESS_PRIVATE_KEY }}
|
|
262
|
+
|
|
263
|
+
- name: Upload to GitHub Release
|
|
264
|
+
env:
|
|
265
|
+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
266
|
+
RELEASE_TAG: ${{ needs.release.outputs.tag }}
|
|
267
|
+
GITHUB_REPOSITORY: ${{ github.repository }}
|
|
268
|
+
run: |
|
|
269
|
+
set -euo pipefail
|
|
270
|
+
shopt -s nullglob
|
|
271
|
+
assets=(dist/*.tar.gz dist/*.whl)
|
|
272
|
+
gh release upload "${RELEASE_TAG}" "${assets[@]}" --repo "${GITHUB_REPOSITORY}"
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Docs
|
|
3
|
+
|
|
4
|
+
"on":
|
|
5
|
+
push:
|
|
6
|
+
branches: [main]
|
|
7
|
+
paths:
|
|
8
|
+
- "docs/**"
|
|
9
|
+
- "pybdl/**"
|
|
10
|
+
- ".github/workflows/sphinx.yml"
|
|
11
|
+
- "pyproject.toml"
|
|
12
|
+
pull_request:
|
|
13
|
+
paths:
|
|
14
|
+
- "docs/**"
|
|
15
|
+
- "pybdl/**"
|
|
16
|
+
- ".github/workflows/sphinx.yml"
|
|
17
|
+
- "pyproject.toml"
|
|
18
|
+
|
|
19
|
+
concurrency:
|
|
20
|
+
group: docs-${{ github.ref }}
|
|
21
|
+
cancel-in-progress: true
|
|
22
|
+
|
|
23
|
+
permissions: {}
|
|
24
|
+
|
|
25
|
+
jobs:
|
|
26
|
+
build:
|
|
27
|
+
name: Build Sphinx docs
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
permissions:
|
|
30
|
+
contents: read
|
|
31
|
+
steps:
|
|
32
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
33
|
+
with:
|
|
34
|
+
fetch-depth: 0
|
|
35
|
+
persist-credentials: false
|
|
36
|
+
|
|
37
|
+
- name: Install uv
|
|
38
|
+
uses: astral-sh/setup-uv@94527f2e458b27549849d47d273a16bec83a01e9 # v7
|
|
39
|
+
with:
|
|
40
|
+
enable-cache: true
|
|
41
|
+
cache-dependency-glob: "uv.lock"
|
|
42
|
+
|
|
43
|
+
- name: Set up Python
|
|
44
|
+
run: uv python install
|
|
45
|
+
|
|
46
|
+
- name: Install docs dependencies
|
|
47
|
+
run: uv sync --only-group docs
|
|
48
|
+
|
|
49
|
+
- name: Build HTML (fail on warnings)
|
|
50
|
+
run: >
|
|
51
|
+
uv run sphinx-build -W --keep-going -b html docs docs/_build/html
|
|
52
|
+
|
|
53
|
+
- name: Upload docs as artifact (PRs & pushes)
|
|
54
|
+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
|
55
|
+
with:
|
|
56
|
+
name: html-docs
|
|
57
|
+
path: docs/_build/html
|
|
58
|
+
retention-days: 7
|
|
59
|
+
|
|
60
|
+
- name: Upload GitHub Pages artifact (only main)
|
|
61
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
62
|
+
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4
|
|
63
|
+
with:
|
|
64
|
+
path: docs/_build/html
|
|
65
|
+
|
|
66
|
+
deploy:
|
|
67
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
68
|
+
name: Deploy to GitHub Pages
|
|
69
|
+
needs: build
|
|
70
|
+
runs-on: ubuntu-latest
|
|
71
|
+
environment:
|
|
72
|
+
name: github-pages
|
|
73
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
74
|
+
permissions:
|
|
75
|
+
pages: write # deploy-pages: publish to GitHub Pages
|
|
76
|
+
id-token: write # deploy-pages: OIDC authentication with Pages
|
|
77
|
+
steps:
|
|
78
|
+
- name: Deploy to GitHub Pages
|
|
79
|
+
id: deployment
|
|
80
|
+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4
|
pybdl-1.0.0/.gitignore
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
### OSX template
|
|
2
|
+
# General
|
|
3
|
+
.DS_Store
|
|
4
|
+
.AppleDouble
|
|
5
|
+
.LSOverride
|
|
6
|
+
|
|
7
|
+
# Icon must end with two \r
|
|
8
|
+
Icon
|
|
9
|
+
|
|
10
|
+
# Thumbnails
|
|
11
|
+
._*
|
|
12
|
+
|
|
13
|
+
# Files that might appear in the root of a volume
|
|
14
|
+
.DocumentRevisions-V100
|
|
15
|
+
.fseventsd
|
|
16
|
+
.Spotlight-V100
|
|
17
|
+
.TemporaryItems
|
|
18
|
+
.Trashes
|
|
19
|
+
.VolumeIcon.icns
|
|
20
|
+
.com.apple.timemachine.donotpresent
|
|
21
|
+
|
|
22
|
+
# Directories potentially created on remote AFP share
|
|
23
|
+
.AppleDB
|
|
24
|
+
.AppleDesktop
|
|
25
|
+
Network Trash Folder
|
|
26
|
+
Temporary Items
|
|
27
|
+
.apdisk
|
|
28
|
+
|
|
29
|
+
### Python template
|
|
30
|
+
# Byte-compiled / optimized / DLL files
|
|
31
|
+
__pycache__/
|
|
32
|
+
*.py[cod]
|
|
33
|
+
*$py.class
|
|
34
|
+
|
|
35
|
+
# C extensions
|
|
36
|
+
*.so
|
|
37
|
+
|
|
38
|
+
# Distribution / packaging
|
|
39
|
+
.Python
|
|
40
|
+
build/
|
|
41
|
+
develop-eggs/
|
|
42
|
+
dist/
|
|
43
|
+
downloads/
|
|
44
|
+
eggs/
|
|
45
|
+
.eggs/
|
|
46
|
+
lib/
|
|
47
|
+
lib64/
|
|
48
|
+
parts/
|
|
49
|
+
sdist/
|
|
50
|
+
var/
|
|
51
|
+
wheels/
|
|
52
|
+
share/python-wheels/
|
|
53
|
+
*.egg-info/
|
|
54
|
+
.installed.cfg
|
|
55
|
+
*.egg
|
|
56
|
+
MANIFEST
|
|
57
|
+
|
|
58
|
+
# PyInstaller
|
|
59
|
+
# Usually these files are written by a python script from a template
|
|
60
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
61
|
+
*.manifest
|
|
62
|
+
*.spec
|
|
63
|
+
|
|
64
|
+
# Installer logs
|
|
65
|
+
pip-log.txt
|
|
66
|
+
pip-delete-this-directory.txt
|
|
67
|
+
|
|
68
|
+
# Unit test / coverage reports
|
|
69
|
+
htmlcov/
|
|
70
|
+
.tox/
|
|
71
|
+
.nox/
|
|
72
|
+
.coverage
|
|
73
|
+
.coverage.*
|
|
74
|
+
.cache
|
|
75
|
+
nosetests.xml
|
|
76
|
+
coverage.xml
|
|
77
|
+
*.cover
|
|
78
|
+
*.py,cover
|
|
79
|
+
.hypothesis/
|
|
80
|
+
.pytest_cache/
|
|
81
|
+
cover/
|
|
82
|
+
|
|
83
|
+
# Translations
|
|
84
|
+
*.mo
|
|
85
|
+
*.pot
|
|
86
|
+
|
|
87
|
+
# Django stuff:
|
|
88
|
+
*.log
|
|
89
|
+
local_settings.py
|
|
90
|
+
db.sqlite3
|
|
91
|
+
db.sqlite3-journal
|
|
92
|
+
|
|
93
|
+
# Flask stuff:
|
|
94
|
+
instance/
|
|
95
|
+
.webassets-cache
|
|
96
|
+
|
|
97
|
+
# Scrapy stuff:
|
|
98
|
+
.scrapy
|
|
99
|
+
|
|
100
|
+
# Sphinx documentation
|
|
101
|
+
docs/_build/
|
|
102
|
+
|
|
103
|
+
# PyBuilder
|
|
104
|
+
.pybuilder/
|
|
105
|
+
target/
|
|
106
|
+
|
|
107
|
+
# Jupyter Notebook
|
|
108
|
+
.ipynb_checkpoints
|
|
109
|
+
|
|
110
|
+
# IPython
|
|
111
|
+
profile_default/
|
|
112
|
+
ipython_config.py
|
|
113
|
+
|
|
114
|
+
# pyenv
|
|
115
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
116
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
117
|
+
.python-version
|
|
118
|
+
|
|
119
|
+
# pipenv
|
|
120
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
121
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
122
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
123
|
+
# install all needed dependencies.
|
|
124
|
+
#Pipfile.lock
|
|
125
|
+
|
|
126
|
+
# poetry
|
|
127
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
128
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
129
|
+
# commonly ignored for libraries.
|
|
130
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
131
|
+
#poetry.lock
|
|
132
|
+
|
|
133
|
+
# pdm
|
|
134
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
135
|
+
#pdm.lock
|
|
136
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
137
|
+
# in version control.
|
|
138
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
139
|
+
.pdm.toml
|
|
140
|
+
.pdm-python
|
|
141
|
+
.pdm-build/
|
|
142
|
+
|
|
143
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
144
|
+
__pypackages__/
|
|
145
|
+
|
|
146
|
+
# Celery stuff
|
|
147
|
+
celerybeat-schedule
|
|
148
|
+
celerybeat.pid
|
|
149
|
+
|
|
150
|
+
# SageMath parsed files
|
|
151
|
+
*.sage.py
|
|
152
|
+
|
|
153
|
+
# Environments
|
|
154
|
+
.env
|
|
155
|
+
.venv
|
|
156
|
+
env/
|
|
157
|
+
venv/
|
|
158
|
+
ENV/
|
|
159
|
+
env.bak/
|
|
160
|
+
venv.bak/
|
|
161
|
+
|
|
162
|
+
# Spyder project settings
|
|
163
|
+
.spyderproject
|
|
164
|
+
.spyproject
|
|
165
|
+
|
|
166
|
+
# Rope project settings
|
|
167
|
+
.ropeproject
|
|
168
|
+
|
|
169
|
+
# mkdocs documentation
|
|
170
|
+
/site
|
|
171
|
+
|
|
172
|
+
# mypy
|
|
173
|
+
.mypy_cache/
|
|
174
|
+
.dmypy.json
|
|
175
|
+
dmypy.json
|
|
176
|
+
|
|
177
|
+
# Pyre type checker
|
|
178
|
+
.pyre/
|
|
179
|
+
|
|
180
|
+
# pytype static type analyzer
|
|
181
|
+
.pytype/
|
|
182
|
+
|
|
183
|
+
# Cython debug symbols
|
|
184
|
+
cython_debug/
|
|
185
|
+
|
|
186
|
+
# PyCharm
|
|
187
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
188
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
189
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
190
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
191
|
+
.idea/
|
|
192
|
+
|
|
193
|
+
# Custom
|
|
194
|
+
bdl_api_swagger.json
|
|
195
|
+
.envrc
|
|
196
|
+
.vscode/
|
|
197
|
+
dev/
|
|
198
|
+
.worktrees/
|