Skip to content

Commit 54dd8e5

Browse files
author
Gerd Aschbrenner
committed
#1 first draft
1 parent 5a17295 commit 54dd8e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2414
-46
lines changed

.envrc

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@ PATH_add "${VIRTUAL_ENV}/bin"
1919
export VENV_ACTIVE=1
2020
export VIRTUAL_ENV
2121

22-
## For simple IDE integration as default python with test dependencies
23-
ln -vfns "${VIRTUAL_ENV}" venv
22+
log_status "IDE integration: Point your IDE to Python in : ${VIRTUAL_ENV}"

.github/dependabot.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
version: 2
3+
updates:
4+
# Maintain dependencies for GitHub Actions
5+
- package-ecosystem: 'github-actions'
6+
directory: '/'
7+
schedule:
8+
interval: 'weekly'
9+
groups:
10+
actions:
11+
patterns:
12+
- '*'

.github/workflows/feature-branch.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
name: 'feature-branch-workflow'
3+
on: # yamllint disable-line rule:truthy
4+
pull_request:
5+
push:
6+
branches-ignore:
7+
- 'main'
8+
- 'develop'
9+
- 'support/**'
10+
jobs:
11+
lint:
12+
name: 'lint'
13+
runs-on: 'ubuntu-22.04'
14+
steps:
15+
- uses: 'actions/checkout@v4'
16+
- uses: 'actions/setup-python@v5'
17+
with:
18+
python-version: '3.12'
19+
- name: 'Install hatch'
20+
run: 'pipx install hatch~=1.12.0'
21+
- name: 'Lint'
22+
run: 'hatch fmt --check'
23+
test:
24+
needs:
25+
- 'lint'
26+
name: "test"
27+
runs-on: 'ubuntu-22.04'
28+
steps:
29+
- uses: 'actions/checkout@v4'
30+
- name: 'Set up Python ${{ matrix.python-version }}'
31+
uses: 'actions/setup-python@v5'
32+
with:
33+
python-version: '3.12'
34+
- name: 'Install hatch'
35+
run: 'pipx install hatch~=1.12.0'
36+
- name: 'Test'
37+
run: 'hatch test --all --cover'
38+
- name: 'Collect coverage'
39+
uses: 'romeovs/lcov-reporter-action@v0.4.0'
40+
with:
41+
lcov-file: 'lcov.info'
42+
- name: 'Build App'
43+
run: 'hatch build'
44+
- uses: 'actions/upload-artifact@v4'
45+
with:
46+
name: 'module'
47+
path: 'dist/jinja_file_renderer-*.tar.gz'
48+
compression-level: 0 # no compression
49+
if-no-files-found: 'error'
50+
retention-days: 5
51+
- uses: 'actions/upload-artifact@v4'
52+
with:
53+
name: 'wheel'
54+
path: 'dist/jinja_file_renderer-*.whl'
55+
compression-level: 0 # no compression
56+
if-no-files-found: 'error'
57+
retention-days: 5
58+
- name: 'Build Docs'
59+
run: 'hatch run mkdocs:build-archive'
60+
- uses: 'actions/upload-artifact@v4'
61+
with:
62+
name: 'documentation'
63+
path: 'jinja-file-renderer-doc-*.tar.xz'
64+
compression-level: 0 # no compression
65+
if-no-files-found: 'error'
66+
retention-days: 5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: 'label-opened-issue-with-triage'
3+
on: # yamllint disable-line rule:truthy
4+
issues:
5+
types:
6+
- 'opened'
7+
jobs:
8+
issue_add_label_triage:
9+
runs-on: 'ubuntu-latest'
10+
steps:
11+
- env:
12+
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}' # This token is provided automatically by Actions.
13+
ISSUE_URL: '${{ github.event.issue.html_url }}'
14+
run: 'gh issue edit ${ISSUE_URL} --add-label "triage"'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
name: 'publish-release-candidate'
3+
on: # yamllint disable-line rule:truthy
4+
push:
5+
branches:
6+
- 'develop'
7+
- 'release/**'
8+
jobs:
9+
lint:
10+
name: 'lint'
11+
runs-on: 'ubuntu-22.04'
12+
steps:
13+
- uses: 'actions/checkout@v4'
14+
- uses: 'actions/setup-python@v5'
15+
with:
16+
python-version: '3.12'
17+
- name: 'Install hatch'
18+
run: 'pipx install hatch~=1.12.0'
19+
- name: 'Lint'
20+
run: 'hatch fmt --check'
21+
test:
22+
needs:
23+
- 'lint'
24+
name: "test"
25+
runs-on: 'ubuntu-22.04'
26+
steps:
27+
- uses: 'actions/checkout@v4'
28+
- name: 'Set up Python ${{ matrix.python-version }}'
29+
uses: 'actions/setup-python@v5'
30+
with:
31+
python-version: '3.12'
32+
- name: 'Install hatch'
33+
run: 'pipx install hatch~=1.12.0'
34+
- name: 'Test'
35+
run: 'hatch test --all --cover'
36+
- name: 'Collect coverage'
37+
uses: 'romeovs/lcov-reporter-action@v0.4.0'
38+
with:
39+
lcov-file: 'lcov.info'
40+
build:
41+
needs:
42+
- 'test'
43+
name: "build"
44+
runs-on: 'ubuntu-22.04'
45+
steps:
46+
- uses: 'actions/checkout@v4'
47+
- uses: 'actions/setup-python@v5'
48+
with:
49+
python-version: '3.12'
50+
- name: 'Install hatch'
51+
run: 'pipx install hatch~=1.12.0'
52+
- name: 'Get commit date'
53+
id: 'get_commit_date'
54+
run: 'echo "::set-output name=date::$(git show --no-patch --format=%cI ${{ github.ref }})"'
55+
- name: 'get version via hatch'
56+
run: 'echo "VERSION=$(hatch version)" >> ${GITHUB_ENV}'
57+
- name: 'Build App'
58+
run: 'hatch build'
59+
- uses: 'actions/upload-artifact@v4'
60+
with:
61+
name: 'dist'
62+
path: './dist/'
63+
if-no-files-found: 'error'
64+
retention-days: 5
65+
- name: 'Build Doc'
66+
run: 'hatch run mkdocs:build-archive'
67+
- uses: 'actions/upload-artifact@v4'
68+
with:
69+
name: 'documentation'
70+
path: 'jinja-file-renderer-doc-*.tar.xz'
71+
compression-level: 0 # no compression
72+
if-no-files-found: 'error'
73+
retention-days: 5
74+
pypi-test-publish:
75+
needs:
76+
- 'build'
77+
name: 'Upload release to test-PyPI'
78+
runs-on: 'ubuntu-latest'
79+
environment:
80+
name: 'release-candidate'
81+
url: 'https://test.pypi.org/p/jinja-file-renderer'
82+
permissions:
83+
id-token: 'write' # IMPORTANT: this permission is mandatory for trusted publishing
84+
steps:
85+
- name: 'Get artifact "dist"'
86+
uses: 'actions/download-artifact@v4'
87+
with:
88+
name: 'dist'
89+
- run: 'ls -lah .'
90+
- name: 'Publish package distributions to Test-PyPI'
91+
uses: 'pypa/gh-action-pypi-publish@release/v1'
92+
with:
93+
print-hash: true
94+
github-release-draft:
95+
needs:
96+
- 'pypi-test-publish'
97+
name: 'Create GitHub Release Draft'
98+
runs-on: 'ubuntu-latest'
99+
steps:
100+
- name: 'Create GitHub Release Draft'
101+
uses: 'actions/create-release@v1'
102+
env:
103+
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' # This token is provided automatically by Actions.
104+
with:
105+
tag_name: 'v${VERSION}'
106+
release_name: '[DRAFT] Release ${VERSION} (${{ steps.get_commit_date.outputs.date }})'
107+
body: |-
108+
Documentation: https://jinja-file-renderer.readthedocs.io/v${VERSION}
109+
Artifacts: https://test.pypi.org/project/jinja-file-renderer/${VERSION}/
110+
draft: true
111+
prerelease: false

