azure-functions-db 0.1.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.
Files changed (126) hide show
  1. azure_functions_db-0.1.0/.editorconfig +12 -0
  2. azure_functions_db-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +69 -0
  3. azure_functions_db-0.1.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
  4. azure_functions_db-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +65 -0
  5. azure_functions_db-0.1.0/.github/ISSUE_TEMPLATE/task.yml +56 -0
  6. azure_functions_db-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +33 -0
  7. azure_functions_db-0.1.0/.github/dependabot.yml +22 -0
  8. azure_functions_db-0.1.0/.github/labels.yml +47 -0
  9. azure_functions_db-0.1.0/.github/workflows/ci-test.yml +69 -0
  10. azure_functions_db-0.1.0/.github/workflows/create-release.yml +26 -0
  11. azure_functions_db-0.1.0/.github/workflows/docs.yml +34 -0
  12. azure_functions_db-0.1.0/.github/workflows/publish-pypi.yml +56 -0
  13. azure_functions_db-0.1.0/.gitignore +33 -0
  14. azure_functions_db-0.1.0/.pre-commit-config.yaml +29 -0
  15. azure_functions_db-0.1.0/AGENTS.md +40 -0
  16. azure_functions_db-0.1.0/CHANGELOG.md +42 -0
  17. azure_functions_db-0.1.0/CODE_OF_CONDUCT.md +56 -0
  18. azure_functions_db-0.1.0/CONTRIBUTING.md +78 -0
  19. azure_functions_db-0.1.0/LICENSE +21 -0
  20. azure_functions_db-0.1.0/Makefile +210 -0
  21. azure_functions_db-0.1.0/PKG-INFO +427 -0
  22. azure_functions_db-0.1.0/README.md +371 -0
  23. azure_functions_db-0.1.0/SECURITY.md +35 -0
  24. azure_functions_db-0.1.0/SUPPORT.md +46 -0
  25. azure_functions_db-0.1.0/azure_functions_db/__init__.py +63 -0
  26. azure_functions_db-0.1.0/azure_functions_db/adapter/__init__.py +5 -0
  27. azure_functions_db-0.1.0/azure_functions_db/adapter/sqlalchemy.py +388 -0
  28. azure_functions_db-0.1.0/azure_functions_db/binding/__init__.py +6 -0
  29. azure_functions_db-0.1.0/azure_functions_db/binding/reader.py +292 -0
  30. azure_functions_db-0.1.0/azure_functions_db/binding/writer.py +441 -0
  31. azure_functions_db-0.1.0/azure_functions_db/core/__init__.py +47 -0
  32. azure_functions_db-0.1.0/azure_functions_db/core/config.py +34 -0
  33. azure_functions_db-0.1.0/azure_functions_db/core/engine.py +54 -0
  34. azure_functions_db-0.1.0/azure_functions_db/core/errors.py +29 -0
  35. azure_functions_db-0.1.0/azure_functions_db/core/serializers.py +42 -0
  36. azure_functions_db-0.1.0/azure_functions_db/core/types.py +19 -0
  37. azure_functions_db-0.1.0/azure_functions_db/decorator.py +945 -0
  38. azure_functions_db-0.1.0/azure_functions_db/observability.py +94 -0
  39. azure_functions_db-0.1.0/azure_functions_db/py.typed +0 -0
  40. azure_functions_db-0.1.0/azure_functions_db/state/__init__.py +13 -0
  41. azure_functions_db-0.1.0/azure_functions_db/state/blob.py +430 -0
  42. azure_functions_db-0.1.0/azure_functions_db/state/errors.py +15 -0
  43. azure_functions_db-0.1.0/azure_functions_db/trigger/__init__.py +41 -0
  44. azure_functions_db-0.1.0/azure_functions_db/trigger/context.py +16 -0
  45. azure_functions_db-0.1.0/azure_functions_db/trigger/errors.py +35 -0
  46. azure_functions_db-0.1.0/azure_functions_db/trigger/events.py +32 -0
  47. azure_functions_db-0.1.0/azure_functions_db/trigger/normalizers.py +71 -0
  48. azure_functions_db-0.1.0/azure_functions_db/trigger/poll.py +103 -0
  49. azure_functions_db-0.1.0/azure_functions_db/trigger/retry.py +29 -0
  50. azure_functions_db-0.1.0/azure_functions_db/trigger/runner.py +595 -0
  51. azure_functions_db-0.1.0/benchmarks/bench_catchup.py +117 -0
  52. azure_functions_db-0.1.0/cliff.toml +32 -0
  53. azure_functions_db-0.1.0/codecov.yml +13 -0
  54. azure_functions_db-0.1.0/docs/00-project-overview.md +82 -0
  55. azure_functions_db-0.1.0/docs/01-PRD.md +165 -0
  56. azure_functions_db-0.1.0/docs/02-architecture.md +324 -0
  57. azure_functions_db-0.1.0/docs/03-semantics.md +236 -0
  58. azure_functions_db-0.1.0/docs/04-python-api-spec.md +531 -0
  59. azure_functions_db-0.1.0/docs/05-adapter-sdk.md +167 -0
  60. azure_functions_db-0.1.0/docs/06-checkpoint-lease-spec.md +183 -0
  61. azure_functions_db-0.1.0/docs/07-event-model.md +157 -0
  62. azure_functions_db-0.1.0/docs/08-repo-structure.md +133 -0
  63. azure_functions_db-0.1.0/docs/09-local-dev-guide.md +109 -0
  64. azure_functions_db-0.1.0/docs/10-test-strategy.md +117 -0
  65. azure_functions_db-0.1.0/docs/11-observability.md +210 -0
  66. azure_functions_db-0.1.0/docs/12-security.md +63 -0
  67. azure_functions_db-0.1.0/docs/13-deployment-guide.md +102 -0
  68. azure_functions_db-0.1.0/docs/14-roadmap.md +43 -0
  69. azure_functions_db-0.1.0/docs/15-CONTRIBUTING.md +44 -0
  70. azure_functions_db-0.1.0/docs/16-ADR-001-pseudo-trigger-over-native.md +38 -0
  71. azure_functions_db-0.1.0/docs/17-ADR-002-sqlalchemy-centric-adapter.md +33 -0
  72. azure_functions_db-0.1.0/docs/18-ADR-003-blob-checkpoint-mvp.md +28 -0
  73. azure_functions_db-0.1.0/docs/19-ADR-004-at-least-once-default.md +24 -0
  74. azure_functions_db-0.1.0/docs/20-open-issues.md +33 -0
  75. azure_functions_db-0.1.0/docs/21-dev-checklist.md +81 -0
  76. azure_functions_db-0.1.0/docs/22-binding-semantics.md +138 -0
  77. azure_functions_db-0.1.0/docs/23-ADR-005-unified-package-design.md +69 -0
  78. azure_functions_db-0.1.0/docs/99-references.md +58 -0
  79. azure_functions_db-0.1.0/docs/api.md +7 -0
  80. azure_functions_db-0.1.0/docs/changelog.md +60 -0
  81. azure_functions_db-0.1.0/docs/contributing.md +86 -0
  82. azure_functions_db-0.1.0/docs/examples/client_injection.md +145 -0
  83. azure_functions_db-0.1.0/docs/examples/input_binding.md +81 -0
  84. azure_functions_db-0.1.0/docs/examples/output_binding.md +86 -0
  85. azure_functions_db-0.1.0/docs/examples/trigger.md +95 -0
  86. azure_functions_db-0.1.0/docs/examples/trigger_with_binding.md +124 -0
  87. azure_functions_db-0.1.0/docs/faq.md +93 -0
  88. azure_functions_db-0.1.0/docs/getting-started.md +195 -0
  89. azure_functions_db-0.1.0/docs/index.md +32 -0
  90. azure_functions_db-0.1.0/docs/installation.md +124 -0
  91. azure_functions_db-0.1.0/docs/release_process.md +160 -0
  92. azure_functions_db-0.1.0/docs/security.md +94 -0
  93. azure_functions_db-0.1.0/docs/testing.md +116 -0
  94. azure_functions_db-0.1.0/docs/troubleshooting.md +113 -0
  95. azure_functions_db-0.1.0/examples/function_app.py +39 -0
  96. azure_functions_db-0.1.0/examples/host.json +14 -0
  97. azure_functions_db-0.1.0/examples/local.settings.sample.json +8 -0
  98. azure_functions_db-0.1.0/examples/poll_orders/function_app.py +48 -0
  99. azure_functions_db-0.1.0/examples/pyproject.toml +21 -0
  100. azure_functions_db-0.1.0/examples/requirements.txt +6 -0
  101. azure_functions_db-0.1.0/examples/trigger_with_binding/function_app.py +106 -0
  102. azure_functions_db-0.1.0/examples/usage_postgres.py +27 -0
  103. azure_functions_db-0.1.0/mkdocs.yml +77 -0
  104. azure_functions_db-0.1.0/pyproject.toml +141 -0
  105. azure_functions_db-0.1.0/schemas/event.schema.json +52 -0
  106. azure_functions_db-0.1.0/schemas/poller-config.schema.json +100 -0
  107. azure_functions_db-0.1.0/tests/__init__.py +0 -0
  108. azure_functions_db-0.1.0/tests/test_adapter_sqlalchemy.py +493 -0
  109. azure_functions_db-0.1.0/tests/test_binding_integration.py +531 -0
  110. azure_functions_db-0.1.0/tests/test_binding_reader.py +428 -0
  111. azure_functions_db-0.1.0/tests/test_binding_writer.py +535 -0
  112. azure_functions_db-0.1.0/tests/test_core_errors.py +34 -0
  113. azure_functions_db-0.1.0/tests/test_core_types.py +45 -0
  114. azure_functions_db-0.1.0/tests/test_decorator.py +1349 -0
  115. azure_functions_db-0.1.0/tests/test_hardening.py +374 -0
  116. azure_functions_db-0.1.0/tests/test_normalizers.py +133 -0
  117. azure_functions_db-0.1.0/tests/test_observability.py +149 -0
  118. azure_functions_db-0.1.0/tests/test_poll_trigger.py +338 -0
  119. azure_functions_db-0.1.0/tests/test_public_api.py +98 -0
  120. azure_functions_db-0.1.0/tests/test_shared_core.py +284 -0
  121. azure_functions_db-0.1.0/tests/test_state_blob.py +761 -0
  122. azure_functions_db-0.1.0/tests/test_state_errors.py +33 -0
  123. azure_functions_db-0.1.0/tests/test_trigger_errors.py +40 -0
  124. azure_functions_db-0.1.0/tests/test_trigger_events.py +98 -0
  125. azure_functions_db-0.1.0/tests/test_trigger_retry.py +59 -0
  126. azure_functions_db-0.1.0/tests/test_trigger_runner.py +986 -0
