Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit ed3a4d7

Browse files
authored
Merge pull request #7 from ilbumi/add_changelog_generation
Add changelog generation and Dev Containers Support
2 parents 3616cb3 + 5207afb commit ed3a4d7

8 files changed

Lines changed: 79 additions & 4 deletions

File tree

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v2.3.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace

copier.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,9 @@ python_package_import_name:
120120
python_package_command_line_name:
121121
type: str
122122
help: Your CLI name if any (for use in the shell)
123-
default: "{{ project_name | slugify }}"
123+
default: "{{ project_name | slugify }}"
124+
125+
docker_base_image:
126+
type: str
127+
help: Base image for the dev container. Edit Dockerfile.dev if your image is not ubuntu-based or have no python installed.
128+
default: "python:3.11"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
ARG BASE_IMAGE={{ docker_base_image }}
2+
FROM ${BASE_IMAGE}
3+
RUN apt-get update \
4+
&& apt-get install build-essential git gcc -y \
5+
&& apt-get clean
6+
7+
RUN pip install -U pip setuptools wheel
8+
RUN pip install pdm
9+
10+
RUN mkdir /data
11+
12+
CMD ""
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
3+
{
4+
"name": "Development docker containers",
5+
"dockerComposeFile": "docker-compose.yml",
6+
"service": "app",
7+
"workspaceFolder": "/app",
8+
"shutdownAction": "stopCompose",
9+
"overrideCommand": true,
10+
"customizations": {
11+
"vscode": {
12+
"extensions": [
13+
"vivaxy.vscode-conventional-commits",
14+
"DavidAnson.vscode-markdownlint",
15+
"ionutvmi.path-autocomplete",
16+
"ms-python.vscode-pylance",
17+
"ms-python.python",
18+
"ms-python.black-formatter",
19+
"charliermarsh.ruff"
20+
]
21+
}
22+
}
23+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: "3.8"
2+
3+
services:
4+
app:
5+
build:
6+
context: ..
7+
dockerfile: .devcontainer/Dockerfile.dev
8+
command: "/bin/sh -c \"while sleep 1000; do :; done\""
9+
user: "${UID}:${GID}"
10+
volumes:
11+
- "../:/app"

project/noxfile.py.jinja

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,13 @@ def check_safety(session: Session) -> None:
7171
"pdm", "export", "-f", "requirements", "-o", requirements.name, "--without-hashes", external=True
7272
)
7373
session.run("safety", "check", f"--file={requirements.name}", "--full-report")
74+
75+
76+
@nox.session
77+
def generate_changelog(session: Session) -> None:
78+
"""Generate changelog from the commits. It should be reviewed and cleaned up by a human.
79+
80+
Args:
81+
session (Session): nox session object
82+
"""
83+
session.run("git-changelog", "-Tbio", "CHANGELOG.md", "-c", "angular")

project/setup_project.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
git init .
6+
git add -A .
7+
git commit -m "feat: init a repo"
8+
9+
pdm install

tests/setup.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,4 @@ copier copy --trust --defaults -r HEAD "${template}" "${DEST}" \
3434
-d repository_provider="github.com"
3535

3636
pushd $DEST
37-
git init .
38-
git add -A .
39-
git commit -m "feat: init a repo"
37+
source setup_project.sh

0 commit comments

Comments
 (0)