.github/workflows/publish-release.yml

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
---
2+
name: 'publish-release'
3+
on: # yamllint disable-line rule:truthy
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+*'
7+
jobs:
8+
lint:
9+
name: 'lint'
10+
runs-on: 'ubuntu-22.04'
11+
steps:
12+
- uses: 'actions/checkout@v4'
13+
- uses: 'actions/setup-python@v5'
14+
with:
15+
python-version: '3.12'
16+
- name: 'Install hatch'
17+
run: 'pipx install hatch~=1.12.0'
18+
- name: 'Lint'
19+
run: 'hatch fmt --check'
20+
test:
21+
needs:
22+
- 'lint'
23+
name: "test"
24+
runs-on: 'ubuntu-22.04'
25+
steps:
26+
- uses: 'actions/checkout@v4'
27+
- name: 'Set up Python ${{ matrix.python-version }}'
28+
uses: 'actions/setup-python@v5'
29+
with:
30+
python-version: '3.12'
31+
- name: 'Install hatch'
32+
run: 'pipx install hatch~=1.12.0'
33+
- name: 'Test'
34+
run: 'hatch test --all --cover'
35+
- name: 'Collect coverage'
36+
uses: 'romeovs/lcov-reporter-action@v0.4.0'
37+
with:
38+
lcov-file: 'lcov.info'
39+
build:
40+
needs:
41+
- 'test'
42+
name: "build"
43+
runs-on: 'ubuntu-22.04'
44+
steps:
45+
- uses: 'actions/checkout@v4'
46+
- uses: 'actions/setup-python@v5'
47+
with:
48+
python-version: '3.12'
49+
- name: 'Install hatch'
50+
run: 'pipx install hatch~=1.12.0'
51+
- name: 'Get tag date'
52+
id: 'get_tag_date'
53+
run: 'echo "::set-output name=date::$(git log -1 --format=%aI ${{ github.ref }})"'
54+
- name: 'get version via hatch and validate with tag'
55+
run: |-
56+
VERSION_VIA_HATCH="$(hatch version)"
57+
VERSION_VIA_GITHUB="${{ github.ref }}"
58+
if [ "v${VERSION_VIA_HATCH}" != "${VERSION_VIA_GITHUB}" ]
59+
then
60+
echo "Projects version (hatch version -> ${VERSION_VIA_HATCH} does not match the version of git tagging"\
61+
"(${VERSION_VIA_GITHUB}). Please fix the version in the code and try again.)" >&2
62+
fi
63+
echo "VERSION=${VERSION_VIA_HATCH}" >> ${GITHUB_ENV}
64+
- name: 'Build'
65+
run: 'hatch build'
66+
- uses: 'actions/upload-artifact@v4'
67+
with:
68+
name: 'dist'
69+
path: './dist/'
70+
if-no-files-found: 'error'
71+
- name: 'Build Doc'
72+
run: 'hatch run mkdocs:build-archive'
73+
- uses: 'actions/upload-artifact@v4'
74+
with:
75+
name: 'documentation'
76+
path: 'jinja-file-renderer-doc-*.tar.xz'
77+
compression-level: 0 # no compression
78+
if-no-files-found: 'error'
79+
pypi-publish:
80+
needs:
81+
- 'build'
82+
name: 'Upload release to test-PyPI'
83+
runs-on: 'ubuntu-latest'
84+
environment:
85+
name: 'release'
86+
url: 'https://pypi.org/p/jinja-file-renderer'
87+
permissions:
88+
id-token: 'write' # IMPORTANT: this permission is mandatory for trusted publishing
89+
steps:
90+
- name: 'Get artifact "dist"'
91+
uses: 'actions/download-artifact@v4'
92+
with:
93+
name: 'dist'
94+
- run: 'ls -lah .'
95+
- name: 'Publish package distributions to Test-PyPI'
96+
uses: 'pypa/gh-action-pypi-publish@release/v1'
97+
with:
98+
print-hash: true
99+
github-release:
100+
needs:
101+
- 'pypi-publish'
102+
name: 'Create GitHub Release'
103+
runs-on: 'ubuntu-latest'
104+
steps:
105+
- name: 'Create GitHub Release Draft'
106+
uses: 'actions/create-release@v1'
107+
env:
108+
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' # This token is provided automatically by Actions.
109+
with:
110+
tag_name: 'v${VERSION}'
111+
release_name: 'Release ${VERSION} (${{ steps.get_tag_date.outputs.date }})'
112+
body: |-
113+
Documentation: https://jinja-file-renderer.readthedocs.io/v${VERSION}
114+
Artifacts: https://pypi.org/project/jinja-file-renderer/${VERSION}/
115+
draft: false
116+
prerelease: false

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/.vscode/
1313
/.history/
1414

