Skip to content

Commit

Permalink
Merge pull request #8 from ilbumi/dev
Browse files Browse the repository at this point in the history
Release 1.0.0
  • Loading branch information
ilbumi authored Aug 20, 2023
2 parents c13aaea + dc1a6a5 commit e6c8ddc
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
26 changes: 25 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,28 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!-- insertion marker -->
<!-- insertion marker -->
## [1.0.0](https://github.com/ilbumi/copier-python-vscode/releases/tag/1.0.0) - 2023-08-20

<small>[Compare with first commit](https://github.com/ilbumi/copier-python-vscode/compare/0.1.0...1.0.0)</small>

### Features

- Add pre-commit hooks
- Add VSCode Dev Containers support
- Add semi-automatic changelog generation


## [0.1.0](https://github.com/ilbumi/copier-python-vscode/releases/tag/0.1.0) - 2023-08-20

<small>[Compare with first commit](https://github.com/ilbumi/copier-python-vscode/compare/946c697f571f5a4e7c0df91c70607b3c931e8157...0.1.0)</small>

### Features

- Add PDM project config
- Add basic static code analysis (ruff, bandit, safety)
- Add basic formatting (black, ssort, isort)
- Add basic tests (pytest, coverage)
- Add basic GitHub Workflows
- Add nox as a task runner
- Add LICENSE generation
7 changes: 6 additions & 1 deletion copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,9 @@ python_package_import_name:
python_package_command_line_name:
type: str
help: Your CLI name if any (for use in the shell)
default: "{{ project_name | slugify }}"
default: "{{ project_name | slugify }}"

docker_base_image:
type: str
help: Base image for the dev container. Edit Dockerfile.dev if your image is not ubuntu-based or have no python installed.
default: "python:3.11"
12 changes: 12 additions & 0 deletions project/.devcontainer/Dockerfile.dev.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ARG BASE_IMAGE={{ docker_base_image }}
FROM ${BASE_IMAGE}
RUN apt-get update \
&& apt-get install build-essential git gcc -y \
&& apt-get clean

RUN pip install -U pip setuptools wheel
RUN pip install pdm

RUN mkdir /data

CMD ""
23 changes: 23 additions & 0 deletions project/.devcontainer/devcontainer.json.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
"name": "Development docker containers",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/app",
"shutdownAction": "stopCompose",
"overrideCommand": true,
"customizations": {
"vscode": {
"extensions": [
"vivaxy.vscode-conventional-commits",
"DavidAnson.vscode-markdownlint",
"ionutvmi.path-autocomplete",
"ms-python.vscode-pylance",
"ms-python.python",
"ms-python.black-formatter",
"charliermarsh.ruff"
]
}
}
}
11 changes: 11 additions & 0 deletions project/.devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: "3.8"

services:
app:
build:
context: ..
dockerfile: .devcontainer/Dockerfile.dev
command: "/bin/sh -c \"while sleep 1000; do :; done\""
user: "${UID}:${GID}"
volumes:
- "../:/app"
10 changes: 10 additions & 0 deletions project/noxfile.py.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,13 @@ def check_safety(session: Session) -> None:
"pdm", "export", "-f", "requirements", "-o", requirements.name, "--without-hashes", external=True
)
session.run("safety", "check", f"--file={requirements.name}", "--full-report")


@nox.session
def generate_changelog(session: Session) -> None:
"""Generate changelog from the commits. It should be reviewed and cleaned up by a human.

Args:
session (Session): nox session object
"""
session.run("git-changelog", "-Tbio", "CHANGELOG.md", "-c", "angular")
9 changes: 9 additions & 0 deletions project/setup_project.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

set -e

git init .
git add -A .
git commit -m "feat: init a repo"

pdm install
4 changes: 1 addition & 3 deletions tests/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,4 @@ copier copy --trust --defaults -r HEAD "${template}" "${DEST}" \
-d repository_provider="github.com"

pushd $DEST
git init .
git add -A .
git commit -m "feat: init a repo"
source setup_project.sh

0 comments on commit e6c8ddc

Please sign in to comment.