oe-python-template-example 0.1.16__tar.gz → 0.1.18__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 (96) hide show
  1. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/.copier-answers.yml +1 -1
  2. oe_python_template_example-0.1.18/.github/copilot-instructions.md +5 -0
  3. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/.vscode/settings.json +14 -8
  4. oe_python_template_example-0.1.18/CODE_STYLE.md +287 -0
  5. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/CONTRIBUTING.md +2 -0
  6. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/PKG-INFO +10 -4
  7. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/README.md +9 -3
  8. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/SECURITY.md +8 -0
  9. oe_python_template_example-0.1.18/VERSION +1 -0
  10. oe_python_template_example-0.1.16/_readme_main.md → oe_python_template_example-0.1.18/docs/partials/README_main.md +6 -3
  11. oe_python_template_example-0.1.18/docs/source/code-style.rst +1 -0
  12. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/docs/source/conf.py +1 -1
  13. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/docs/source/index.rst +2 -1
  14. oe_python_template_example-0.1.18/docs/source/main.rst +2 -0
  15. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/noxfile.py +5 -4
  16. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/pyproject.toml +2 -2
  17. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/sonar-project.properties +1 -1
  18. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/uv.lock +1 -1
  19. oe_python_template_example-0.1.16/VERSION +0 -1
  20. oe_python_template_example-0.1.16/docs/source/main.rst +0 -2
  21. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/.act-env-public +0 -0
  22. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/.devcontainer/Dockerfile +0 -0
  23. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/.devcontainer/devcontainer.json +0 -0
  24. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/.devcontainer/onCreateCommand +0 -0
  25. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/.devcontainer/postAttachCommand +0 -0
  26. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/.devcontainer/postCreateCommand +0 -0
  27. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/.env.example +0 -0
  28. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/.github/dependabot.yml +0 -0
  29. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/.github/workflows/codeql.yml +0 -0
  30. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/.github/workflows/docker-image-build-publish.yml +0 -0
  31. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/.github/workflows/package-build-publish-release.yml +0 -0
  32. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/.github/workflows/test-and-report.yml +0 -0
  33. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/.gitignore +0 -0
  34. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/.pre-commit-config.yaml +0 -0
  35. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/.python-version +0 -0
  36. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/.readthedocs.yml +0 -0
  37. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/.secrets.baseline +0 -0
  38. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/.vscode/extensions.json +0 -0
  39. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/CHANGELOG.md +0 -0
  40. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/CODEOWNERS +0 -0
  41. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/Dockerfile +0 -0
  42. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/LICENSE +0 -0
  43. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/RELEASE_NOTES.md +0 -0
  44. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/SERVICE_CONNECTIONS.md +0 -0
  45. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/bin/git-cliff +0 -0
  46. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/codecov.yml +0 -0
  47. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/compose.yaml +0 -0
  48. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/docs/Makefile +0 -0
  49. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/docs/make.bat +0 -0
  50. /oe_python_template_example-0.1.16/_readme_footer.md → /oe_python_template_example-0.1.18/docs/partials/README_footer.md +0 -0
  51. /oe_python_template_example-0.1.16/_readme_header.md → /oe_python_template_example-0.1.18/docs/partials/README_header.md +0 -0
  52. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/docs/source/_static/.keep +0 -0
  53. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/docs/source/_static/openapi.json +0 -0
  54. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/docs/source/_static/openapi.yaml +0 -0
  55. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/docs/source/_static/openapi_v1.json +0 -0
  56. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/docs/source/_static/openapi_v1.yaml +0 -0
  57. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/docs/source/_static/openapi_v2.json +0 -0
  58. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/docs/source/_static/openapi_v2.yaml +0 -0
  59. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/docs/source/api_v1.rst +0 -0
  60. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/docs/source/api_v2.rst +0 -0
  61. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/docs/source/contributing.rst +0 -0
  62. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/docs/source/reference.rst +0 -0
  63. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/docs/source/release-notes.rst +0 -0
  64. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/docs/source/security.rst +0 -0
  65. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/examples/__init__.py +0 -0
  66. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/examples/notebook.ipynb +0 -0
  67. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/examples/notebook.py +0 -0
  68. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/examples/script.py +0 -0
  69. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/examples/streamlit.py +0 -0
  70. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/git-cliff-2.7.0/CHANGELOG.md +0 -0
  71. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/git-cliff-2.7.0/LICENSE-APACHE +0 -0
  72. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/git-cliff-2.7.0/LICENSE-MIT +0 -0
  73. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/git-cliff-2.7.0/README.md +0 -0
  74. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/git-cliff-2.7.0/completions/_git-cliff +0 -0
  75. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/git-cliff-2.7.0/completions/_git-cliff.ps1 +0 -0
  76. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/git-cliff-2.7.0/completions/git-cliff.bash +0 -0
  77. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/git-cliff-2.7.0/completions/git-cliff.elv +0 -0
  78. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/git-cliff-2.7.0/completions/git-cliff.fish +0 -0
  79. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/git-cliff-2.7.0/git-cliff-completions +0 -0
  80. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/git-cliff-2.7.0/git-cliff-mangen +0 -0
  81. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/git-cliff-2.7.0/man/git-cliff.1 +0 -0
  82. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/git-cliff-2.7.0-x86_64-unknown-linux-gnu.tar.gz +0 -0
  83. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/github-action-run +0 -0
  84. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/logo.png +0 -0
  85. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/n +0 -0
  86. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/renovate.json +0 -0
  87. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/reports/.keep +0 -0
  88. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/src/oe_python_template_example/__init__.py +0 -0
  89. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/src/oe_python_template_example/api.py +0 -0
  90. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/src/oe_python_template_example/cli.py +0 -0
  91. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/src/oe_python_template_example/constants.py +0 -0
  92. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/src/oe_python_template_example/service.py +0 -0
  93. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/tests/__init__.py +0 -0
  94. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/tests/api_test.py +0 -0
  95. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/tests/cli_test.py +0 -0
  96. {oe_python_template_example-0.1.16 → oe_python_template_example-0.1.18}/tests/fixtures/.keep +0 -0
