Skip to content

Commit

Permalink
Init repo
Browse files Browse the repository at this point in the history
  • Loading branch information
mnako committed Jan 9, 2022
0 parents commit b6aed3c
Show file tree
Hide file tree
Showing 30 changed files with 1,403 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Continuous Integration"

on:
pull_request:

jobs:
test:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2

- name: "Set up Python"
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: "Set up PDM"
run: pip install --user pdm

- name: "Install Dependencies"
run: make install

- name: "Test Cookiecutter"
run: make test
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "Create Release"

on:
push:
tags:
- 'v*'

jobs:
build:
name: "Create Release"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v2

- name: "Create Release"
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: Auto-generate release notes
draft: true
prerelease: false
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.idea/
.mypy_cache/
.pdm.toml
.pytest_cache/
__pypackages__/
**/__pycache__/
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
install:
pdm install
pdm install --group dev

test:
pdm run pytest -vv tests

rm:
rm -rf .mypy_cache/ || true
rm -rf .pytest_cache/ || true
rm -rf __pypackages__/ || true
rm -rf tests/__pycache__/ || true
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# cookiecutter-docker-python-pdm

![CI Status](https://github.com/mnako/cookiecutter-docker-python-pdm/workflows/ci/badge.svg)

A template for a Python project with a disposable, Docker-contained development
environment.

This cookiecutter gives you a Python 3.10 development environment with nice
defaults:

* Python 3.10 with PDM package manager
* Pytest tests with a required coverage;
* Mypy tests
* Black formatter
* Dev Docker image
* Production Docker image
* CI/CD using Github actions

and depends on Docker and Makefile only.

## Quickstart

You can generate a new project by:

pip install cookiecutter
cookiecutter gh:mnako/cookiecutter-docker-python-pdm
4 changes: 4 additions & 0 deletions cookiecutter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"github_username": "mnako",
"project_name": "projectname"
}
8 changes: 8 additions & 0 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import os


os.system("make build-dev")
os.system("make install-dev-deps")
os.system("make format")
os.system("make test")
os.system("cat README.md")
Loading

0 comments on commit b6aed3c

Please sign in to comment.