15-
## Softlink to hatch env (see .envrc), or directory of a venv.
15+
## Optional created / used Python venv. You do not need it that way when using hatch.
1616
/venv
1717

1818
## Python build artifacts (hatch build)
@@ -37,3 +37,4 @@ __pycache__/
3737

3838
## mkbuilds generated site (hatch run mkdocs build)
3939
/site/
40+
/jinja-file-renderer-doc-*.tar.xz

.yamllint.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
## See https://yamllint.readthedocs.io/en/stable/configuration.html
3+
extends: default
4+
5+
rules:
6+
line-length:
7+
## Default is 80, we want more
8+
max: 120

LICENSE

+1-15
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
1-
jinja-file-renderer - A tool for copying a directory, during which *.jinja
2-
files are rendered via Jinja2.
1+
jinja-file-renderer - A tool for copying a directory, during which *.jinja files are rendered via Jinja2.
32
Copyright (C) 2024 Gerd Aschbrenner
43

5-
This program is free software: you can redistribute it and/or modify
6-
it under the terms of the GNU Affero General Public License as published by
7-
the Free Software Foundation, either version 3 of the License, or
8-
(at your option) any later version.
9-
10-
This program is distributed in the hope that it will be useful,
11-
but WITHOUT ANY WARRANTY; without even the implied warranty of
12-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13-
GNU Affero General Public License for more details.
14-
15-
You should have received a copy of the GNU Affero General Public License
16-
along with this program. If not, see <https://www.gnu.org/licenses/>.
17-
184
This file is part of 'jinja-file-renderer'.
195

206
'jinja-file-renderer' is free software: you can redistribute it and/or modify

README.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22
A tool for copying a directory, during which *.jinja files are rendered via Jinja2.
33

44
This is the git repository of the project, please see the official documentation on:
5-
https://readthedocs.org/projects/jinja-file-renderer/
5+
https://jinja-file-renderer.readthedocs.io/
66

77
If the link to the documentation does not work, you can create it locally by running:
88
```shell
9+
pipx install hatch~=1.12.0
910
hatch run mkdocs:serve
1011
```
11-
12-
## License
13-
`jinja-file-renderer` is distributed under the terms of the
14-
[GNU Affero General Public License v3 or later (AGPLv3+)](LICENSE) license. see details [agpl-3.0.md](agpl-3.0.md).

docs/about/release-notes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Release Notes
22

33
## 1.0.0
4-
First public Release
4+
First public release

0 commit comments

Comments
 (0)