@@ -1,4 +1,4 @@
1
- _commit: v0.5.11
1
+ _commit: v0.5.13
2
2
  _src_path: gh:helmut-hoffer-von-ankershoffen/oe-python-template
3
3
  author_email: helmuthva@gmail.com
4
4
  author_github_username: helmut-hoffer-von-ankershoffen
@@ -0,0 +1,5 @@
1
+ Always conform to the coding styles defined in CODE_STYLE.md in the root
2
+ directory of this repository when generating code.
3
+
4
+ Learn about tools to use in CONTRIBUTING.md in the root directory of this
5
+ repository.
@@ -1,4 +1,7 @@
1
1
  {
2
+ "[jsonc]": {
3
+ "editor.defaultFormatter": "vscode.json-language-features"
4
+ },
2
5
  "files.exclude": {
3
6
  "**/__pycache__ ": true
4
7
  },
@@ -48,20 +51,23 @@
48
51
  "markdown": true,
49
52
  "scminput": true
50
53
  },
51
- "github.copilot.advanced": {
52
-
53
- },
54
+ "github.copilot.advanced": {},
54
55
  "github.copilot.chat.editor.temporalContext.enabled": true,
55
56
  "github.copilot.chat.edits.codesearch.enabled": true,
56
57
  "github.copilot.chat.edits.temporalContext.enabled": true,