@@ -0,0 +1,12 @@
1
+ # This file sets code formatting rules that are respected by many editors and IDEs
2
+ # It helps maintain consistent coding style across different environments
3
+
4
+ root = true
5
+
6
+ [*]
7
+ charset = utf-8 # Use UTF-8 encoding for all files
8
+ end_of_line = lf # Use LF (Unix-style) line endings
9
+ indent_style = space # Use spaces instead of tabs
10
+ indent_size = 4 # Indent with 4 spaces
11
+ trim_trailing_whitespace = true # Remove any whitespace characters at the end of lines
12
+ insert_final_newline = true # Ensure every file ends with a newline
@@ -0,0 +1,69 @@
1
+ name: Bug Report
2
+ description: Report a bug or unexpected behavior
3
+ title: "[Bug]: "
4
+ labels: ["bug"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thanks for taking the time to report a bug!
10
+
11
+ - type: textarea
12
+ id: problem
13
+ attributes:
14
+ label: Problem
15
+ description: A clear description of the bug
16
+ placeholder: What happened? What did you expect to happen?
17
+ validations:
18
+ required: true
19
+
20
+ - type: textarea
21
+ id: current-state
22
+ attributes:
23
+ label: Current State
24
+ description: Describe the current behavior and any relevant context
25
+ placeholder: |
26
+ - What is happening now?
27
+ - Any error messages or logs?
28
+ validations:
29
+ required: true
30
+
31
+ - type: textarea
32
+ id: steps-to-reproduce
33
+ attributes:
34
+ label: Steps to Reproduce
35
+ description: How can we reproduce this issue?
36
+ placeholder: |
37
+ 1. Install package...
38
+ 2. Run command...
39
+ 3. See error...
40
+ validations:
41
+ required: true
42
+
43
+ - type: textarea
44
+ id: expected-outcome
45
+ attributes:
46
+ label: Expected Outcome
47
+ description: What should happen instead?
48
+ validations:
49
+ required: true
50
+
51
+ - type: textarea
52
+ id: environment
53
+ attributes:
54
+ label: Environment
55
+ description: Your environment details
56
+ placeholder: |
57
+ - Python version:
58
+ - Package version:
59
+ - OS:
60
+ validations:
61
+ required: false
62
+
63
+ - type: textarea
64
+ id: references
65
+ attributes:
66
+ label: References
67
+ description: Any related files, links, or resources
68
+ validations:
69
+ required: false
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Security Advisories
4
+ url: https://github.com/yeongseon/azure-functions-dbtrigger/security/advisories/new
5
+ about: Report security issues privately via GitHub Security Advisories
@@ -0,0 +1,65 @@
1
+ name: Feature Request
2
+ description: Suggest a new feature or enhancement
3
+ title: "[Feature]: "
4
+ labels: ["enhancement"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thanks for suggesting a feature!
10
+
11
+ - type: textarea
12
+ id: problem
13
+ attributes:
14
+ label: Problem
15
+ description: What problem does this feature solve?
16
+ placeholder: Describe the problem or limitation you're facing
17
+ validations:
18
+ required: true
19
+
20
+ - type: textarea
21
+ id: current-state
22
+ attributes:
23
+ label: Current State
24
+ description: How does the project currently handle this (if at all)?
25
+ placeholder: |
26
+ - Current behavior
27
+ - Current limitations
28
+ validations:
29
+ required: false
30
+
31
+ - type: textarea
32
+ id: proposed-solution
33
+ attributes:
34
+ label: Proposed Solution
35
+ description: How would you like this to work?
36
+ placeholder: Describe your ideal solution
37
+ validations:
38
+ required: true
39
+
40
+ - type: textarea
41
+ id: tasks
42
+ attributes:
43
+ label: Tasks
44
+ description: Break down the implementation into tasks (if known)
45
+ placeholder: |
46
+ - [ ] Task 1
47
+ - [ ] Task 2
48
+ validations:
49
+ required: false
50
+
51
+ - type: textarea
52
+ id: expected-outcome
53
+ attributes:
54
+ label: Expected Outcome
55
+ description: What should be the end result?
56
+ validations:
57
+ required: true
58
+
59
+ - type: textarea
60
+ id: references
61
+ attributes:
62
+ label: References
63
+ description: Any related files, links, documentation, or examples
64
+ validations:
65
+ required: false
@@ -0,0 +1,56 @@
1
+ name: Task
2
+ description: A general task or chore (refactoring, maintenance, etc.)
3
+ title: "[Task]: "
4
+ labels: ["chore"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Use this template for maintenance tasks, refactoring, or other chores.
10
+
11
+ - type: textarea
12
+ id: problem
13
+ attributes:
14
+ label: Problem
15
+ description: Why is this task needed?
16
+ placeholder: Describe the motivation for this task
17
+ validations:
18
+ required: true
19
+
20
+ - type: textarea
21
+ id: current-state
22
+ attributes:
23
+ label: Current State
24
+ description: What is the current situation?
25
+ placeholder: |
26
+ - Current code/config state
27
+ - Any issues or limitations
28
+ validations:
29
+ required: true
30
+
31
+ - type: textarea
32
+ id: tasks
33
+ attributes:
34
+ label: Tasks
35
+ description: Break down the work into actionable items
36
+ placeholder: |
37
+ - [ ] Task 1
38
+ - [ ] Task 2
39
+ validations:
40
+ required: true
41
+
42
+ - type: textarea
43
+ id: expected-outcome
44
+ attributes:
45
+ label: Expected Outcome
46
+ description: What should be the result when this is complete?
47
+ validations:
48
+ required: true
49
+
50
+ - type: textarea
51
+ id: references
52
+ attributes:
53
+ label: References
54
+ description: Any related files, documentation, or resources
55
+ validations:
56
+ required: false
@@ -0,0 +1,33 @@
1
+ ## Summary
2
+
3
+ <!-- Brief description of changes -->
4
+
5
+ ## Changes
6
+
7
+ <!-- List the specific changes made -->
8
+
9
+ -
10
+
11
+ ## Type of Change
12
+
13
+ <!-- Check the relevant option -->
14
+
15
+ - [ ] Bug fix (non-breaking change that fixes an issue)
16
+ - [ ] New feature (non-breaking change that adds functionality)
17
+ - [ ] Breaking change (fix or feature that would cause existing functionality to change)
18
+ - [ ] Documentation update
19
+ - [ ] Refactoring (no functional changes)
20
+ - [ ] Chore (maintenance, dependencies, CI, etc.)
21
+
22
+ ## Checklist
23
+
24
+ - [ ] My code follows the project's code style
25
+ - [ ] I have run `make check` (lint + typecheck)
26
+ - [ ] I have run `make test` and all tests pass
27
+ - [ ] I have added tests for new functionality (if applicable)
28
+ - [ ] I have updated documentation (if applicable)
29
+ - [ ] My changes do not introduce new warnings
30
+
31
+ ## Related Issues
32
+
33
+ <!-- Link to related issues: Closes #123, Fixes #456 -->
@@ -0,0 +1,22 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "pip"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ commit-message:
8
+ prefix: "chore(deps)"
9
+ labels:
10
+ - "dependencies"
11
+ open-pull-requests-limit: 10
12
+
13
+ - package-ecosystem: "github-actions"
14
+ directory: "/"
15
+ schedule:
16
+ interval: "weekly"
17
+ commit-message:
18
+ prefix: "chore(deps)"
19
+ labels:
20
+ - "dependencies"
21
+ - "github-actions"
22
+ open-pull-requests-limit: 10
@@ -0,0 +1,47 @@
1
+ - name: "dependencies"
2
+ color: "0075ca"
3
+ description: "Pull requests that update a dependency file"
4
+
5
+ - name: "github-actions"
6
+ color: "e4e669"
7
+ description: "Pull requests that update GitHub Actions"
8
+
9
+ - name: "bug"
10
+ color: "d73a4a"
11
+ description: "Something isn't working"
12
+
13
+ - name: "enhancement"
14
+ color: "a2eeef"
15
+ description: "New feature or request"
16
+
17
+ - name: "documentation"
18
+ color: "0075ca"
19
+ description: "Improvements or additions to documentation"
20
+
21
+ - name: "question"
22
+ color: "d876e3"
23
+ description: "Further information is requested"
24
+
25
+ - name: "good first issue"
26
+ color: "7057ff"
27
+ description: "Good for newcomers"
28
+
29
+ - name: "help wanted"
30
+ color: "008672"
31
+ description: "Extra attention is needed"
32
+
33
+ - name: "security"
34
+ color: "e11d48"
35
+ description: "Security-related issue or pull request"
36
+
37
+ - name: "duplicate"
38
+ color: "cfd3d7"
39
+ description: "This issue or pull request already exists"
40
+
41
+ - name: "wontfix"
42
+ color: "ffffff"
43
+ description: "This will not be worked on"
44
+
45
+ - name: "invalid"
46
+ color: "e4e669"
47
+ description: "This doesn't seem right"
@@ -0,0 +1,69 @@
1
+ name: Test and Coverage
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, synchronize, reopened]
6
+ push:
7
+ branches: [main, develop]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ matrix:
17
+ python-version: ["3.11", "3.12", "3.13", "3.14"]
18
+
19
+ steps:
20
+ - name: Checkout code
21
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
22
+
23
+ - name: Set up Python ${{ matrix.python-version }}
24
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
25
+ with:
26
+ python-version: ${{ matrix.python-version }}
27
+
28
+ - name: Install Hatch and dependencies via Makefile
29
+ run: |
30
+ pip install hatch
31
+ make install
32
+
33
+ - name: Run full quality checks
34
+ run: make check-all
35
+
36
+ - name: Verify coverage output
37
+ run: ls -lh coverage.xml
38
+
39
+ - name: Upload coverage to Codecov
40
+ if: matrix.python-version == '3.11' && github.actor != 'dependabot[bot]'
41
+ uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad
42
+ with:
43
+ token: ${{ secrets.CODECOV_TOKEN }}
44
+ files: ./coverage.xml
45
+ verbose: true
46
+ fail_ci_if_error: false
47
+ env:
48
+ CODECOV_RETRIES: 3
49
+
50
+ benchmark:
51
+ runs-on: ubuntu-latest
52
+ if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main'
53
+ continue-on-error: true
54
+ steps:
55
+ - name: Checkout code
56
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
57
+
58
+ - name: Set up Python 3.12
59
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
60
+ with:
61
+ python-version: "3.12"
62
+
63
+ - name: Install dependencies
64
+ run: |
65
+ pip install hatch
66
+ pip install -e ".[all]"
67
+
68
+ - name: Run catch-up benchmark
69
+ run: python benchmarks/bench_catchup.py
@@ -0,0 +1,26 @@
1
+ name: Create GitHub Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ permissions:
9
+ contents: write
10
+
11
+ jobs:
12
+ create-release:
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - name: Checkout repository
17
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
18
+
19
+ - name: Create GitHub Release
20
+ uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2
21
+ with:
22
+ tag_name: ${{ github.ref_name }}
23
+ name: ${{ github.ref_name }}
24
+ generate_release_notes: true
25
+ draft: false
26
+ prerelease: false
@@ -0,0 +1,34 @@
1
+ name: Deploy MkDocs to GitHub Pages
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: write
11
+
12
+ jobs:
13
+ deploy:
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - name: Checkout repository
18
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
19
+
20
+ - name: Set up Python
21
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
22
+ with:
23
+ python-version: "3.11"
24
+
25
+ - name: Install Hatch and docs dependencies
26
+ run: |
27
+ pip install hatch
28
+ make install
29
+
30
+ - name: Build docs (verify build before deploy)
31
+ run: hatch run mkdocs build --strict
32
+
33
+ - name: Deploy to GitHub Pages
34
+ run: hatch run mkdocs gh-deploy --force
@@ -0,0 +1,56 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+ workflow_dispatch:
8
+ inputs:
9
+ tag:
10
+ description: Git tag to publish (for example v0.1.0)
11
+ required: true
12
+ type: string
13
+
14
+ permissions:
15
+ contents: read
16
+ id-token: write
17
+
18
+ jobs:
19
+ build-and-publish:
20
+ runs-on: ubuntu-latest
21
+ environment: pypi
22
+
23
+ steps:
24
+ - name: Checkout repository
25
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
26
+ with:
27
+ ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }}
28
+
29
+ - name: Set up Python
30
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
31
+ with:
32
+ python-version: "3.12"
33
+
34
+ - name: Install build dependencies
35
+ run: |
36
+ python -m pip install --upgrade pip
37
+ pip install build
38
+
39
+ - name: Check if tag matches __version__
40
+ run: |
41
+ TAG_NAME="${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}"
42
+ VERSION_FROM_FILE=$(grep -Po '(?<=__version__ = ")[^"]*' src/azure_functions_db/__init__.py)
43
+ TAG_VERSION=${TAG_NAME#v}
44
+ echo "Version from file: $VERSION_FROM_FILE"
45
+ echo "Tag name: $TAG_NAME"
46
+ echo "Version from tag: $TAG_VERSION"
47
+ if [ "$VERSION_FROM_FILE" != "$TAG_VERSION" ]; then
48
+ echo "::error ::Version in __init__.py ($VERSION_FROM_FILE) does not match git tag ($TAG_VERSION)"
49
+ exit 1
50
+ fi
51
+
52
+ - name: Build distribution packages
53
+ run: python -m build
54
+
55
+ - name: Publish to PyPI
56
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,33 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.so
5
+
6
+ # Virtual environments
7
+ .venv/
8
+ venv/
9
+ env/
10
+
11
+ # Tool caches
12
+ .pytest_cache/
13
+ .mypy_cache/
14
+ .ruff_cache/
15
+ .coverage
16
+ coverage.xml
17
+ htmlcov/
18
+
19
+ # Build artifacts
20
+ build/
21
+ dist/
22
+ *.egg-info/
23
+
24
+ # IDE
25
+ .vscode/
26
+ .idea/
27
+
28
+ # Docs
29
+ site/
30
+
31
+ # Review
32
+ .venv-review/
33
+ .venv-review-cli/
@@ -0,0 +1,29 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.15.6
4
+ hooks:
5
+ - id: ruff-format
6
+ - id: ruff
7
+ args: ["--fix"]
8
+
9
+ - repo: https://github.com/pre-commit/mirrors-mypy
10
+ rev: v1.19.1
11
+ hooks:
12
+ - id: mypy
13
+ language: python
14
+ files: "^src/"
15
+ pass_filenames: false
16
+ args:
17
+ [
18
+ "--config-file=pyproject.toml",
19
+ "--install-types",
20
+ "--non-interactive"
21
+ ]
22
+
23
+ - repo: https://github.com/PyCQA/bandit
24
+ rev: 1.9.4
25
+ hooks:
26
+ - id: bandit
27
+ args: ["-c", "pyproject.toml"]
28
+ additional_dependencies: ["bandit[toml]"]
29
+ files: "^src/"
@@ -0,0 +1,40 @@
1
+ # AGENTS.md
2
+
3
+ ## Purpose
4
+ `azure-functions-db` provides pseudo DB trigger functionality for Azure Functions Python v2 applications using SQLAlchemy.
5
+
6
+ ## Read First
7
+ - `README.md`
8
+ - `CONTRIBUTING.md`
9
+ - `docs/02-architecture.md`
10
+ - `docs/03-semantics.md`
11
+
12
+ ## Working Rules
13
+ - Preserve the package's Python compatibility and public API behavior unless the change explicitly updates the contract.
14
+ - Keep documentation, examples, and tests synchronized.
15
+ - Semantics changes require ADR or design note.
16
+ - Never suppress type errors.
17
+ - Guarantee claims must be honest (pseudo trigger, at-least-once).
18
+
19
+ ## Validation
20
+ - `make test`
21
+ - `make lint`
22
+ - `make typecheck`
23
+ - `make build`
24
+
25
+ ## Release Process
26
+ - Version is managed via `hatch` (dynamic from `src/azure_functions_db/__init__.py`).
27
+ - **Do NOT manually edit version strings.** Use the Makefile targets below.
28
+ - When bumping version, update `tests/test_public_api.py` to match the new version string.
29
+
30
+ ### Commands
31
+ - `make release-patch` — bump patch version, update changelog, tag, and push
32
+ - `make release-minor` — bump minor version, update changelog, tag, and push
33
+ - `make release-major` — bump major version, update changelog, tag, and push
34
+ - `make release VERSION=x.y.z` — set explicit version, update changelog, tag, and push
35
+ - `make tag-release VERSION=x.y.z` — create and push an annotated tag (used internally by release targets)
36
+
37
+ ### Flow
38
+ 1. `make release-patch` (or `-minor` / `-major`) on `main`
39
+ 2. This runs: `hatch version` → `git commit` → `make changelog` → `git commit` → `git tag` → `git push`
40
+ 3. Tag push triggers **Publish to PyPI** GitHub Actions workflow automatically.
@@ -0,0 +1,42 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ### Bug Fixes
6
+
7
+ - *(docs)* Replace relative parent links with GitHub URLs for strict mkdocs (#29)
8
+ - Add kw_only=True to RetryPolicy and create mkdocs.yml for docs workflow (#28)
9
+
10
+ ### Documentation
11
+
12
+ - Align documentation structure with sibling repos
13
+ - Update branding, reorder README, add lifecycle/thread-safety docs (#48)
14
+
15
+ ### Features
16
+
17
+ - Partial env var substitution, engine_kwargs passthrough (#49)
18
+ - Add OutputResult, async docs, decorator composition validation (#47)
19
+ - Pydantic model mapping, async proxy, cursor index warning (#32)
20
+ - *(decorator)* Redesign db_input/db_output to data injection bindings (#31)
21
+ - *(decorator)* Redesign API to DbFunctionApp with db_trigger, db_input, db_output (#30)
22
+ - *(binding)* Trigger+binding integration tests and example (Phase 11)
23
+ - *(binding)* Implement DbWriter output binding (Phase 10) (#26)
24
+ - *(binding)* Implement DbReader input binding (Phase 9) (#25)
25
+ - *(core)* Phase 8 — extract shared core (DbConfig, EngineProvider, serializers, types) (#24)
26
+ - *(hardening)* Phase 7 — crash recovery tests, benchmark, and duplicate docs (#23)
27
+ - *(observability)* Add MetricsCollector, structured logging, and lag calculation (#21)
28
+ - *(trigger)* Add PollTrigger, db.poll() decorator, and normalizers (#20)
29
+ - *(adapter)* Add SqlAlchemySource with cursor-based polling (#19)
30
+ - *(state)* Add BlobCheckpointStore with ETag-based CAS leasing (#18)
31
+ - Phase 1 - Core types, errors, trigger events, context, retry, and runner (#17)
32
+ - Initial project scaffold — unified DB integration framework for Azure Functions Python v2
33
+
34
+ ### Miscellaneous Tasks
35
+
36
+ - *(release)* Phase 6 release prep (#22)
37
+ - Translate docs to English and align README with series style (#16)
38
+
39
+ ### Refactor
40
+
41
+ - Rename DbFunctionApp to DbBindings, drop db_ method prefix, narrow exports (#46)
42
+ <!-- generated by git-cliff -->