oe-python-template 0.6.21__py3-none-any.whl → 0.6.23__py3-none-any.whl
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.
- {oe_python_template-0.6.21.dist-info → oe_python_template-0.6.23.dist-info}/METADATA +61 -24
- {oe_python_template-0.6.21.dist-info → oe_python_template-0.6.23.dist-info}/RECORD +5 -5
- {oe_python_template-0.6.21.dist-info → oe_python_template-0.6.23.dist-info}/WHEEL +0 -0
- {oe_python_template-0.6.21.dist-info → oe_python_template-0.6.23.dist-info}/entry_points.txt +0 -0
- {oe_python_template-0.6.21.dist-info → oe_python_template-0.6.23.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: oe-python-template
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.23
|
|
4
4
|
Summary: 🧠 Copier template to scaffold Python projects compliant with best practices and modern tooling.
|
|
5
5
|
Project-URL: Homepage, https://oe-python-template.readthedocs.io/en/latest/
|
|
6
6
|
Project-URL: Documentation, https://oe-python-template.readthedocs.io/en/latest/
|
|
@@ -103,14 +103,51 @@ Description-Content-Type: text/markdown
|
|
|
103
103
|
|
|
104
104
|
Copier template to scaffold Python projects compliant with best practices and modern tooling.
|
|
105
105
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
106
|
+
This [Copier](https://copier.readthedocs.io/en/stable/) template enables you to quickly generate a Python package with fully functioning build and test automation.
|
|
107
|
+
Projects generated from this template can be [easily updated](https://copier.readthedocs.io/en/stable/updating/) to benefit from improvements and new features of the template.
|
|
108
|
+
|
|
109
|
+
Features:
|
|
110
|
+
- Package management with [uv](https://github.com/astral-sh/uv)
|
|
111
|
+
- Code formatting with [Ruff](https://github.com/astral-sh/ruff)
|
|
112
|
+
- Linting with [Ruff](https://github.com/astral-sh/ruff)
|
|
113
|
+
- Static type checking with [mypy](https://mypy.readthedocs.io/en/stable/)
|
|
114
|
+
- Complete set of [pre-commit](https://pre-commit.com/) hooks including [detect-secrets](https://github.com/Yelp/detect-secrets) and [pygrep](https://github.com/pre-commit/pygrep-hooks)
|
|
115
|
+
- Unit and E2E testing with [pytest](https://docs.pytest.org/en/stable/) including parallel test execution
|
|
116
|
+
- Matrix testing in multiple environments with [nox](https://nox.thea.codes/en/stable/)
|
|
117
|
+
- Test coverage reported with [Codecov](https://codecov.io/) and published as release artifact
|
|
118
|
+
- CI/CD pipeline automated with [GitHub Actions](https://github.com/features/actions)
|
|
119
|
+
- CI/CD pipeline can be run locally with [act](https://github.com/nektos/act)
|
|
120
|
+
- Code quality and security checks with [SonarQube](https://www.sonarsource.com/products/sonarcloud) and [GitHub CodeQL](https://codeql.github.com/)
|
|
121
|
+
- Dependency monitoring with [pip-audit](https://pypi.org/project/pip-audit/), [Renovate](https://github.com/renovatebot/renovate), and [GitHub Dependabot](https://docs.github.com/en/code-security/getting-started/dependabot-quickstart-guide)
|
|
122
|
+
- Licenses of dependencies extracted with [pip-licenses](https://pypi.org/project/pip-licenses/) and published as release artefacts
|
|
123
|
+
- Software Bill of Materials (SBOM) generated with [cyclonedx-python](https://github.com/CycloneDX/cyclonedx-python) and published as release artifact
|
|
124
|
+
- Version and release management with [bump-my-version](https://callowayproject.github.io/bump-my-version/)
|
|
125
|
+
- Changelog and release notes generated with [git-cliff](https://git-cliff.org/)
|
|
126
|
+
- Documentation generated with [Sphinx](https://www.sphinx-doc.org/en/master/) including reference documentation and PDF export
|
|
127
|
+
- Documentation published to [Read The Docs](https://readthedocs.org/)
|
|
128
|
+
- Interactive OpenAPI specification with [Swagger](https://swagger.io/)
|
|
129
|
+
- Python package published to [PyPI](https://pypi.org/)
|
|
130
|
+
- Docker images published to [Docker.io](https://hub.docker.com/) and [GitHub Container Registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry) with [artifact attestations](https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds)
|
|
131
|
+
- One-click development environments with [Dev Containers](https://code.visualstudio.com/docs/devcontainers/containers) and [GitHub Codespaces](https://github.com/features/codespaces)
|
|
132
|
+
|
|
133
|
+
The generated project includes code, documentation and configuration of a fully functioning demo-application and service, which can be used as a starting point for your own project.
|
|
134
|
+
- Service architecture suitable for use as shared library
|
|
135
|
+
- Validation with [pydantic](https://docs.pydantic.dev/)
|
|
136
|
+
- Command-line interface (CLI) with [Typer](https://typer.tiangolo.com/)
|
|
137
|
+
- Versioned Web API with [FastAPI](https://fastapi.tiangolo.com/)
|
|
138
|
+
- [Interactive Jupyter notebook](https://jupyter.org/) and [reactive Marimo notebook](https://marimo.io/)
|
|
139
|
+
- Simple Web UI with [Streamlit](https://streamlit.io/)
|
|
140
|
+
- Configuration to run the CLI and API in a Docker container including setup for [Docker Compose](https://docs.docker.com/get-started/docker-concepts/the-basics/what-is-docker-compose/)
|
|
141
|
+
- Documentation including badges, setup instructions, contribution guide and security policy
|
|
142
|
+
|
|
143
|
+
Explore [here](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example) for what's generated out of the box.
|
|
144
|
+
|
|
145
|
+
## Generate a new project
|
|
146
|
+
|
|
147
|
+
This template is designed to be used with the [copier](https://copier.readthedocs.io/en/stable/) project generator. It allows you to create a new project based on this template and customize it according to your needs.
|
|
148
|
+
To generate a new project, follow these steps:
|
|
149
|
+
|
|
150
|
+
**Step 1**: Install uv package manager and copier. Copy the following code into your terminal and execute it.
|
|
114
151
|
```shell
|
|
115
152
|
if [[ "$OSTYPE" == "darwin"* ]]; then # Install dependencies for macOS X
|
|
116
153
|
if ! command -v brew &> /dev/null; then ## Install Homebrew if not present
|
|
@@ -126,38 +163,37 @@ fi
|
|
|
126
163
|
uv tool install copier # Install copier as global tool
|
|
127
164
|
```
|
|
128
165
|
|
|
129
|
-
**Step 2**:
|
|
166
|
+
**Step 2**: [Create an empty repository on GitHub](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-new-repository), clone to your local machine, and change into it's directory.
|
|
130
167
|
|
|
131
|
-
**Step 3**:
|
|
168
|
+
**Step 3**: Generate the project. Copy
|
|
132
169
|
```shell
|
|
133
170
|
copier copy --trust gh:helmut-hoffer-von-ankershoffen/oe-python-template .
|
|
134
171
|
```
|
|
135
172
|
|
|
136
|
-
**Step 4**: Perform initial commit and push
|
|
173
|
+
**Step 4**: Perform initial commit and push. Copy the following code into your terminal and execute it.
|
|
137
174
|
```shell
|
|
138
175
|
git add .
|
|
139
176
|
git commit -m "feat: Initial commit"
|
|
140
177
|
git push
|
|
141
178
|
```
|
|
142
179
|
|
|
143
|
-
Visit your GitHub repository and check the Actions tab. The CI workflow should fail at the SonarQube step,
|
|
144
|
-
as this external service is not yet configured for our new repository.
|
|
180
|
+
Visit your GitHub repository and check the Actions tab. The CI workflow should already be running! The workflow will fail at the SonarQube step, as this external service is not yet configured for our new repository.
|
|
145
181
|
|
|
146
182
|
**Step 5**: Follow the [instructions](SERVICE_CONNECTIONS.md) to wire up
|
|
147
|
-
external services such as
|
|
183
|
+
external services such as CloudCov, SonarQube Cloud, Read The Docs, Docker.io, and Streamlit Community Cloud.
|
|
148
184
|
|
|
149
185
|
**Step 6**: Release the first versions
|
|
150
186
|
```shell
|
|
151
187
|
./n bump
|
|
152
188
|
```
|
|
153
189
|
Notes:
|
|
154
|
-
* You can remove this section post having successfully
|
|
190
|
+
* You can remove this section post having successfully generated your project.
|
|
155
191
|
* The following sections refer to the dummy application and service provided by this template.
|
|
156
192
|
Use them as inspiration and adapt them to your own project.
|
|
157
193
|
|
|
158
194
|
## Overview
|
|
159
195
|
|
|
160
|
-
Adding OE Python Template to your project as a dependency is easy.
|
|
196
|
+
Adding OE Python Template to your project as a dependency is easy. See below for usage examples.
|
|
161
197
|
|
|
162
198
|
```shell
|
|
163
199
|
uv add oe-python-template # add dependency to your project
|
|
@@ -165,6 +201,7 @@ uv add oe-python-template # add dependency to your project
|
|
|
165
201
|
|
|
166
202
|
If you don't have uv installed follow [these instructions](https://docs.astral.sh/uv/getting-started/installation/). If you still prefer pip over the modern and fast package manager [uv](https://github.com/astral-sh/uv), you can install the library like this:
|
|
167
203
|
|
|
204
|
+
|
|
168
205
|
```shell
|
|
169
206
|
pip install oe-python-template # add dependency to your project
|
|
170
207
|
```
|
|
@@ -172,14 +209,14 @@ pip install oe-python-template # add dependency to your project
|
|
|
172
209
|
Executing the command line interface (CLI) in an isolated Python environment is just as easy:
|
|
173
210
|
|
|
174
211
|
```shell
|
|
175
|
-
uvx oe-python-template hello-world
|
|
176
|
-
uvx oe-python-template serve
|
|
177
|
-
uvx oe-python-template serve --port=4711 # serves
|
|
212
|
+
uvx oe-python-template hello-world # prints "Hello, world! [..]"
|
|
213
|
+
uvx oe-python-template serve # serves web API
|
|
214
|
+
uvx oe-python-template serve --port=4711 # serves web API on port 4711
|
|
178
215
|
```
|
|
179
216
|
|
|
180
217
|
Notes:
|
|
181
218
|
* The API is versioned, mounted at `/api/v1` resp. `/api/v2`
|
|
182
|
-
* While serving the
|
|
219
|
+
* While serving the web 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.
|
|
183
220
|
* Interactive documentation is provided at [http://127.0.0.1:8000/api/docs](http://127.0.0.1:8000/api/docs)
|
|
184
221
|
|
|
185
222
|
|
|
@@ -206,9 +243,9 @@ This project is designed with operational excellence in mind, using modern Pytho
|
|
|
206
243
|
* [Transparent test coverage](https://app.codecov.io/gh/helmut-hoffer-von-ankershoffen/oe-python-template) including unit and E2E tests (reported on Codecov)
|
|
207
244
|
* Matrix tested with [multiple python versions](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template/blob/main/noxfile.py) to ensure compatibility (powered by [Nox](https://nox.thea.codes/en/stable/))
|
|
208
245
|
* Compliant with modern linting and formatting standards (powered by [Ruff](https://github.com/astral-sh/ruff))
|
|
209
|
-
* Up-to-date dependencies (monitored by [Renovate](https://github.com/renovatebot/renovate) and [
|
|
246
|
+
* Up-to-date dependencies (monitored by [Renovate](https://github.com/renovatebot/renovate) and [Dependabot](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template/security/dependabot))
|
|
210
247
|
* [A-grade code quality](https://sonarcloud.io/summary/new_code?id=helmut-hoffer-von-ankershoffen_oe-python-template) in security, maintainability, and reliability with low technical debt and codesmell (verified by SonarQube)
|
|
211
|
-
* Additional code security checks using [
|
|
248
|
+
* Additional code security checks using [CodeQL](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template/security/code-scanning)
|
|
212
249
|
* [Security Policy](SECURITY.md)
|
|
213
250
|
* [License](LICENSE) compliant with the Open Source Initiative (OSI)
|
|
214
251
|
* 1-liner for installation and execution of command line interface (CLI) via [uv(x)](https://github.com/astral-sh/uv) or [Docker](https://hub.docker.com/r/helmuthva/oe-python-template/tags)
|
|
@@ -217,7 +254,7 @@ This project is designed with operational excellence in mind, using modern Pytho
|
|
|
217
254
|
|
|
218
255
|
## Usage Examples
|
|
219
256
|
|
|
220
|
-
The following examples run from source
|
|
257
|
+
The following examples run from source - clone this repository using
|
|
221
258
|
`git clone git@github.com:helmut-hoffer-von-ankershoffen/oe-python-template.git`.
|
|
222
259
|
|
|
223
260
|
### Minimal Python Script:
|
|
@@ -3,8 +3,8 @@ oe_python_template/api.py,sha256=-7d4cLPHmdLZSkzu6UOaCp9hUO0Aq8MNq8uEZuiW9Y4,625
|
|
|
3
3
|
oe_python_template/cli.py,sha256=jvIPeJzx9esff7-M5pBe2R3vvmpxRvxKIre1VOGndls,3426
|
|
4
4
|
oe_python_template/constants.py,sha256=Z1c06l5DeRuFxYVLHihHHTYvr8_Qh0nyzVKOe5X3ZNs,350
|
|
5
5
|
oe_python_template/service.py,sha256=Gd-B9IIZ1vB1uONVJHA65hPnfeYeKUIcnU3rZbU2lGs,744
|
|
6
|
-
oe_python_template-0.6.
|
|
7
|
-
oe_python_template-0.6.
|
|
8
|
-
oe_python_template-0.6.
|
|
9
|
-
oe_python_template-0.6.
|
|
10
|
-
oe_python_template-0.6.
|
|
6
|
+
oe_python_template-0.6.23.dist-info/METADATA,sha256=jnUnrJeJmXL27JKflGr18ZWflCZBbCKv0GLCKuJQriI,26288
|
|
7
|
+
oe_python_template-0.6.23.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
8
|
+
oe_python_template-0.6.23.dist-info/entry_points.txt,sha256=IroSSWhLGxus9rxcashkYQda39TTvf7LbUMYtOKXUBE,66
|
|
9
|
+
oe_python_template-0.6.23.dist-info/licenses/LICENSE,sha256=5H409K6xzz9U5eUaoAHQExNkoWJRlU0LEj6wL2QJ34s,1113
|
|
10
|
+
oe_python_template-0.6.23.dist-info/RECORD,,
|
|
File without changes
|
{oe_python_template-0.6.21.dist-info → oe_python_template-0.6.23.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{oe_python_template-0.6.21.dist-info → oe_python_template-0.6.23.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|