57
- "github.copilot.chat.languageContext.typescript.enabled": true,
58
- "github.copilot.chat.reviewSelection.instructions": [
59
-
60
-
58
+ "github.copilot.chat.codeGeneration.instructions": [
59
+ {
60
+ "file": "CODE_STYLE.md"
61
+ },
62
+ {
63
+ "file": "CONTRIBUTING.md"
64
+ }
61
65
  ],
62
- "github.copilot.chat.scopeSelection": true,
63
66
  "github.copilot.chat.completionContext.typescript.mode": "on",
64
67
  "github.copilot.chat.generateTests.codeLens": true,
68
+ "github.copilot.chat.languageContext.typescript.enabled": true,
69
+ "github.copilot.chat.reviewSelection.instructions": [],
70
+ "github.copilot.chat.scopeSelection": true,
65
71
  "github.copilot.chat.search.semanticTextResults": true,
66
72
  "sonarlint.connectedMode.project": {
67
73
  "connectionId": "helmut-hoffer-von-ankershoffen",
@@ -0,0 +1,287 @@
1
+ # Code Style
2
+
3
+ Author: Helmut Hoffer von Ankershoffen (@helmut-hoffer-von-ankershoffen )
4
+ Status: Draft
5
+ Created: 2025-03-16
6
+ Updated: 2025-03-16
7
+
8
+ This document describes the code style used in
9
+ [oe-python-templat](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template)
10
+ and derivatives. It defines strict requirements to be followed by all
11
+ contributors - humans and agents - to ensure consistency and readability across
12
+ the codebase.
13
+
14
+ ## Code
15
+
16
+ We favor readability and maintainability over cleverness and brevity.
17
+
18
+ - We always write code that is easy to read, understand, maintain, test,
19
+ document, deploy, use, integrate, and extend.
20
+ - We always write code that is efficient and performant, but only if it does not
21
+ sacrifice readability, maintainability, and testability.
22
+ - We always write code that is secure and does not introduce vulnerabilities.
23
+ - We always write code that is portable and does not introduce platform-specific
24
+ dependencies.
25
+ - We always write code that is compatible with the Python version indicated in
26
+ the .python-version file in the root of this repository.
27
+
28
+ # Naming
29
+
30
+ We believe that good names are essential for code readability and
31
+ maintainability. A good name is one that is descriptive, unambiguous, and
32
+ meaningful. It should convey the purpose and intent of the code it represents.
33
+
34
+ - We take extra care to find proper names for all identifiers, including
35
+ variables, functions, classes, types, tests, modules, and packages. We prefer
36
+ descriptive names that clearly indicate the purpose and functionality of the
37
+ code.
38
+ - We avoid using abbreviations, acronyms, and jargon unless they are widely
39
+ understood and accepted in the context of the code. We prefer full words and
40
+ phrases that are easy to understand.
41
+ - We avoid using single-letter names, except for loop variables and iterators.
42
+ - We avoid using generic names like `data`, `info`, `temp`, `foo`, `bar`, etc.
43
+ These names do not convey any meaning and make the code harder to read and
44
+ understand.
45
+ - We avoid using names that are too long or too short. A good name should be
46
+ concise but descriptive. It should be long enough to convey the purpose and
47
+ intent of the code, but not so long that it becomes cumbersome to read and
48
+ write.
49
+ - We avoid using names that are too similar or too different. A good name should
50
+ be unique and distinct. It should not be confused with other names in the
51
+ code. It should not be so different that it becomes hard to remember and
52
+ recognize.
53
+
54
+ ## Formatting
55
+
56
+ We use [ruff](https://github.com/astral-sh/ruff) to format Python code
57
+
58
+ - The ruff formatter adheres to the
59
+ [Black](https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html)
60
+ code style which is [PEP 8](https://www.python.org/dev/peps/pep-0008/)
61
+ compliant.
62
+ - The ruff formatter is configured to use a max line length of 120.
63
+ - The ruff formatter is called by the lint session of nox.
64
+
65
+ Beyond PEP 8 we adhere to the following naming conventions: We use the following
66
+ conventions for Python code:
67
+
68
+ - Class names: `PascalCase` - descriptive nouns that clearly indicate purpose.
69
+ - Function/method names: `snake_case` - verb phrases that describe actions.
70
+ - Variables/attributes: `snake_case` - descriptive nouns/noun phrases.
71
+ - Constants: `UPPER_SNAKE_CASE`.
72
+ - Private members: Prefix with single underscore `_private_attribute`.
73
+ - "True" private members: Prefix with double underscore `__truly_private`.
74
+ - Type variables: `CamelCase` with short, descriptive names (e.g., `T`, `KT`,
75
+ `VT`).
76
+ - Boolean variables/functions: Prefix with `is_`, `has_`, `should_`, etc.
77
+ - Interface classes: Suffix with `Interface` or `Protocol`.
78
+
79
+ ## Linting and type checking
80
+
81
+ We use [ruff](https://github.com/astral-sh/ruff) to lint Python code
82
+
83
+ - All linting rules are enabled except those explicitly disabled in
84
+ pyproject.toml
85
+ - The ruff linter is called by the lint session of nox.
86
+
87
+ We use [mypy](https://mypy.readthedocs.io/) for static type checking of Python
88
+ code.
89
+
90
+ - mypy is configured to use the `strict` mode in pyproject.toml
91
+ - mypy is called by the lint session of nox.
92
+
93
+ ## Documentation
94
+
95
+ We use docstrings to document the purpose of modules, classes, types, functions,
96
+ its parameters and returns
97
+
98
+ - We use Google style docstrings with typed Args and Returns.
99
+ - We comment complex code and algorithms to explain their purpose and
100
+ functionality.
101
+ - We leave references with deep links in code to external documentation,
102
+ standards, and specifications.
103
+
104
+ We provide an auto-generated OpenAPI specification and reference documentation.
105
+
106
+ We generate the final documentation using Sphinx and publish it to readthedocs.
107
+
108
+ - Generation of documentation is called by the docs session of nox
109
+
110
+ ## Testing
111
+
112
+ We use [pytest](https://docs.pytest.org/en/stable/) for testing Python code.
113
+
114
+ - Tests are defined in the `tests/` directory
115
+ - We use pytest fixtures to set up test data and state
116
+ - We leverage several pytest plugins:
117
+ - `pytest-asyncio` for testing async code
118
+ - `pytest-cov` for coverage reporting
119
+ - `pytest-docker` for integration tests with containers
120
+ - `pytest-env` for environment variable management
121
+ - `pytest-regressions` for regression testing
122
+ - `pytest-xdist` for parallel test execution
123
+ - Test execution is automated through the nox test session which runs across the
124
+ Python versions indicated in the `pyproject.toml`.
125
+
126
+ Our test coverage is measured using `pytest-cov` and reported in the CI
127
+ pipeline.
128
+
129
+ - We aim for 100% unit coverage on all code paths, including error handling and
130
+ edge cases.
131
+ - We fail the CI if unit test coverage drops below 85%.
132
+
133
+ Apart from unit tests we provide integration tests and end-to-end tests:
134
+
135
+ - We smoke test as part of the CI/CD pipeline.
136
+ - We facilitate exploratory testing to ensure comprehensive coverage.
137
+ - We use `pytest-docker` for integration tests with containers.
138
+
139
+ ## Error Handling
140
+
141
+ We use structured, explicit error handling that enables effective debugging and
142
+ monitoring:
143
+
144
+ - Use specific exception classes instead of generic ones.
145
+ - Include contextual information in exception messages.
146
+ - Log exceptions with appropriate severity levels and context.
147
+ - Gracefully degrade functionality when possible rather than failing completely.
148
+ - Use type hints to catch type errors at compile time rather than runtime.
149
+ - Design errors to be actionable for both users and developers.
150
+
151
+ ## Logging
152
+
153
+ We log information to help with debugging and monitoring:
154
+
155
+ - Use structured logging with consistent fields across all log entries.
156
+ - Include correlation IDs for tracking requests across components.
157
+ - Log at appropriate levels (DEBUG, INFO, WARNING, ERROR, CRITICAL).
158
+ - Be mindful of PII and sensitive data in logs, using obfuscation where needed.
159
+ - Consider log volume and performance impact in production environments.
160
+
161
+ ## Performance Considerations
162
+
163
+ We consider performance from the early design stage, not as an afterthought:
164
+
165
+ - Consider algorithmic complexity (Big O notation) for all operations.
166
+ - Prefer lazy evaluation when dealing with large datasets.
167
+ - Use appropriate data structures for specific access patterns.
168
+ - Be mindful of memory usage, especially for long-running processes.
169
+ - Consider profiling for critical paths and potential bottlenecks.
170
+ - Document performance characteristics and assumptions.
171
+ - Write benchmarks for performance-critical code.
172
+ - Design for horizontal scaling from the beginning.
173
+ - Use asynchronous operations appropriately for I/O-bound tasks.
174
+ - Consider caching strategies when appropriate.
175
+
176
+ ## API Design
177
+
178
+ For both internal and external APIs we follow the principle of least surprise.
179
+
180
+ - We maintain backward compatibility whenever possible. If not possible we add a
181
+ new major version of the API.
182
+ - Implement proper versioning for breaking changes.
183
+ - Document error conditions, return values, and side effects.
184
+ - Design for testability and mockability.
185
+ - Provide sensible defaults while allowing for configuration.
186
+ - Follow RESTful principles for HTTP APIs.
187
+ - Use consistent parameter ordering and naming.
188
+ - Implement proper validation with helpful error messages.
189
+ - Consider rate limiting and circuit breaking for external services.
190
+
191
+ ## Security
192
+
193
+ We prioritize security at every stage of development to prevent vulnerabilities
194
+ and protect our users.
195
+
196
+ - Follow the principle of least privilege for all operations and access
197
+ controls.
198
+ - Never store secrets (API keys, passwords, tokens) in code repositories.
199
+ - Use environment variables or dedicated secret management services.
200
+ - Code is checked via `detect-secrets` pre-commit hook to prevent accidental
201
+ commits of secrets.
202
+
203
+ We implement proper input validation and sanitization for all external inputs
204
+ via [pydantic](https://pydantic-docs.helpmanual.io/):
205
+
206
+ - Validate inputs as early as possible in the data flow.
207
+
208
+ We handle authentication and authorization correctly:
209
+
210
+ - Use industry-standard authentication protocols (OAuth, JWT).
211
+ - Separate authentication from authorization logic.
212
+ - Implement proper session management with secure cookies.
213
+ - Protect against common vulnerabilities:
214
+ - SQL Injection: Use parameterized queries or ORM frameworks.
215
+ - XSS: Apply proper output encoding.
216
+ - CSRF: Implement anti-CSRF tokens for state-changing operations.
217
+ - SSRF: Validate and restrict URL destinations.
218
+ - Command Injection: Avoid direct system command execution where possible.
219
+ - Implement proper error handling that doesn't leak sensitive information.
220
+ - Use secure defaults and fail closed (secure) rather than open (insecure).
221
+
222
+ We apply the principle of defense in depth:
223
+
224
+ - Don't rely on a single security control.
225
+ - Implement multiple layers of protection.
226
+ - Document security considerations in code and design documents.
227
+ - Write security-focused tests:
228
+ - Test for security property violations.
229
+ - Test error cases and edge conditions.
230
+ - Test for resource exhaustion scenarios.
231
+ - Apply proper rate limiting and throttling to prevent abuse.
232
+ - For cryptographic operations:
233
+ - Use established libraries, not custom implementations.
234
+ - Follow current best practices for algorithm selection and key management.
235
+ - Be aware of the limitations of cryptographic primitives.
236
+ - Regularly run security-focused static analysis tools as part of CI/CD:
237
+ - CodeQL analysis (via GitHub Actions)
238
+ - SonarCloud checks for security vulnerabilities
239
+
240
+ Our security posture is defined in [SECURITY.md](SECURITY.md).
241
+
242
+ ## Dependency Management
243
+
244
+ We use modern dependency management practices:
245
+
246
+ - [uv](https://github.com/astral-sh/uv) for fast, reliable package installation
247
+ and environment management
248
+ - Dependency version locking via uv.lock file
249
+ - Regular dependency auditing:
250
+ - Security auditing via `pip-audit`
251
+ - License compliance checks via `pip-licenses`
252
+ - SBOM generation via `cyclonedx-py`
253
+
254
+ Dependency updates are automated via Dependabot and Renovate to ensure we stay
255
+ current with security patches.
256
+
257
+ ## Versioning
258
+
259
+ We use [semantic versioning](https://semver.org/) for versioning our releases:
260
+
261
+ - MAJOR: Breaking changes
262
+ - MINOR: New features, non-breaking changes
263
+ - PATCH: Bug fixes, non-breaking changes
264
+
265
+ Our API versioning follows the same principles, with major versions indicated in
266
+ the URL (e.g., /api/v1/resource) and the full version provided as part of the
267
+ OpenAPI pecification.
268
+
269
+ ## Conventional Commits
270
+
271
+ Our commit messages follow conventional commits format.
272
+
273
+ - We use 'feat','fix','chore','docs','style','refactor','test' prefixes and
274
+ components in parentheses. E.g.
275
+ `feat(api): add new endpoint for user registration`.
276
+
277
+ ## Guidance for AI Pair Programming
278
+
279
+ When generating code with AI assistance:
280
+
281
+ - AI-generated code must follow all style guidelines in this document.
282
+ - Always review AI-generated code for correctness, security implications, and
283
+ adherence to project patterns.
284
+ - Use AI to generate tests alongside implementation code.
285
+ - Request explanations for complex algorithms or patterns in the generated code.
286
+ - Remember that AI should augment, not replace, human judgment about code
287
+ quality and design decisions.
@@ -139,6 +139,8 @@ uv run nox -s update_from_template
139
139
 
140
140
  ## Pull Request Guidelines
141
141
 
142
+ - Before starting to write code read the [code style guide](CODE_STYLE.md) document for mandatory coding style
143
+ guidelines.
142
144
  - **Pre-Commit Hooks:** We use pre-commit hooks to ensure code quality. Please install the pre-commit hooks by running `uv run pre-commit install`. This ensure all tests, linting etc. pass locally before you can commit.
143
145
  - **Squash Commits:** Before submitting a pull request, please squash your commits into a single commit.
144
146
  - **Branch Naming:** Use descriptive branch names like `feature/your-feature` or `fix/issue-number`.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oe-python-template-example
3
- Version: 0.1.16
3
+ Version: 0.1.18
4
4
  Summary: 🧠 Example project scaffolded and kept up to date with OE Python Template (oe-python-template).
5
5
  Project-URL: Homepage, https://oe-python-template-example.readthedocs.io/en/latest/
6
6
  Project-URL: Documentation, https://oe-python-template-example.readthedocs.io/en/latest/
@@ -59,6 +59,9 @@ Requires-Dist: marimo>=0.11.19; extra == 'examples'
59
59
  Requires-Dist: streamlit>=1.43.2; extra == 'examples'
60
60
  Description-Content-Type: text/markdown
61
61
 
62
+
63
+ [//]: # (README.md generated from docs/partials/README_*.md)
64
+
62
65
  # 🧠 OE Python Template Example
63
66
 
64
67
  [![License](https://img.shields.io/github/license/helmut-hoffer-von-ankershoffen/oe-python-template-example?logo=opensourceinitiative&logoColor=3DA639&labelColor=414042&color=A41831)
@@ -136,10 +139,13 @@ uvx oe-python-template-example serve --port=4711 # serves webservice API on port
136
139
  ```
137
140
 
138
141
  Notes:
139
- * The API is versioned, mounted at `/api/v1` resp. `/api/v2`
140
- * While serving the webservice API go to [http://127.0.0.1:8000/api/v1/hello-world](http://127.0.0.1:8000/api/v1/hello-world) to see the respons of the `hello-world` operation.
141
- * Interactive documentation is provided at [http://127.0.0.1:8000/api/docs](http://127.0.0.1:8000/api/docs)
142
142
 
143
+ - The API is versioned, mounted at `/api/v1` resp. `/api/v2`
144
+ - While serving the webservice API go to
145
+ [http://127.0.0.1:8000/api/v1/hello-world](http://127.0.0.1:8000/api/v1/hello-world)
146
+ to see the respons of the `hello-world` operation.
147
+ - Interactive documentation is provided at
148
+ [http://127.0.0.1:8000/api/docs](http://127.0.0.1:8000/api/docs)
143
149
 
144
150
  The CLI provides extensive help:
145
151
 
@@ -1,3 +1,6 @@
1
+
2
+ [//]: # (README.md generated from docs/partials/README_*.md)
3
+
1
4
  # 🧠 OE Python Template Example
2
5
 
3
6
  [![License](https://img.shields.io/github/license/helmut-hoffer-von-ankershoffen/oe-python-template-example?logo=opensourceinitiative&logoColor=3DA639&labelColor=414042&color=A41831)
@@ -75,10 +78,13 @@ uvx oe-python-template-example serve --port=4711 # serves webservice API on port
75
78
  ```
76
79
 
77
80
  Notes:
78
- * The API is versioned, mounted at `/api/v1` resp. `/api/v2`
79
- * While serving the webservice API go to [http://127.0.0.1:8000/api/v1/hello-world](http://127.0.0.1:8000/api/v1/hello-world) to see the respons of the `hello-world` operation.
80
- * Interactive documentation is provided at [http://127.0.0.1:8000/api/docs](http://127.0.0.1:8000/api/docs)
81
81
 
82
+ - The API is versioned, mounted at `/api/v1` resp. `/api/v2`
83
+ - While serving the webservice API go to
84
+ [http://127.0.0.1:8000/api/v1/hello-world](http://127.0.0.1:8000/api/v1/hello-world)
85
+ to see the respons of the `hello-world` operation.
86
+ - Interactive documentation is provided at
87
+ [http://127.0.0.1:8000/api/docs](http://127.0.0.1:8000/api/docs)
82
88
 
83
89
  The CLI provides extensive help:
84
90
 
@@ -47,6 +47,14 @@ We follow these security best practices:
47
47
  - Automated CI/CD pipelines including security checks
48
48
  - Adherence to Python security best practices
49
49
 
50
+ We promote security awareness among contributors and users
51
+
52
+ - We indicate security as a priority in our
53
+ [code style guide](CODE_STYLE.md), to be followed by human and agentic
54
+ contributors as mandatory
55
+ - We publish our security posture in SECURITY.md (this document), encouraring
56
+ users to report vulnerabilities.
57
+
50
58
  ## Security Compliance
51
59
 
52
60
  For questions about security compliance or for more details about our security practices, please contact helmuthva@gmail.com.
@@ -0,0 +1 @@
1
+ 0.1.18
@@ -33,10 +33,13 @@ uvx oe-python-template-example serve --port=4711 # serves webservice API on port
33
33
  ```
34
34
 
35
35
  Notes:
36
- * The API is versioned, mounted at `/api/v1` resp. `/api/v2`
37
- * While serving the webservice API go to [http://127.0.0.1:8000/api/v1/hello-world](http://127.0.0.1:8000/api/v1/hello-world) to see the respons of the `hello-world` operation.
38
- * Interactive documentation is provided at [http://127.0.0.1:8000/api/docs](http://127.0.0.1:8000/api/docs)
39
36
 
37
+ - The API is versioned, mounted at `/api/v1` resp. `/api/v2`
38
+ - While serving the webservice API go to
39
+ [http://127.0.0.1:8000/api/v1/hello-world](http://127.0.0.1:8000/api/v1/hello-world)
40
+ to see the respons of the `hello-world` operation.
41
+ - Interactive documentation is provided at
42
+ [http://127.0.0.1:8000/api/docs](http://127.0.0.1:8000/api/docs)
40
43
 
41
44
  The CLI provides extensive help:
42
45
 
@@ -0,0 +1 @@
1
+ .. mdinclude:: ../../CODE_STYLE.md
@@ -29,7 +29,7 @@ extensions = [
29
29
  project = "oe-python-template-example"
30
30
  author = "Helmut Hoffer von Ankershoffen"
31
31
  copyright = f" (c) 2025-{datetime.now(UTC).year}, {author}" # noqa: A001
32
- version = "0.1.16"
32
+ version = "0.1.18"
33
33
  release = version
34
34
  github_username = "helmut-hoffer-von-ankershoffen"
35
35
  github_repository = "oe-python-template-example"
@@ -14,9 +14,10 @@
14
14
  api_v1
15
15
  api_v2
16
16
  reference
17
- release-notes
18
17
  security
18
+ release-notes
19
19
  contributing
20
+ code-style
20
21
 
21
22
  .. sidebar-links::
22
23
  :caption: Links
@@ -0,0 +1,2 @@
1
+ .. mdinclude:: ../partials/README_main.md
2
+ :start-line: 0
@@ -56,10 +56,11 @@ def docs(session: nox.Session) -> None:
56
56
  """Build documentation and concatenate README."""
57
57
  _setup_venv(session)
58
58
  # Concatenate README files
59
- header = Path("_readme_header.md").read_text(encoding="utf-8")
60
- main = Path("_readme_main.md").read_text(encoding="utf-8")
61
- footer = Path("_readme_footer.md").read_text(encoding="utf-8")
62
- readme_content = f"{header}\n\n{main}\n\n{footer}"
59
+ preamble = "\n[//]: # (README.md generated from docs/partials/README_*.md)\n\n"
60
+ header = Path("docs/partials/README_header.md").read_text(encoding="utf-8")
61
+ main = Path("docs/partials/README_main.md").read_text(encoding="utf-8")
62
+ footer = Path("docs/partials/README_footer.md").read_text(encoding="utf-8")
63
+ readme_content = f"{preamble}{header}\n\n{main}\n\n{footer}"
63
64
  Path("README.md").write_text(readme_content, encoding="utf-8")
64
65
  # Dump openapi schema to file
65
66
  with Path("docs/source/_static/openapi_v1.yaml").open("w", encoding="utf-8") as f:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "oe-python-template-example"
3
- version = "0.1.16"
3
+ version = "0.1.18"
4
4
  description = "🧠 Example project scaffolded and kept up to date with OE Python Template (oe-python-template)."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -242,7 +242,7 @@ source = ["src/"]
242
242
 
243
243
 
244
244
  [tool.bumpversion]
245
- current_version = "0.1.16"
245
+ current_version = "0.1.18"
246
246
  parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
247
247
  serialize = ["{major}.{minor}.{patch}"]
248
248
  search = "{current_version}"
@@ -1,6 +1,6 @@
1
1
  sonar.projectKey=helmut-hoffer-von-ankershoffen_oe-python-template-example
2
2
  sonar.organization=helmut-hoffer-von-ankershoffen
3
- sonar.projectVersion=0.1.16
3
+ sonar.projectVersion=0.1.18
4
4
  sonar.projectDescription=🧠 Example project scaffolded and kept up to date with OE Python Template (oe-python-template).
5
5
  sonar.links.homepage=https://oe-python-template-example.readthedocs.io/en/latest/
6
6
  sonar.links.scm=https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example
@@ -2075,7 +2075,7 @@ wheels = [
2075
2075
 
2076
2076
  [[package]]
2077
2077
  name = "oe-python-template-example"
2078
- version = "0.1.16"
2078
+ version = "0.1.18"
2079
2079
  source = { editable = "." }
2080
2080
  dependencies = [
2081
2081
  { name = "fastapi", extra = ["all", "standard"] },
@@ -1 +0,0 @@
1
- 0.1.16
@@ -1,2 +0,0 @@
1
- .. mdinclude:: ../../_readme_main.md
2
- :start-line: 0