Skip to content

Commit 26b953a

Browse files
31chtumaisch
authored andcommitted
Add example project
1 parent eb3bdae commit 26b953a

File tree

17 files changed

+839
-9
lines changed

17 files changed

+839
-9
lines changed

.devcontainer/Dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
FROM mcr.microsoft.com/devcontainers/python:1-3.12-bullseye
1+
# https://github.com/devcontainers/images/tree/main/src/python
2+
FROM mcr.microsoft.com/devcontainers/python:1-3.12-bookworm
23

3-
# Install Debian packages
4-
# RUN apt-get update && apt-get install -y --no-install-recommends \
5-
# XXX \
6-
# && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
4+
# [Optional] Uncomment this section to install additional packages.
5+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
6+
# && apt-get -y install --no-install-recommends \
7+
# <your-package-list-here> \
8+
# && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"build": {
88
// Path is relative to the devcontainer.json file.
99
"dockerfile": "Dockerfile"
10-
}
10+
},
1111

1212
// Features to add to the dev container. More info: https://containers.dev/features.
1313
// "features": {},
@@ -16,7 +16,7 @@
1616
// "forwardPorts": [],
1717

1818
// Use 'postCreateCommand' to run commands after the container is created.
19-
// "postCreateCommand": "pip3 install --user -r requirements.txt",
19+
"postCreateCommand": "pipenv install --dev && pipenv run pip install -e ."
2020

2121
// Configure tool-specific properties.
2222
// "customizations": {},

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
__pycache__
2+
.coverage
3+
*.egg-info
4+
_build
5+
build
6+
dist
7+
coverage.xml
8+
report.xml
9+
version.py

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"python.testing.pytestArgs": [
3+
"tests"
4+
],
5+
"python.testing.unittestEnabled": false,
6+
"python.testing.pytestEnabled": true
7+
}

Pipfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
click = "*"
8+
9+
[dev-packages]
10+
coverage = "*"
11+
myst-parser = "*"
12+
pytest = "*"
13+
pytest-cov = "*"
14+
pytest-mock = "*"
15+
sphinx = "*"
16+
sphinx-rtd-theme = "*"
17+
18+
[requires]
19+
python_version = "3.12"

Pipfile.lock

Lines changed: 566 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
# [devminds](https://devminds.ch) Python Project Template
1+
# Python Project Template by [devminds GmbH](https://devminds.ch)
22

3-
Directory structure:
3+
## Directory structure
44

55
```
66
├── docs Sphinx documentation
77
├── src Python package source code
88
└── tests Python tests
99
```
10+
11+
## TODO
12+
13+
* Add docs (usage.md) using Sphinx
14+
* Add pipelines
15+
* GitHub: docs/build/test
16+
* GitLab: docs/build/test/coverage/deploy
17+
* Jenkins: docs/todo|fixme|hack/build/test/coverage

docs/Makefile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SPHINXAPIDOC ?= sphinx-apidoc
9+
SOURCEDIR = .
10+
BUILDDIR = _build
11+
PACKAGEDIR = ../src
12+
13+
# Put it first so that "make" without argument is like "make help".
14+
help:
15+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
16+
17+
# Generate API documentation
18+
apidoc:
19+
@$(SPHINXAPIDOC) -f -T -o "$(SOURCEDIR)" "$(PACKAGEDIR)"
20+
21+
# Generate API and HTML documentation
22+
doc: apidoc
23+
@$(SPHINXBUILD) -M html
24+
25+
.PHONY: help Makefile
26+
27+
# Catch-all target: route all unknown targets to Sphinx using the new
28+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
29+
%: Makefile
30+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/conf.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
import os
6+
import sys
7+
sys.path.append(os.path.abspath('../src'))
8+
9+
# -- Project information -----------------------------------------------------
10+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
11+
12+
project = 'Python Project Template by devminds GmbH'
13+
copyright = '2024, Andreas, Thomas'
14+
author = 'Andreas, Thomas'
15+
16+
# Note: this requires the demo package to be installed
17+
from demo.version import version # noqa
18+
# The full version, including alpha/beta/rc tags
19+
release = version
20+
21+
# -- General configuration ---------------------------------------------------
22+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
23+
24+
extensions = [
25+
'myst_parser',
26+
'sphinx.ext.autodoc',
27+
'sphinx.ext.autosectionlabel',
28+
'sphinx.ext.napoleon',
29+
'sphinx_rtd_theme'
30+
]
31+
32+
templates_path = ['_templates']
33+
exclude_patterns = []
34+
35+
# -- Options for HTML output -------------------------------------------------
36+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
37+
38+
html_theme = 'sphinx_rtd_theme'
39+
html_static_path = ['_static']

docs/demo.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
demo package
2+
============
3+
4+
Submodules
5+
----------
6+
7+
demo.calculate module
8+
---------------------
9+
10+
.. automodule:: demo.calculate
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
15+
demo.version module
16+
-------------------
17+
18+
.. automodule:: demo.version
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
22+
23+
Module contents
24+
---------------
25+
26+
.. automodule:: demo
27+
:members:
28+
:undoc-members:
29+
:show-inheritance:

0 commit comments

Comments
 (0)