python-template-project 0.2.3__tar.gz → 0.2.5__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.2.5/.github/workflows/build-linux.yml +48 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.readthedocs.yaml +3 -3
- {python_template_project-0.2.3 → python_template_project-0.2.5}/HISTORY.md +29 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/Makefile +25 -12
- {python_template_project-0.2.3/src/python_template_project.egg-info → python_template_project-0.2.5}/PKG-INFO +4 -20
- {python_template_project-0.2.3 → python_template_project-0.2.5}/README.md +2 -17
- python_template_project-0.2.5/config.yaml +41 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/docs/index.md +1 -1
- {python_template_project-0.2.3 → python_template_project-0.2.5}/docs/usage/cli.md +28 -12
- {python_template_project-0.2.3 → python_template_project-0.2.5}/docs/usage/config.md +19 -10
- {python_template_project-0.2.3 → python_template_project-0.2.5}/mkdocs.yml +1 -1
- {python_template_project-0.2.3 → python_template_project-0.2.5}/pyproject.toml +5 -5
- python_template_project-0.2.5/pytest.ini +3 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/scripts/generate_config_docs.py +2 -2
- python_template_project-0.2.5/scripts/show_filelist.py +51 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/scripts/show_tree.py +2 -3
- python_template_project-0.2.5/src/python_template_project/_version.py +24 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/src/python_template_project/cli/cli.py +2 -2
- {python_template_project-0.2.3 → python_template_project-0.2.5}/src/python_template_project/config/config.py +5 -1
- {python_template_project-0.2.3 → python_template_project-0.2.5/src/python_template_project.egg-info}/PKG-INFO +4 -20
- {python_template_project-0.2.3 → python_template_project-0.2.5}/src/python_template_project.egg-info/SOURCES.txt +6 -3
- python_template_project-0.2.5/src/python_template_project.egg-info/requires.txt +6 -0
- python_template_project-0.2.5/src/python_template_project.egg-info/scm_file_list.json +78 -0
- python_template_project-0.2.5/src/python_template_project.egg-info/scm_version.json +8 -0
- python_template_project-0.2.5/tests/test_gpx.py +292 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/uv.lock +125 -21
- python_template_project-0.2.3/config.yaml +0 -41
- python_template_project-0.2.3/scripts/show_filelist.ps1 +0 -14
- python_template_project-0.2.3/scripts/show_tree.ps1 +0 -58
- python_template_project-0.2.3/src/python_template_project/_version.py +0 -34
- python_template_project-0.2.3/src/python_template_project.egg-info/requires.txt +0 -24
- python_template_project-0.2.3/tests/test_gpx.py +0 -361
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.github/FUNDING.yml +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.github/actions/setup-environment/action.yml +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.github/dependabot.yml +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.github/init.sh +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.github/release_message.sh +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.github/rename_project.sh +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.github/template.yml +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.github/update_funding.py +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.github/workflows/build-macos.yml +0 -0
- /python_template_project-0.2.3/.github/workflows/build.yml → /python_template_project-0.2.5/.github/workflows/build-windows.yml +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.github/workflows/main.yml +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.github/workflows/release.yml +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.github/workflows/rename_project.yml +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.github/workflows/update_readme.yml +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.gitignore +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.idea/runConfigurations/config_generate.xml +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.idea/runConfigurations/module_cli.xml +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.idea/runConfigurations/module_gui.xml +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.pre-commit-config-linux.yaml +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/.pre-commit-config.yaml +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/LICENSE +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/docs/.nav.yml +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/docs/_static/img/favicon.png +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/docs/_static/img/logo.png +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/docs/css/custom.css +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/docs/develop/contributing.md +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/docs/develop/make_windows.md +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/docs/develop/naming_convention.md +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/docs/develop/pypi_release.md +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/docs/funding/funding.md +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/docs/getting-started/install.md +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/docs/getting-started/virtual-environment.md +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/examples/kuhkopfsteig.gpx +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/examples/rother_lilienstein.gpx +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/examples/teneriffa.gpx +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/scripts/update_readme.py +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/setup.cfg +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/src/__init__.py +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/src/firewall_handler.py +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/src/main.py +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/src/python_template_project/__init__.py +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/src/python_template_project/__main__.py +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/src/python_template_project/cli/__init__.py +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/src/python_template_project/cli/__main__.py +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/src/python_template_project/config/__init__.py +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/src/python_template_project/core/__init__.py +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/src/python_template_project/core/base.py +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/src/python_template_project/core/logging.py +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/src/python_template_project/gui/__init__.py +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/src/python_template_project/gui/__main__.py +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/src/python_template_project/gui/gui.py +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/src/python_template_project.egg-info/dependency_links.txt +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/src/python_template_project.egg-info/entry_points.txt +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/src/python_template_project.egg-info/top_level.txt +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/template.yml.url +0 -0
- {python_template_project-0.2.3 → python_template_project-0.2.5}/tests/__init__.py +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: Build Linux App
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- '*'
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
strategy:
|
|
12
|
+
fail-fast: false
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: [ 3.11 ]
|
|
15
|
+
os: [ ubuntu-latest ]
|
|
16
|
+
runs-on: ${{ matrix.os }}
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout repository
|
|
20
|
+
uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: Set up Python
|
|
23
|
+
uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: ${{ matrix.python-version }}
|
|
26
|
+
|
|
27
|
+
- name: Setup Environment
|
|
28
|
+
uses: ./.github/actions/setup-environment
|
|
29
|
+
with:
|
|
30
|
+
python-version: ${{ matrix.python-version }}
|
|
31
|
+
|
|
32
|
+
- name: Build Unified Linux Executable with PyInstaller
|
|
33
|
+
run: |
|
|
34
|
+
make build-linux
|
|
35
|
+
|
|
36
|
+
- name: Prepare ZIP file for release
|
|
37
|
+
run: |
|
|
38
|
+
echo "Create the ZIP archive from the contents of the release folder"
|
|
39
|
+
cd release
|
|
40
|
+
zip -r ../package-linux.zip .
|
|
41
|
+
|
|
42
|
+
- name: Upload ZIP to GitHub Release
|
|
43
|
+
uses: softprops/action-gh-release@v2
|
|
44
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
45
|
+
with:
|
|
46
|
+
files: package-linux.zip
|
|
47
|
+
env:
|
|
48
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -4,6 +4,35 @@ Changelog
|
|
|
4
4
|
|
|
5
5
|
(unreleased)
|
|
6
6
|
------------
|
|
7
|
+
- Ich habe .readthedocs.yaml auf Read the Docs’ uv-Integration mit der
|
|
8
|
+
Gruppe docs umgestellt. Hinweis: uv sync wählt standardmäßig auch die
|
|
9
|
+
dev-Gruppe aus. [Paul Magister]
|
|
10
|
+
- Updated pyproject.toml to remove Deptry’s deprecated setting, which
|
|
11
|
+
pointed at optional-dependency groups that this project doesn’t use.
|
|
12
|
+
Added a targeted exception for lxml, an intentional dependency that
|
|
13
|
+
Deptry otherwise flags as unused. [Paul Magister]
|
|
14
|
+
- Bump version of config-cli-gui to latest version. [Paul Magister]
|
|
15
|
+
- Improve makefile. [Paul Magister]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
0.2.4 (2025-11-30)
|
|
19
|
+
------------------
|
|
20
|
+
- Docs: Update HISTORY.md for release 0.2.4. [Paul Magister]
|
|
21
|
+
- Add linux build workflow. [Paul Magister]
|
|
22
|
+
- Avoid warning by adding lxml package. [Paul Magister]
|
|
23
|
+
- Fix format. [Paul Magister]
|
|
24
|
+
- Only use on py file to show tree with or without python classes. [Paul
|
|
25
|
+
Magister]
|
|
26
|
+
- Switch to python scripts that print the project structure. [Paul
|
|
27
|
+
Magister]
|
|
28
|
+
- Switch to pytest. [Paul Magister]
|
|
29
|
+
- Update README.md from docs/index.md. [github-actions]
|
|
30
|
+
- Typo with with. [Paul Magister]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
0.2.3 (2025-11-14)
|
|
34
|
+
------------------
|
|
35
|
+
- Docs: Update HISTORY.md for release 0.2.3. [Paul Magister]
|
|
7
36
|
- Run precommit before building release for proper formatting. [Paul
|
|
8
37
|
Magister]
|
|
9
38
|
- Valid app_name for cli configuration. [Paul Magister]
|
|
@@ -18,8 +18,7 @@ show: ## Show the current environment.
|
|
|
18
18
|
.PHONY: install
|
|
19
19
|
install: ## Install the project in dev mode.
|
|
20
20
|
$(MAKE) lock
|
|
21
|
-
|
|
22
|
-
uv pip install -e .[dev,docs]
|
|
21
|
+
uv sync --all-groups
|
|
23
22
|
|
|
24
23
|
.PHONY: lock
|
|
25
24
|
lock: ## builds the uv.make lock file and syncs the packages
|
|
@@ -40,6 +39,7 @@ fmt: ## Format code using black & isort.
|
|
|
40
39
|
uv run ruff format tests/
|
|
41
40
|
uv run ruff check src/ --fix
|
|
42
41
|
uv run ruff check tests/ --fix
|
|
42
|
+
$(MAKE) syncdocs
|
|
43
43
|
|
|
44
44
|
.PHONY: lint
|
|
45
45
|
lint: ## Run pep8, black, mypy linters.
|
|
@@ -65,6 +65,18 @@ build-win: ## Build the Windows executable.
|
|
|
65
65
|
cp config.yaml release
|
|
66
66
|
cp README.md release
|
|
67
67
|
|
|
68
|
+
.PHONY: build-linux
|
|
69
|
+
build-linux: ## Build the Linux executable.
|
|
70
|
+
## Build the Linux executable.
|
|
71
|
+
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
|
|
72
|
+
|
|
73
|
+
rm -rf release
|
|
74
|
+
mkdir release
|
|
75
|
+
cp dist/python-template-project release
|
|
76
|
+
cp config.yaml release
|
|
77
|
+
cp README.md release
|
|
78
|
+
|
|
79
|
+
|
|
68
80
|
.PHONY: build-macos
|
|
69
81
|
build-macos: ## Build the macOS executable.
|
|
70
82
|
echo "Building unified CLI/GUI application as executable"
|
|
@@ -147,27 +159,28 @@ release: ## Create a new tag for release.
|
|
|
147
159
|
echo "GitHub Actions will detect the new tag and trigger the release workflows."
|
|
148
160
|
echo "Add modified files to commit and push them to main"
|
|
149
161
|
|
|
150
|
-
.PHONY:
|
|
151
|
-
|
|
162
|
+
.PHONY: syncdocs
|
|
163
|
+
syncdocs: ## Sync the documentation.
|
|
152
164
|
@echo "sync documentation ..."
|
|
153
165
|
@uv run ./scripts/generate_config_docs.py
|
|
154
166
|
@uv run ./scripts/update_readme.py
|
|
155
167
|
@uv run ./.github/update_funding.py
|
|
156
|
-
@echo "building documentation ..."
|
|
157
|
-
@uv run mkdocs build
|
|
158
|
-
@uv run mkdocs serve
|
|
159
168
|
|
|
160
|
-
.PHONY:
|
|
161
|
-
|
|
162
|
-
|
|
169
|
+
.PHONY: docs
|
|
170
|
+
docs: ## Build and sync the documentation.
|
|
171
|
+
## run syncdocs
|
|
172
|
+
$(MAKE) syncdocs
|
|
173
|
+
@echo "building documentation ..."
|
|
174
|
+
@uv run --group docs mkdocs build
|
|
175
|
+
@uv run --group docs mkdocs serve
|
|
163
176
|
|
|
164
177
|
.PHONY: tree
|
|
165
178
|
tree: ## Show project tree (excluding ignored folders)
|
|
166
|
-
@
|
|
179
|
+
@uv run ./scripts/show_tree.py
|
|
167
180
|
|
|
168
181
|
.PHONY: pytree
|
|
169
182
|
pytree: ## Show project tree (excluding ignored folders)
|
|
170
|
-
@uv run ./scripts/show_tree.py
|
|
183
|
+
@uv run ./scripts/show_tree.py --show-code
|
|
171
184
|
|
|
172
185
|
.PHONY: init
|
|
173
186
|
init: ## Initialize the project based on an application template.
|
|
@@ -1,38 +1,22 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-template-project
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.5
|
|
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
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
License-File: LICENSE
|
|
9
|
-
Requires-Dist: config-cli-gui>=0.
|
|
9
|
+
Requires-Dist: config-cli-gui>=0.3.9
|
|
10
10
|
Requires-Dist: fastkml>=1.1.0
|
|
11
11
|
Requires-Dist: gpxpy>=1.6.2
|
|
12
|
+
Requires-Dist: lxml>=6.0.2
|
|
12
13
|
Requires-Dist: shapely>=2.1.1
|
|
13
14
|
Requires-Dist: srtm-py>=0.3.7
|
|
14
|
-
Provides-Extra: dev
|
|
15
|
-
Requires-Dist: pytest>=8.4.0; extra == "dev"
|
|
16
|
-
Requires-Dist: pytest-mock>=3.14.1; extra == "dev"
|
|
17
|
-
Requires-Dist: coverage>=7.8.2; extra == "dev"
|
|
18
|
-
Requires-Dist: flake8>=7.2.0; extra == "dev"
|
|
19
|
-
Requires-Dist: black>=25.1.0; extra == "dev"
|
|
20
|
-
Requires-Dist: isort>=6.0.1; extra == "dev"
|
|
21
|
-
Requires-Dist: pytest-cov>=6.1.1; extra == "dev"
|
|
22
|
-
Requires-Dist: mypy>=1.16.0; extra == "dev"
|
|
23
|
-
Requires-Dist: gitchangelog>=3.0.4; extra == "dev"
|
|
24
|
-
Requires-Dist: pyinstaller>=5.8; extra == "dev"
|
|
25
|
-
Requires-Dist: pre-commit>=4.2.0; extra == "dev"
|
|
26
|
-
Requires-Dist: ruff>=0.11.13; extra == "dev"
|
|
27
|
-
Provides-Extra: docs
|
|
28
|
-
Requires-Dist: mkdocs>=1.6.1; extra == "docs"
|
|
29
|
-
Requires-Dist: mkdocs-awesome-nav>=2.6.1; extra == "docs"
|
|
30
|
-
Requires-Dist: pygments>=2.19.1; extra == "docs"
|
|
31
15
|
Dynamic: license-file
|
|
32
16
|
|
|
33
17
|
# Welcome to python-template-project
|
|
34
18
|
|
|
35
|
-
A feature-rich Python project template with
|
|
19
|
+
A feature-rich Python project template with auto-generated CLI, GUI and parameterized configuration.
|
|
36
20
|
|
|
37
21
|
[](https://github.com/pamagister/python-template-project/actions)
|
|
38
22
|
[](https://github.com/pamagister/python-template-project/releases)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Welcome to python-template-project
|
|
4
4
|
|
|
5
|
-
A feature-rich Python project template with
|
|
5
|
+
A feature-rich Python project template with auto-generated CLI, GUI and parameterized configuration.
|
|
6
6
|
|
|
7
7
|
[](https://github.com/pamagister/python-template-project/actions)
|
|
8
8
|
[](https://github.com/pamagister/python-template-project/releases)
|
|
@@ -51,22 +51,7 @@ Getting started on developing your own project based on this template
|
|
|
51
51
|
7. **Open the project in your IDE**
|
|
52
52
|
|
|
53
53
|
8. **Install dependencies and create virtual environment**
|
|
54
|
-
|
|
55
|
-
Install uv first:
|
|
56
|
-
```bash
|
|
57
|
-
pip install uv
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
On Linux, install pipx first:
|
|
61
|
-
```bash
|
|
62
|
-
sudo apt install pipx
|
|
63
|
-
pipx ensurepath
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
then, intall uv
|
|
67
|
-
```bash
|
|
68
|
-
pipx install uv
|
|
69
|
-
```
|
|
54
|
+
Run:
|
|
70
55
|
|
|
71
56
|
```bash
|
|
72
57
|
make install
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
app:
|
|
2
|
+
# Date format to use | type=str
|
|
3
|
+
date_format: '%Y-%m-%d'
|
|
4
|
+
# Logging level for the application | type=str | choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']
|
|
5
|
+
log_level: INFO
|
|
6
|
+
# Maximum log file size in MB before rotation | type=int
|
|
7
|
+
log_file_max_size: 10
|
|
8
|
+
# Number of backup log files to keep | type=int
|
|
9
|
+
log_backup_count: 5
|
|
10
|
+
# Log message format style | type=str | choices=['simple', 'detailed', 'json']
|
|
11
|
+
log_format: detailed
|
|
12
|
+
# Maximum number of worker threads | type=int
|
|
13
|
+
max_workers: 4
|
|
14
|
+
# Enable logging to file | type=bool | choices=[True, False]
|
|
15
|
+
enable_file_logging: true
|
|
16
|
+
# Enable logging to console | type=bool | choices=[True, False]
|
|
17
|
+
enable_console_logging: true
|
|
18
|
+
cli:
|
|
19
|
+
# Path to input (file or folder) | type=str | [CLI]
|
|
20
|
+
input: ''
|
|
21
|
+
# Path to output destination | type=str | [CLI]
|
|
22
|
+
output: ''
|
|
23
|
+
# Maximum distance between two waypoints | type=int | [CLI]
|
|
24
|
+
min_dist: 25
|
|
25
|
+
# Extract starting points of each track as waypoint | type=bool | [CLI] | choices=[True, False]
|
|
26
|
+
extract_waypoints: true
|
|
27
|
+
# Include elevation data in waypoints | type=bool | [CLI] | choices=[True, False]
|
|
28
|
+
elevation: true
|
|
29
|
+
gui:
|
|
30
|
+
# GUI theme setting | type=str | choices=['light', 'dark', 'auto']
|
|
31
|
+
theme: light
|
|
32
|
+
# Default window width | type=int
|
|
33
|
+
window_width: 800
|
|
34
|
+
# Default window height | type=int
|
|
35
|
+
window_height: 600
|
|
36
|
+
# Height of the log window in pixels | type=int
|
|
37
|
+
log_window_height: 200
|
|
38
|
+
# Automatically scroll to the newest log entries | type=bool | choices=[True, False]
|
|
39
|
+
auto_scroll_log: true
|
|
40
|
+
# Maximum number of log lines to keep in GUI | type=int
|
|
41
|
+
max_log_lines: 1000
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Welcome to python-template-project
|
|
2
2
|
|
|
3
|
-
A feature-rich Python project template with
|
|
3
|
+
A feature-rich Python project template with auto-generated CLI, GUI and parameterized configuration.
|
|
4
4
|
|
|
5
5
|
[](https://github.com/pamagister/python-template-project/actions)
|
|
6
6
|
[](https://github.com/pamagister/python-template-project/releases)
|
|
@@ -3,13 +3,22 @@
|
|
|
3
3
|
Command line options for python_template_project
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
python
|
|
6
|
+
python-template-project [OPTIONS] <input>
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
For development from a source checkout, the equivalent module invocation is:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
python -m python_template_project [OPTIONS] <input>
|
|
7
13
|
```
|
|
8
14
|
|
|
9
15
|
## Options
|
|
10
16
|
|
|
11
17
|
| Option | Type | Description | Default | Choices |
|
|
12
18
|
|-----------------------|------|---------------------------------------------------|------------|---------------|
|
|
19
|
+
| --config | str | Path to configuration file | - | - |
|
|
20
|
+
| -v, --verbose | bool | Enable debug logging | False | [True, False] |
|
|
21
|
+
| -q, --quiet | bool | Show warnings and errors only | False | [True, False] |
|
|
13
22
|
| `input` | str | Path to input (file or folder) | *required* | - |
|
|
14
23
|
| `--output` | str | Path to output destination | *required* | - |
|
|
15
24
|
| `--min_dist` | int | Maximum distance between two waypoints | 25 | - |
|
|
@@ -23,37 +32,44 @@ python -m python_template_project [OPTIONS] input
|
|
|
23
32
|
### 1. Basic usage
|
|
24
33
|
|
|
25
34
|
```bash
|
|
26
|
-
python
|
|
35
|
+
python-template-project input
|
|
27
36
|
```
|
|
28
37
|
|
|
29
38
|
### 2. With verbose logging
|
|
30
39
|
|
|
31
40
|
```bash
|
|
32
|
-
python
|
|
33
|
-
python
|
|
41
|
+
python-template-project -v input
|
|
42
|
+
python-template-project --verbose input
|
|
34
43
|
```
|
|
35
44
|
|
|
36
45
|
### 3. With quiet mode
|
|
37
46
|
|
|
38
47
|
```bash
|
|
39
|
-
python
|
|
40
|
-
python
|
|
48
|
+
python-template-project -q input
|
|
49
|
+
python-template-project --quiet input
|
|
41
50
|
```
|
|
42
51
|
|
|
43
|
-
### 4. With
|
|
52
|
+
### 4. With output parameter
|
|
44
53
|
|
|
45
54
|
```bash
|
|
46
|
-
python
|
|
55
|
+
python-template-project --output input
|
|
47
56
|
```
|
|
48
57
|
|
|
49
|
-
### 5. With
|
|
58
|
+
### 5. With min_dist parameter
|
|
50
59
|
|
|
51
60
|
```bash
|
|
52
|
-
python
|
|
61
|
+
python-template-project --min_dist 25 input
|
|
53
62
|
```
|
|
54
63
|
|
|
55
|
-
### 6. With
|
|
64
|
+
### 6. With extract_waypoints parameter
|
|
56
65
|
|
|
57
66
|
```bash
|
|
58
|
-
python
|
|
67
|
+
python-template-project --extract_waypoints True input
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Developer usage
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
python -m python_template_project --help
|
|
74
|
+
python -m python_template_project input
|
|
59
75
|
```
|
|
@@ -3,17 +3,16 @@
|
|
|
3
3
|
These parameters are available to configure the behavior of your application.
|
|
4
4
|
The parameters in the cli category can be accessed via the command line interface.
|
|
5
5
|
|
|
6
|
-
##
|
|
6
|
+
## Configuration File Reference
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|-------------------|------|---------------------------------------------------|---------|---------------|
|
|
10
|
-
| input | str | Path to input (file or folder) | '' | - |
|
|
11
|
-
| output | str | Path to output destination | '' | - |
|
|
12
|
-
| min_dist | int | Maximum distance between two waypoints | 25 | - |
|
|
13
|
-
| extract_waypoints | bool | Extract starting points of each track as waypoint | True | [True, False] |
|
|
14
|
-
| elevation | bool | Include elevation data in waypoints | True | [True, False] |
|
|
8
|
+
The actual configuration is stored in [`config.yaml`](../../config.yaml). You can:
|
|
15
9
|
|
|
16
|
-
|
|
10
|
+
- Edit the configuration file directly using your text editor
|
|
11
|
+
- Use the `--config` command-line option to specify a custom config file
|
|
12
|
+
- Place a `config.yaml` in your application's config
|
|
13
|
+
directory (typically `~/.config/config-cli-gui/`)
|
|
14
|
+
|
|
15
|
+
## Category "app" {#app}
|
|
17
16
|
|
|
18
17
|
| Name | Type | Description | Default | Choices |
|
|
19
18
|
|------------------------|------|---------------------------------------------|------------|---------------------------------------------------|
|
|
@@ -26,7 +25,17 @@ The parameters in the cli category can be accessed via the command line interfac
|
|
|
26
25
|
| enable_file_logging | bool | Enable logging to file | True | [True, False] |
|
|
27
26
|
| enable_console_logging | bool | Enable logging to console | True | [True, False] |
|
|
28
27
|
|
|
29
|
-
## Category "
|
|
28
|
+
## Category "cli" {#cli}
|
|
29
|
+
|
|
30
|
+
| Name | Type | Description | Default | Choices |
|
|
31
|
+
|-------------------|------|---------------------------------------------------|---------|---------------|
|
|
32
|
+
| input | str | Path to input (file or folder) | '' | - |
|
|
33
|
+
| output | str | Path to output destination | '' | - |
|
|
34
|
+
| min_dist | int | Maximum distance between two waypoints | 25 | - |
|
|
35
|
+
| extract_waypoints | bool | Extract starting points of each track as waypoint | True | [True, False] |
|
|
36
|
+
| elevation | bool | Include elevation data in waypoints | True | [True, False] |
|
|
37
|
+
|
|
38
|
+
## Category "gui" {#gui}
|
|
30
39
|
|
|
31
40
|
| Name | Type | Description | Default | Choices |
|
|
32
41
|
|-------------------|------|------------------------------------------------|---------|---------------------------|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
site_name: python-template-project
|
|
2
2
|
site_url: !ENV READTHEDOCS_CANONICAL_URL
|
|
3
|
-
site_description: A feature-rich Python project template with
|
|
3
|
+
site_description: A feature-rich Python project template with auto-generated CLI, GUI and parameterized configuration.
|
|
4
4
|
repo_url: https://github.com/pamagister/python-template-project
|
|
5
5
|
repo_name: GitHub
|
|
6
6
|
|
|
@@ -8,15 +8,15 @@ authors = [
|
|
|
8
8
|
readme = "docs/index.md"
|
|
9
9
|
requires-python = ">=3.10,<3.12"
|
|
10
10
|
dependencies = [
|
|
11
|
-
"config-cli-gui>=0.
|
|
11
|
+
"config-cli-gui>=0.3.9",
|
|
12
12
|
"fastkml>=1.1.0",
|
|
13
13
|
"gpxpy>=1.6.2",
|
|
14
|
+
"lxml>=6.0.2",
|
|
14
15
|
"shapely>=2.1.1",
|
|
15
16
|
"srtm-py>=0.3.7",
|
|
16
17
|
]
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
[project.optional-dependencies]
|
|
19
|
+
[dependency-groups]
|
|
20
20
|
dev = [
|
|
21
21
|
"pytest>=8.4.0",
|
|
22
22
|
"pytest-mock>=3.14.1",
|
|
@@ -49,8 +49,8 @@ build-backend = "setuptools.build_meta"
|
|
|
49
49
|
[tool.setuptools_scm]
|
|
50
50
|
write_to = "src/python_template_project/_version.py"
|
|
51
51
|
|
|
52
|
-
[tool.deptry]
|
|
53
|
-
|
|
52
|
+
[tool.deptry.per_rule_ignores]
|
|
53
|
+
DEP002 = ["lxml"]
|
|
54
54
|
|
|
55
55
|
[tool.ruff]
|
|
56
56
|
line-length = 100
|
{python_template_project-0.2.3 → python_template_project-0.2.5}/scripts/generate_config_docs.py
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from config_cli_gui.
|
|
1
|
+
from config_cli_gui.docs import DocumentationGenerator
|
|
2
2
|
|
|
3
3
|
from python_template_project.config.config import ConfigParameterManager
|
|
4
4
|
|
|
@@ -18,5 +18,5 @@ print(f"Generated: {default_config}")
|
|
|
18
18
|
docGen.generate_config_markdown_doc(output_file=default_config_doc)
|
|
19
19
|
print(f"Generated: {default_config_doc}")
|
|
20
20
|
|
|
21
|
-
docGen.generate_cli_markdown_doc(output_file=default_cli_doc)
|
|
21
|
+
docGen.generate_cli_markdown_doc(output_file=default_cli_doc, app_name=config_manager.get_app_name())
|
|
22
22
|
print(f"Generated: {default_cli_doc}")
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
import os
|
|
3
|
+
import re
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
EXCLUDE_PATTERN = re.compile(
|
|
7
|
+
r"""
|
|
8
|
+
(\.pytest_cache)|
|
|
9
|
+
(\.git)|
|
|
10
|
+
(\.ruff)|
|
|
11
|
+
(\.venv)|
|
|
12
|
+
(\.github)|
|
|
13
|
+
([/\\]build)|
|
|
14
|
+
([/\\]dist)|
|
|
15
|
+
(\.idea)|
|
|
16
|
+
([/\\]htmlcov)|
|
|
17
|
+
([/\\]__pycache__)|
|
|
18
|
+
([/\\]__main__)|
|
|
19
|
+
([/\\]__init__)|
|
|
20
|
+
([/\\]site)|
|
|
21
|
+
(\.pyc$)
|
|
22
|
+
""",
|
|
23
|
+
re.VERBOSE,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
def should_exclude(path: Path) -> bool:
|
|
27
|
+
return bool(EXCLUDE_PATTERN.search(str(path)))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def main():
|
|
31
|
+
base_path = Path.cwd()
|
|
32
|
+
|
|
33
|
+
for root, dirs, files in os.walk(base_path):
|
|
34
|
+
all_entries = dirs + files
|
|
35
|
+
|
|
36
|
+
for name in all_entries:
|
|
37
|
+
full_path = Path(root) / name
|
|
38
|
+
|
|
39
|
+
# apply exclusion filter
|
|
40
|
+
if should_exclude(full_path):
|
|
41
|
+
continue
|
|
42
|
+
|
|
43
|
+
# compute relative path
|
|
44
|
+
rel = str(full_path.relative_to(base_path))
|
|
45
|
+
|
|
46
|
+
# match PowerShell behavior: always start with "\"
|
|
47
|
+
print("\\" + rel.replace("/", "\\"))
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
if __name__ == "__main__":
|
|
51
|
+
main()
|
|
@@ -130,7 +130,6 @@ def show_tree(path, prefix="", show_code=False):
|
|
|
130
130
|
|
|
131
131
|
print(f"{prefix}{connector}{symbol} {item}")
|
|
132
132
|
next_prefix = prefix + (INDENT if is_last else VERTICAL_LINE)
|
|
133
|
-
|
|
134
133
|
if os.path.isdir(full_path):
|
|
135
134
|
show_tree(full_path, next_prefix, show_code)
|
|
136
135
|
elif show_code and item.endswith(".py"):
|
|
@@ -159,7 +158,7 @@ if __name__ == "__main__":
|
|
|
159
158
|
parser.add_argument(
|
|
160
159
|
"--show-code",
|
|
161
160
|
action="store_true",
|
|
162
|
-
default=
|
|
161
|
+
default=False,
|
|
163
162
|
help="Shows functions, classes and attributes in .py files",
|
|
164
163
|
)
|
|
165
164
|
args = parser.parse_args()
|
|
@@ -172,4 +171,4 @@ if __name__ == "__main__":
|
|
|
172
171
|
print(f"{CLASS_SYMBOL} - Class")
|
|
173
172
|
print(f"{FUNC_SYMBOL} - Function/Method")
|
|
174
173
|
print(f"{ATTR_SYMBOL} - Attribute")
|
|
175
|
-
|
|
174
|
+
print(args)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# file generated by vcs-versioning
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"__version__",
|
|
7
|
+
"__version_tuple__",
|
|
8
|
+
"version",
|
|
9
|
+
"version_tuple",
|
|
10
|
+
"__commit_id__",
|
|
11
|
+
"commit_id",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
version: str
|
|
15
|
+
__version__: str
|
|
16
|
+
__version_tuple__: tuple[int | str, ...]
|
|
17
|
+
version_tuple: tuple[int | str, ...]
|
|
18
|
+
commit_id: str | None
|
|
19
|
+
__commit_id__: str | None
|
|
20
|
+
|
|
21
|
+
__version__ = version = '0.2.5'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 2, 5)
|
|
23
|
+
|
|
24
|
+
__commit_id__ = commit_id = 'g911e64e2d'
|
|
@@ -24,7 +24,7 @@ def validate_config(config: ConfigParameterManager) -> bool:
|
|
|
24
24
|
"""
|
|
25
25
|
# Initialize logging system
|
|
26
26
|
logger_manager = initialize_logging(config)
|
|
27
|
-
logger = logger_manager.get_logger("
|
|
27
|
+
logger = logger_manager.get_logger("cli")
|
|
28
28
|
|
|
29
29
|
# Get CLI category and check required parameters
|
|
30
30
|
cli_category = config.cli
|
|
@@ -59,7 +59,7 @@ def run_main_processing(config: ConfigParameterManager) -> int:
|
|
|
59
59
|
"""
|
|
60
60
|
# Initialize logging system
|
|
61
61
|
logger_manager = initialize_logging(config)
|
|
62
|
-
logger = logger_manager.get_logger("
|
|
62
|
+
logger = logger_manager.get_logger("cli")
|
|
63
63
|
|
|
64
64
|
try:
|
|
65
65
|
# Log startup information
|
|
@@ -167,14 +167,18 @@ class ConfigParameterManager(ConfigManager): # Inherit from ConfigManager
|
|
|
167
167
|
categories = (CliConfig(), AppConfig(), GuiConfig())
|
|
168
168
|
super().__init__(categories, config_file, **kwargs)
|
|
169
169
|
|
|
170
|
+
@staticmethod
|
|
171
|
+
def get_app_name() -> str:
|
|
172
|
+
return "python_template_project"
|
|
173
|
+
|
|
170
174
|
|
|
171
175
|
def main():
|
|
172
176
|
"""Main function to generate config file and documentation."""
|
|
173
177
|
default_config: str = "config.yaml"
|
|
174
178
|
default_cli_doc: str = "docs/usage/cli.md"
|
|
175
179
|
default_config_doc: str = "docs/usage/config.md"
|
|
176
|
-
app_name = "python_template_project"
|
|
177
180
|
config_manager = ConfigParameterManager()
|
|
181
|
+
app_name = config_manager.get_app_name()
|
|
178
182
|
doc_gen = DocumentationGenerator(config_manager)
|
|
179
183
|
doc_gen.generate_default_config_file(output_file=default_config)
|
|
180
184
|
print(f"Generated: {default_config}")
|