Skip to content

Commit a36dd03

Browse files
committed
Merge branch 'main' into main-github
2 parents c987e54 + f786359 commit a36dd03

26 files changed

Lines changed: 382 additions & 298 deletions

File tree

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "template/{% if docs_template == 'sphinx-fhg-iis' %}docs{% endif %}"]
2+
path = "template/{% if docs_template == 'sphinx-fhg-iis' %}docs{% endif %}"
3+
url = https://git01.iis.fhg.de/mkj/sphinx_template

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ repos:
1212
hooks:
1313
- id: prettier
1414
types_or: [json, yaml, css, javascript]
15+
pass_filenames: false
1516
# black should have the final say on python formatting, so it comes last
1617
- repo: https://github.com/psf/black
1718
rev: 23.9.1
@@ -22,7 +23,7 @@ repos:
2223
hooks:
2324
- id: pytest
2425
name: pytest
25-
entry: pytest -n auto -m "not slow"
26+
entry: make test
2627
language: system
2728
pass_filenames: false
2829
files: "^template/"

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [unreleased]
99

10+
### Added
11+
12+
- github ci now runs tests, collects coverage and creates maintainability and coverage badges
13+
- add [sphinx_template](https://git01.iis.fhg.de/sch/sphinx_template/) as an option when choosing sphinx for documentation
14+
15+
### Changed
16+
17+
- template now uses a static documentation badge provided by shields.io
18+
19+
### Fixed
20+
21+
- link to pipeline in README now correctly links to github actions
22+
- when bumpversion is selected, add `bump2version` to dev dependencies
23+
1024
## [0.0.2] - 2023-09-19
1125

1226
### Added

Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ DOC_EXAMPLES = docs/examples/mkdocs docs/examples/sphinx docs/examples/default d
1010
examples: ## build all published examples
1111
examples: $(PUBLISHED_EXAMPLES)
1212

13-
COPIER_ARGS?=--trust
13+
COPIER_ARGS?=--trust --vcs-ref=HEAD
1414
COPIER_DEFAULT_VALUES=-d "project_name=Sample Project" -d "package_name=sample_project"
1515
build/examples/%: COPIER_DEFAULT_VALUES += --defaults
1616
build/examples/%: EXAMPLE_DIR:=$@
@@ -99,10 +99,12 @@ spellcheck-dump: ## save all flagged words to project terms dictionary
9999

100100

101101
.PHONY: test
102-
PYTEST_ARGS=-n auto
103-
test: ## run tests quickly
102+
PYTEST_ARGS?=
103+
test: ## run some tests
104+
test: build-clean copy-template
104105
pytest ${PYTEST_ARGS} -m "not slow"
105106
test-all: ## run all tests
107+
test-all: build-clean copy-template
106108
pytest ${PYTEST_ARGS}
107109

108110

@@ -123,7 +125,7 @@ copy-template:
123125
@cp -r ${TEMPLATE_SRC} ${TEMPLATE_DEST}
124126
@cp copier.yaml ${PKGDIR}/.
125127
build-clean: ## remove build artifacts
126-
rm -rf ${BUILDDIR} ${PKGDIR}/template ${PKGDIR}/copier.yaml
128+
@rm -rf ${BUILDDIR} ${PKGDIR}/template ${PKGDIR}/copier.yaml
127129

128130
.PHONY: release release-test release-tag release-pypi release-github
129131
release: release-test release-tag build release-pypi release-github

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div align=center>
22
<h1>Python Project Template</h1>
33

4-
[![](https://img.shields.io/badge/python-3.11-blue)][sample project]
4+
[![](https://img.shields.io/badge/Documentation-main-blue)][docs]
55
[![](https://img.shields.io/badge/Example-Sample_Project-blue)][sample project]
66
[![PyPI - Version](https://img.shields.io/pypi/v/init-python-project)][pypi]
77

@@ -63,6 +63,7 @@ init-python-project <name of project>
6363

6464
The first part of the user guide consists of tutorials on how to answer the template questions for [Your First Project][], what [Next Steps][] there are after your project is created and why the [Project Structure][] looks like it does.
6565

66+
[docs]: https://jannismain.github.io/python-project-template/
6667
[your first project]: https://jannismain.github.io/python-project-template/user-guide/first-project
6768
[next steps]: https://jannismain.github.io/python-project-template/user-guide/first-project
6869
[project structure]: https://jannismain.github.io/python-project-template/user-guide/project-structure

copier.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,17 @@ docs:
9898
9999
If you are not sure which one to use, simply go with the default 😉.
100100
101+
docs_template:
102+
type: str
103+
choices:
104+
Fraunhofer IIS Sphinx Template: sphinx-fhg-iis
105+
None: none
106+
default: "none"
107+
when: "{{ docs == 'sphinx' }}"
108+
help: Which documentation template do you want to use?
109+
explanation: |
110+
See [Fraunhofer IIS Sphinx Template](https://git01.iis.fhg.de/sch/sphinx_template/).
111+
101112
remote:
102113
choices:
103114
GitHub: github

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "init-python-project"
7-
description = "A python project generator based on copier."
7+
description = "A python project generator."
88
readme = "README.md"
99
requires-python = ">=3.11"
1010
authors = [{ name = "Jannis Mainczyk", email = "jmainczyk@gmail.com" }]
@@ -50,9 +50,10 @@ init-python-project = "init_python_project.cli:app"
5050

5151
[tool.pytest.ini_options]
5252
minversion = "6.0"
53-
addopts = "-ra -q"
53+
addopts = "-ra -q -n auto --exitfirst"
5454
testpaths = ["tests"]
5555
markers = ["slow"]
56+
filterwarnings = ["ignore::copier.vcs.DirtyLocalWarning"]
5657

5758
[tool.black]
5859
line-length = 100

src/init_python_project/copier.yaml

Lines changed: 0 additions & 170 deletions
This file was deleted.

template/Makefile.jinja

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.PHONY: install-dev
22
install-dev: ## install project including all development dependencies
3-
pip install -e .[test,doc,dev]
3+
pip install -e .[test,dev]
4+
pip install -r docs/requirements.txt
45

56
.PHONY: maintainability
67
maintainability: ## run maintainability checks
@@ -35,7 +36,7 @@ docs-live: ## serve documentation
3536
{%- if docs == 'mkdocs' %}
3637
mkdocs serve
3738
{%- elif docs == 'sphinx' %}
38-
sphinx-autobuild docs ${DOCS_TARGET}/livehtml
39+
cd docs && $(MAKE) serve
3940
{% endif %}
4041

4142
{% endif %}

template/README.md.jinja

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22

33
{%- import 'template/context' as ctx with context %}
44

5-
[![documentation][badge_documentation]]({{ctx.remote_url_pages}}) [![badge_pipeline][]]({{ctx.remote_url_https}}/-/pipelines) [![badge_coverage][]]({{ctx.remote_url_pages}}/coverage) [![badge_maintainability][]]()
6-
7-
[badge_documentation]: {{ctx.remote_url_pages}}/badges/documentation.svg
8-
[badge_coverage]: {{ctx.remote_url_https}}/badges/{{default_branch}}/coverage.svg
9-
[badge_pipeline]: {{ctx.remote_url_https}}/badges/{{default_branch}}/pipeline.svg
5+
[![badge_documentation][]][documentation] [![badge_pipeline][]][pipeline] [![badge_coverage][]][coverage] [![badge_maintainability][]]()
6+
7+
[documentation]: {{ctx.remote_url_pages}}
8+
[badge_documentation]: https://img.shields.io/badge/Documentation-{{default_branch}}-blue
9+
[coverage]: {{ctx.remote_url_pages}}/coverage
10+
[badge_coverage]: {{ctx.remote_url_coverage_badge}}
11+
[badge_pipeline]: {{ctx.remote_url_pipeline_badge}}
12+
[pipeline]: {{ctx.remote_url_pipeline}}
1013
[badge_maintainability]: {{ctx.remote_url_pages}}/badges/maintainability.svg
1114

1215
<!-- TODO: extend readme template -->

0 commit comments

Comments
 (0)