python-template-project 0.1.15__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.
- {python_template_project-0.1.15 → python_template_project-0.1.18}/.github/rename_project.sh +3 -2
- {python_template_project-0.1.15 → python_template_project-0.1.18}/.github/workflows/build.yml +1 -3
- python_template_project-0.1.18/.github/workflows/rename_project.yml +42 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/HISTORY.md +29 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/Makefile +5 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/PKG-INFO +33 -43
- python_template_project-0.1.18/README.md +57 -0
- python_template_project-0.1.18/docs/develop/01_getting_started_dev.md +29 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/docs/getting-started/install.md +35 -14
- python_template_project-0.1.18/docs/index.md +55 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/pyproject.toml +1 -0
- python_template_project-0.1.18/scripts/update_readme.py +21 -0
- python_template_project-0.1.18/src/firewall_handler.py +198 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/src/python_template_project/_version.py +2 -2
- python_template_project-0.1.18/src/python_template_project/core/base.py +549 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/src/python_template_project.egg-info/PKG-INFO +33 -43
- {python_template_project-0.1.15 → python_template_project-0.1.18}/src/python_template_project.egg-info/SOURCES.txt +3 -1
- {python_template_project-0.1.15 → python_template_project-0.1.18}/src/python_template_project.egg-info/top_level.txt +1 -0
- python_template_project-0.1.15/README.md +0 -64
- python_template_project-0.1.15/docs/index.md +0 -65
- python_template_project-0.1.15/scripts/update_readme.py +0 -11
- python_template_project-0.1.15/src/VERSION +0 -1
- python_template_project-0.1.15/src/python_template_project/core/base.py +0 -397
- {python_template_project-0.1.15 → python_template_project-0.1.18}/.github/FUNDING.yml +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/.github/actions/setup-environment/action.yml +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/.github/dependabot.yml +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/.github/init.sh +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/.github/release_message.sh +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/.github/workflows/build-macos.yml +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/.github/workflows/main.yml +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/.github/workflows/release.yml +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/.github/workflows/update-readme.yml +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/.gitignore +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/.idea/runConfigurations/config_generate.xml +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/.idea/runConfigurations/module_cli.xml +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/.idea/runConfigurations/module_gui.xml +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/.pre-commit-config.yaml +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/.readthedocs.yaml +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/LICENSE +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/config.yaml +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/docs/.nav.yml +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/docs/_static/img/favicon.png +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/docs/_static/img/logo.png +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/docs/css/custom.css +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/docs/develop/contributing.md +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/docs/develop/make_windows.md +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/docs/develop/pypi_release.md +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/docs/getting-started/virtual-environment.md +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/docs/usage/cli.md +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/docs/usage/config.md +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/examples/kuhkopfsteig.gpx +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/examples/rother_lilienstein.gpx +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/examples/teneriffa.gpx +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/mkdocs.yml +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/scripts/show-filelist.ps1 +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/scripts/show-tree.ps1 +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/setup.cfg +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/src/__init__.py +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/src/main.py +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/src/python_template_project/__init__.py +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/src/python_template_project/__main__.py +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/src/python_template_project/cli/__init__.py +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/src/python_template_project/cli/__main__.py +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/src/python_template_project/cli/cli.py +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/src/python_template_project/config/__init__.py +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/src/python_template_project/config/config.py +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/src/python_template_project/core/__init__.py +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/src/python_template_project/core/logging.py +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/src/python_template_project/gui/__init__.py +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/src/python_template_project/gui/__main__.py +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/src/python_template_project/gui/gui.py +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/src/python_template_project.egg-info/dependency_links.txt +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/src/python_template_project.egg-info/entry_points.txt +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/src/python_template_project.egg-info/requires.txt +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/tests/__init__.py +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/tests/test_generic_cli.py +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/tests/test_gpx.py +0 -0
- {python_template_project-0.1.15 → python_template_project-0.1.18}/uv.lock +0 -0
|
@@ -18,19 +18,20 @@ echo "Renaming project..."
|
|
|
18
18
|
|
|
19
19
|
original_author="pamagister"
|
|
20
20
|
original_name="python-template-project"
|
|
21
|
+
original_package_name="python_template_project"
|
|
21
22
|
original_urlname="python-template-project"
|
|
22
23
|
original_description="Awesome python-template-project created by pamagister"
|
|
23
24
|
# for filename in $(find . -name "*.*")
|
|
24
25
|
for filename in $(git ls-files)
|
|
25
26
|
do
|
|
26
27
|
sed -i "s/$original_author/$author/g" $filename
|
|
27
|
-
sed -i "s/$
|
|
28
|
+
sed -i "s/$original_package_name/$name/g" $filename
|
|
28
29
|
sed -i "s/$original_urlname/$urlname/g" $filename
|
|
29
30
|
sed -i "s/$original_description/$description/g" $filename
|
|
30
31
|
echo "Renamed $filename"
|
|
31
32
|
done
|
|
32
33
|
|
|
33
|
-
mv
|
|
34
|
+
mv original_name $name
|
|
34
35
|
|
|
35
36
|
# This command runs only once on GHA!
|
|
36
37
|
rm -rf .github/template.yml
|
{python_template_project-0.1.15 → python_template_project-0.1.18}/.github/workflows/build.yml
RENAMED
|
@@ -29,9 +29,7 @@ jobs:
|
|
|
29
29
|
python-version: ${{ matrix.python-version }}
|
|
30
30
|
|
|
31
31
|
- name: Build Unified EXE with PyInstaller
|
|
32
|
-
run:
|
|
33
|
-
echo "Building unified CLI/GUI application"
|
|
34
|
-
uv run pyinstaller --onefile src/main.py --name python-template-project --add-data "config.yaml;." --hidden-import python_template_project.cli.cli --hidden-import python_template_project.gui.gui
|
|
32
|
+
run: make build-win
|
|
35
33
|
|
|
36
34
|
- name: Prepare ZIP file for release
|
|
37
35
|
run: |
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Rename the project from template
|
|
2
|
+
|
|
3
|
+
on: [push]
|
|
4
|
+
|
|
5
|
+
permissions: write-all
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
rename-project:
|
|
9
|
+
if: ${{ !contains (github.repository, '/python-template-project') }}
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v3
|
|
13
|
+
with:
|
|
14
|
+
# by default, it uses a depth of 1
|
|
15
|
+
# this fetches all history so that we can read each commit
|
|
16
|
+
fetch-depth: 0
|
|
17
|
+
ref: ${{ github.head_ref }}
|
|
18
|
+
|
|
19
|
+
- run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}' | tr '-' '_' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
|
|
20
|
+
shell: bash
|
|
21
|
+
|
|
22
|
+
- run: echo "REPOSITORY_URLNAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
|
|
23
|
+
shell: bash
|
|
24
|
+
|
|
25
|
+
- run: echo "REPOSITORY_OWNER=$(echo '${{ github.repository }}' | awk -F '/' '{print $1}')" >> $GITHUB_ENV
|
|
26
|
+
shell: bash
|
|
27
|
+
|
|
28
|
+
- name: Is this still a template
|
|
29
|
+
id: is_template
|
|
30
|
+
run: echo "::set-output name=is_template::$(ls .github/template.yml &> /dev/null && echo true || echo false)"
|
|
31
|
+
|
|
32
|
+
- name: Rename the project
|
|
33
|
+
if: steps.is_template.outputs.is_template == 'true'
|
|
34
|
+
run: |
|
|
35
|
+
echo "Renaming the project with -a(author) ${{ env.REPOSITORY_OWNER }} -n(name) ${{ env.REPOSITORY_NAME }} -u(urlname) ${{ env.REPOSITORY_URLNAME }}"
|
|
36
|
+
.github/rename_project.sh -a ${{ env.REPOSITORY_OWNER }} -n ${{ env.REPOSITORY_NAME }} -u ${{ env.REPOSITORY_URLNAME }} -d "Awesome ${{ env.REPOSITORY_NAME }} created by ${{ env.REPOSITORY_OWNER }}"
|
|
37
|
+
|
|
38
|
+
- uses: pamagister/git-auto-commit-action@v4
|
|
39
|
+
with:
|
|
40
|
+
commit_message: "✅ Ready to clone and code."
|
|
41
|
+
# commit_options: '--amend --no-edit'
|
|
42
|
+
push_options: --force
|
|
@@ -4,6 +4,35 @@ Changelog
|
|
|
4
4
|
|
|
5
5
|
(unreleased)
|
|
6
6
|
------------
|
|
7
|
+
- Feat #30: fix link issue by modifying link in README.md. [Paul
|
|
8
|
+
Magister]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
0.1.16 (2025-06-20)
|
|
12
|
+
-------------------
|
|
13
|
+
- Fix #29: more rubust usage of srtm in case of connection issues. [Paul
|
|
14
|
+
Magister]
|
|
15
|
+
- Feat #30: exclude _version.py from check. [Paul Magister]
|
|
16
|
+
- Feat #31: doc on how to generate. [Paul Magister]
|
|
17
|
+
- Feat #30: exclude _version.py from check. [Paul Magister]
|
|
18
|
+
- Feat #31: enable project to be copied #31. [Paul Magister]
|
|
19
|
+
- Feat #27: move build logic into make file #27. [Paul Magister]
|
|
20
|
+
- Feat #30: improve README.md, fix utf8-issues on copying. [Paul
|
|
21
|
+
Magister]
|
|
22
|
+
- Feat #30: correct doc how to install and use this project. [Paul
|
|
23
|
+
Magister]
|
|
24
|
+
- Feat #30: add _version.py instead of VERSION. [Paul Magister]
|
|
25
|
+
- Update README.md from docs/index.md. [github-actions]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
0.1.15 (2025-06-20)
|
|
29
|
+
-------------------
|
|
30
|
+
- Feat #30: switch build system to setuptools_scm. [Paul Magister]
|
|
31
|
+
- Feat #30: add some links to the doc. [Paul Magister]
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
0.1.14 (2025-06-20)
|
|
35
|
+
-------------------
|
|
7
36
|
- Feat #30: release project on pypi: deploy section in release.yml.
|
|
8
37
|
[Paul Magister]
|
|
9
38
|
- Feat #30: release project on pypi: rename contributing section, add
|
|
@@ -55,6 +55,11 @@ test: lint ## Run tests and generate coverage report.
|
|
|
55
55
|
uv run coverage xml
|
|
56
56
|
uv run coverage html
|
|
57
57
|
|
|
58
|
+
.PHONY: build-win
|
|
59
|
+
build-win: ## Build the Windows executable.
|
|
60
|
+
echo "Building unified CLI/GUI application"
|
|
61
|
+
uv run pyinstaller --onefile src/main.py --name python-template-project --add-data "config.yaml;." --hidden-import python_template_project.cli.cli --hidden-import python_template_project.gui.gui
|
|
62
|
+
|
|
58
63
|
.PHONY: watch
|
|
59
64
|
watch: ## Run tests on every change.
|
|
60
65
|
ls **/**.py | entr uv run pytest -s -vvv -l --tb=long --maxfail=1 tests/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-template-project
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.18
|
|
4
4
|
Summary: Feature-rich Python project template designed for robustness and ease of use.
|
|
5
5
|
Author: pamagister
|
|
6
6
|
Requires-Python: <3.12,>=3.10
|
|
@@ -43,54 +43,44 @@ A feature-rich Python project template with with auto-generated CLI, GUI and par
|
|
|
43
43
|
|
|
44
44
|
This template provides a solid foundation for your next Python project, incorporating best practices for testing, automation, and distribution. It streamlines the development process with a comprehensive set of pre-configured tools and workflows, allowing you to focus on writing code.
|
|
45
45
|
|
|
46
|
+
## Installation
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
Download from [PyPI](https://pypi.org/).
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
* **CI/CD:** [GitHub Actions](https://github.com/features/actions) for automated builds (Windows, macOS), unit tests, and code checks.
|
|
51
|
-
* **Code Formatting and Linting:** Pre-commit hook with the [RUFF auto-formatter](https://docs.astral.sh/ruff/) to ensure consistent code style.
|
|
52
|
-
* **Automated Builds:** GitHub pipeline for automatically building a Windows executable and a macOS installer.
|
|
53
|
-
* **Package Management:** Utilizes [uv](https://docs.astral.sh/uv/getting-started/), an extremely fast Python package manager, with dependencies managed in `pyproject.toml`.
|
|
54
|
-
* **Parameter-Driven Automation:**
|
|
55
|
-
* Automatic generation of a configuration file from parameter definitions.
|
|
56
|
-
* Automatic generation of a Command-Line Interface (CLI) from the same parameters.
|
|
57
|
-
* Automatic generation of CLI API documentation.
|
|
58
|
-
* **Documentation:** Configuration for publishing documentation on [Read the Docs](https://about.readthedocs.com/) using [mkdocs](https://www.mkdocs.org/) .
|
|
59
|
-
* **Workflow Automation:** A `Makefile` is included to simplify and automate common development tasks.
|
|
60
|
-
* **Minimalist GUI:** Comes with a basic GUI based on [tkinker](https://tkdocs.com/tutorial/index.html) that includes an auto-generated settings menu based on your defined parameters.
|
|
61
|
-
* **Release pipeline:** Automated releases unsing the Makefile `make release` command, which creates a new tag and pushes it to the remote repo. The `release` pipeline will automatically create a new release on GitHub and trigger a release on PyPI.
|
|
62
|
-
* **[setuptools](https://pypi.org/project/setuptools/)** is used to package the project and manage dependencies.
|
|
63
|
-
* **[setuptools-scm](https://pypi.org/project/setuptools-scm/)** is used to automatically generate the `_version.py` file from the `pyproject.toml` file.
|
|
50
|
+
💾 For more installation options see [install](getting-started/install.md).
|
|
64
51
|
|
|
65
|
-
## Getting started
|
|
66
|
-
|
|
67
|
-
1. **Create** a new [github repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-new-repository).
|
|
68
|
-
2. **Clone** [github repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) the into your local file system.
|
|
69
|
-
```bash
|
|
70
|
-
git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY
|
|
71
|
-
```
|
|
72
|
-
4. **Install** [uv package and project manager](https://docs.astral.sh/uv/getting-started/installation/)
|
|
73
|
-
```bash
|
|
74
|
-
pip install uv
|
|
75
|
-
```
|
|
76
|
-
5. **Generate** [a sample project](https://docs.astral.sh/uv/guides/projects/#creating-a-new-project) with uv
|
|
77
|
-
6. Add and **push** the artifacts to your github repository
|
|
78
|
-
```bash
|
|
79
|
-
git push
|
|
80
|
-
```
|
|
81
|
-
8. Copy the content of this repository into your repository
|
|
82
|
-
|
|
83
|
-
## Troubleshooting
|
|
84
|
-
|
|
85
|
-
### Problems with release pipeline
|
|
86
|
-
|
|
87
|
-
If you get this error below:
|
|
88
52
|
```bash
|
|
89
|
-
|
|
53
|
+
pip install python-template-project
|
|
90
54
|
```
|
|
91
55
|
|
|
92
|
-
|
|
56
|
+
Run GUI from command line
|
|
57
|
+
|
|
93
58
|
```bash
|
|
94
|
-
|
|
59
|
+
python-template-project-gui
|
|
95
60
|
```
|
|
96
61
|
|
|
62
|
+
## How to use this template
|
|
63
|
+
|
|
64
|
+
🐍 For details, see the [Getting Started](develop/01_getting_started_dev.md) guide.
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
## Feature overview
|
|
68
|
+
|
|
69
|
+
* 📦 **Package Management:** Utilizes [uv](https://docs.astral.sh/uv/getting-started/), an extremely fast Python package manager, with dependencies managed in `pyproject.toml`.
|
|
70
|
+
* ✅ **Code Formatting and Linting:** Pre-commit hook with the [RUFF auto-formatter](https://docs.astral.sh/ruff/) to ensure consistent code style.
|
|
71
|
+
* 🧪 **Testing:** Unit testing framework with [pytest](https://docs.pytest.org/en/latest/).
|
|
72
|
+
* 📊 **Code coverage reports** using [codecov](https://about.codecov.io/sign-up/)
|
|
73
|
+
* 🔄 **CI/CD:** [GitHub Actions](https://github.com/features/actions) for automated builds (Windows, macOS), unit tests, and code checks.
|
|
74
|
+
* 💾 **Automated Builds:** GitHub pipeline for automatically building a Windows executable and a macOS installer.
|
|
75
|
+
* 💬 **Parameter-Driven Automation:**
|
|
76
|
+
* Automatic generation of a configuration file from parameter definitions.
|
|
77
|
+
* Automatic generation of a Command-Line Interface (CLI) from the same parameters.
|
|
78
|
+
* Automatic generation of CLI API documentation.
|
|
79
|
+
* Automatic generation of change log using **gitchangelog** to keep a HISTORY.md file up to date.
|
|
80
|
+
* 📃 **Documentation:** Configuration for publishing documentation on [Read the Docs](https://about.readthedocs.com/) using [mkdocs](https://www.mkdocs.org/) .
|
|
81
|
+
* 🖼️ **Minimalist GUI:** Comes with a basic GUI based on [tkinker](https://tkdocs.com/tutorial/index.html) that includes an auto-generated settings menu based on your defined parameters.
|
|
82
|
+
* 🖥️ **Workflow Automation:** A `Makefile` is included to simplify and automate common development tasks.
|
|
83
|
+
* 🛳️ **Release pipeline:** Automated releases unsing the Makefile `make release` command, which creates a new tag and pushes it to the remote repo. The `release` pipeline will automatically create a new release on GitHub and trigger a release on [PyPI](https://pypi.org.
|
|
84
|
+
* **[setuptools](https://pypi.org/project/setuptools/)** is used to package the project and manage dependencies.
|
|
85
|
+
* **[setuptools-scm](https://pypi.org/project/setuptools-scm/)** is used to automatically generate the `_version.py` file from the `pyproject.toml` file.
|
|
86
|
+
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<!-- This README.md is auto-generated from docs/index.md -->
|
|
2
|
+
|
|
3
|
+
# Welcome to python-template-project
|
|
4
|
+
|
|
5
|
+
A feature-rich Python project template with with auto-generated CLI, GUI and parameterized configuration.
|
|
6
|
+
|
|
7
|
+
[](https://github.com/pamagister/python-template-project/actions)
|
|
8
|
+
[](https://github.com/pamagister/python-template-project/releases)
|
|
9
|
+
[](https://python-template-project.readthedocs.io/en/stable/)
|
|
10
|
+
[](https://github.com/pamagister/python-template-project/blob/main/LICENSE)
|
|
11
|
+
[](https://github.com/pamagister/python-template-project/issues)
|
|
12
|
+
[](https://pypi.org/project/python-template-project/)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
This template provides a solid foundation for your next Python project, incorporating best practices for testing, automation, and distribution. It streamlines the development process with a comprehensive set of pre-configured tools and workflows, allowing you to focus on writing code.
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
Download from [PyPI](https://pypi.org/).
|
|
20
|
+
|
|
21
|
+
💾 For more installation options see [install](getting-started/install.md).
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install python-template-project
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Run GUI from command line
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
python-template-project-gui
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## How to use this template
|
|
34
|
+
|
|
35
|
+
🐍 For details, see the [Getting Started](develop/01_getting_started_dev.md) guide.
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## Feature overview
|
|
39
|
+
|
|
40
|
+
* 📦 **Package Management:** Utilizes [uv](https://docs.astral.sh/uv/getting-started/), an extremely fast Python package manager, with dependencies managed in `pyproject.toml`.
|
|
41
|
+
* ✅ **Code Formatting and Linting:** Pre-commit hook with the [RUFF auto-formatter](https://docs.astral.sh/ruff/) to ensure consistent code style.
|
|
42
|
+
* 🧪 **Testing:** Unit testing framework with [pytest](https://docs.pytest.org/en/latest/).
|
|
43
|
+
* 📊 **Code coverage reports** using [codecov](https://about.codecov.io/sign-up/)
|
|
44
|
+
* 🔄 **CI/CD:** [GitHub Actions](https://github.com/features/actions) for automated builds (Windows, macOS), unit tests, and code checks.
|
|
45
|
+
* 💾 **Automated Builds:** GitHub pipeline for automatically building a Windows executable and a macOS installer.
|
|
46
|
+
* 💬 **Parameter-Driven Automation:**
|
|
47
|
+
* Automatic generation of a configuration file from parameter definitions.
|
|
48
|
+
* Automatic generation of a Command-Line Interface (CLI) from the same parameters.
|
|
49
|
+
* Automatic generation of CLI API documentation.
|
|
50
|
+
* Automatic generation of change log using **gitchangelog** to keep a HISTORY.md file up to date.
|
|
51
|
+
* 📃 **Documentation:** Configuration for publishing documentation on [Read the Docs](https://about.readthedocs.com/) using [mkdocs](https://www.mkdocs.org/) .
|
|
52
|
+
* 🖼️ **Minimalist GUI:** Comes with a basic GUI based on [tkinker](https://tkdocs.com/tutorial/index.html) that includes an auto-generated settings menu based on your defined parameters.
|
|
53
|
+
* 🖥️ **Workflow Automation:** A `Makefile` is included to simplify and automate common development tasks.
|
|
54
|
+
* 🛳️ **Release pipeline:** Automated releases unsing the Makefile `make release` command, which creates a new tag and pushes it to the remote repo. The `release` pipeline will automatically create a new release on GitHub and trigger a release on [PyPI](https://pypi.org.
|
|
55
|
+
* **[setuptools](https://pypi.org/project/setuptools/)** is used to package the project and manage dependencies.
|
|
56
|
+
* **[setuptools-scm](https://pypi.org/project/setuptools-scm/)** is used to automatically generate the `_version.py` file from the `pyproject.toml` file.
|
|
57
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
# Getting started developing
|
|
3
|
+
|
|
4
|
+
## Setup your project development environment
|
|
5
|
+
|
|
6
|
+
Getting started on developing your own project based on this template
|
|
7
|
+
|
|
8
|
+
> **DO NOT FORK** this is meant to be used from **[Use this template](https://github.com/pamagister/python-template-project/generate)** feature.
|
|
9
|
+
|
|
10
|
+
1. Click on **[Use this template](https://github.com/pamagister/python-template-project/generate)**
|
|
11
|
+
3. Give a name to your project
|
|
12
|
+
(e.g. `my_python_project` recommendation is to use all lowercase and underscores separation for repo names.)
|
|
13
|
+
3. Wait until the first run of CI finishes
|
|
14
|
+
(Github Actions will process the template and commit to your new repo)
|
|
15
|
+
|
|
16
|
+
## Troubleshooting
|
|
17
|
+
|
|
18
|
+
### Problems with release pipeline
|
|
19
|
+
|
|
20
|
+
If you get this error below:
|
|
21
|
+
```bash
|
|
22
|
+
/home/runner/work/_temp/xxxx_xxx.sh: line 1: .github/release_message.sh: Permission denied
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
You have to run these commands in your IDE Terminal or the git bash and then push the changes.
|
|
26
|
+
```bash
|
|
27
|
+
git update-index --chmod=+x ./.github/release_message.sh
|
|
28
|
+
```
|
|
29
|
+
|
{python_template_project-0.1.15 → python_template_project-0.1.18}/docs/getting-started/install.md
RENAMED
|
@@ -1,45 +1,66 @@
|
|
|
1
1
|
# Installation
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
## 🐍 PyPI
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
### Install the package from PyPI
|
|
7
|
+
|
|
8
|
+
Download from [PyPI](https://pypi.org/):
|
|
6
9
|
|
|
7
10
|
```bash
|
|
8
|
-
|
|
11
|
+
pip install python-template-project
|
|
9
12
|
```
|
|
10
13
|
|
|
14
|
+
### Run CLI from command line
|
|
15
|
+
```bash
|
|
16
|
+
python-template-project [OPTIONS] path/to/file
|
|
17
|
+
```
|
|
11
18
|
|
|
12
|
-
|
|
19
|
+
### Run GUI from command line
|
|
20
|
+
```bash
|
|
21
|
+
python-template-project-gui
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## 🔽 Executable
|
|
25
|
+
|
|
26
|
+
Download the latest executable:
|
|
13
27
|
|
|
14
28
|
- [⬇️ Download for Windows](https://github.com/pamagister/python-template-project/releases/latest/download/installer-win.zip)
|
|
15
29
|
- [⬇️ Download for macOS](https://github.com/pamagister/python-template-project/releases/latest/download/package-macos.zip)
|
|
16
30
|
|
|
17
31
|
|
|
32
|
+
## 👩🏼💻 Run from source
|
|
18
33
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
### Run with CLI from source
|
|
34
|
+
### Clone the repository
|
|
22
35
|
|
|
23
36
|
```bash
|
|
24
|
-
|
|
37
|
+
git clone
|
|
25
38
|
```
|
|
26
39
|
|
|
40
|
+
### Navigate to the project directory
|
|
27
41
|
|
|
28
|
-
|
|
42
|
+
```bash
|
|
43
|
+
cd python-template-project
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Install dependencies
|
|
29
47
|
|
|
30
48
|
```bash
|
|
31
|
-
|
|
49
|
+
uv venv
|
|
50
|
+
uv pip install -e .[dev,docs]
|
|
32
51
|
```
|
|
33
52
|
|
|
34
53
|
|
|
35
|
-
|
|
54
|
+
### Run with CLI from source
|
|
36
55
|
|
|
37
|
-
### Run CLI from command line
|
|
38
56
|
```bash
|
|
39
|
-
python-
|
|
57
|
+
python -m python_template_project.cli [OPTIONS] path/to/file
|
|
40
58
|
```
|
|
41
59
|
|
|
42
|
-
|
|
60
|
+
|
|
61
|
+
### Run with GUI from source
|
|
62
|
+
|
|
43
63
|
```bash
|
|
44
|
-
python-
|
|
64
|
+
python -m python_template_project.gui
|
|
45
65
|
```
|
|
66
|
+
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Welcome to python-template-project
|
|
2
|
+
|
|
3
|
+
A feature-rich Python project template with with auto-generated CLI, GUI and parameterized configuration.
|
|
4
|
+
|
|
5
|
+
[](https://github.com/pamagister/python-template-project/actions)
|
|
6
|
+
[](https://github.com/pamagister/python-template-project/releases)
|
|
7
|
+
[](https://python-template-project.readthedocs.io/en/stable/)
|
|
8
|
+
[](https://github.com/pamagister/python-template-project/blob/main/LICENSE)
|
|
9
|
+
[](https://github.com/pamagister/python-template-project/issues)
|
|
10
|
+
[](https://pypi.org/project/python-template-project/)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
This template provides a solid foundation for your next Python project, incorporating best practices for testing, automation, and distribution. It streamlines the development process with a comprehensive set of pre-configured tools and workflows, allowing you to focus on writing code.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
Download from [PyPI](https://pypi.org/).
|
|
18
|
+
|
|
19
|
+
💾 For more installation options see [install](getting-started/install.md).
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install python-template-project
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Run GUI from command line
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
python-template-project-gui
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## How to use this template
|
|
32
|
+
|
|
33
|
+
🐍 For details, see the [Getting Started](develop/01_getting_started_dev.md) guide.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## Feature overview
|
|
37
|
+
|
|
38
|
+
* 📦 **Package Management:** Utilizes [uv](https://docs.astral.sh/uv/getting-started/), an extremely fast Python package manager, with dependencies managed in `pyproject.toml`.
|
|
39
|
+
* ✅ **Code Formatting and Linting:** Pre-commit hook with the [RUFF auto-formatter](https://docs.astral.sh/ruff/) to ensure consistent code style.
|
|
40
|
+
* 🧪 **Testing:** Unit testing framework with [pytest](https://docs.pytest.org/en/latest/).
|
|
41
|
+
* 📊 **Code coverage reports** using [codecov](https://about.codecov.io/sign-up/)
|
|
42
|
+
* 🔄 **CI/CD:** [GitHub Actions](https://github.com/features/actions) for automated builds (Windows, macOS), unit tests, and code checks.
|
|
43
|
+
* 💾 **Automated Builds:** GitHub pipeline for automatically building a Windows executable and a macOS installer.
|
|
44
|
+
* 💬 **Parameter-Driven Automation:**
|
|
45
|
+
* Automatic generation of a configuration file from parameter definitions.
|
|
46
|
+
* Automatic generation of a Command-Line Interface (CLI) from the same parameters.
|
|
47
|
+
* Automatic generation of CLI API documentation.
|
|
48
|
+
* Automatic generation of change log using **gitchangelog** to keep a HISTORY.md file up to date.
|
|
49
|
+
* 📃 **Documentation:** Configuration for publishing documentation on [Read the Docs](https://about.readthedocs.com/) using [mkdocs](https://www.mkdocs.org/) .
|
|
50
|
+
* 🖼️ **Minimalist GUI:** Comes with a basic GUI based on [tkinker](https://tkdocs.com/tutorial/index.html) that includes an auto-generated settings menu based on your defined parameters.
|
|
51
|
+
* 🖥️ **Workflow Automation:** A `Makefile` is included to simplify and automate common development tasks.
|
|
52
|
+
* 🛳️ **Release pipeline:** Automated releases unsing the Makefile `make release` command, which creates a new tag and pushes it to the remote repo. The `release` pipeline will automatically create a new release on GitHub and trigger a release on [PyPI](https://pypi.org.
|
|
53
|
+
* **[setuptools](https://pypi.org/project/setuptools/)** is used to package the project and manage dependencies.
|
|
54
|
+
* **[setuptools-scm](https://pypi.org/project/setuptools-scm/)** is used to automatically generate the `_version.py` file from the `pyproject.toml` file.
|
|
55
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# scripts/update_readme.py
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
src = Path("docs/index.md")
|
|
5
|
+
dst = Path("README.md")
|
|
6
|
+
|
|
7
|
+
# Optional: prepend a note that it's generated
|
|
8
|
+
prefix = "<!-- This README.md is auto-generated from docs/index.md -->\n\n"
|
|
9
|
+
|
|
10
|
+
# Lese die Quelldatei explizit mit UTF-8 Kodierung
|
|
11
|
+
source_content = src.read_text(encoding="utf-8")
|
|
12
|
+
|
|
13
|
+
# Schreibe den Inhalt in die Zieldatei, ebenfalls mit UTF-8 Kodierung
|
|
14
|
+
dst.write_text(
|
|
15
|
+
prefix
|
|
16
|
+
+ source_content.replace("](getting-started\/", "](docs/getting-started/").replace(
|
|
17
|
+
"](develop\/", "](docs/develop/"
|
|
18
|
+
),
|
|
19
|
+
encoding="utf-8",
|
|
20
|
+
)
|
|
21
|
+
print(f"DONE - {dst} updated from {src}")
|