Skip to content

Commit

Permalink
Hypermodern Python Cookiecutter 2020.5.15
Browse files Browse the repository at this point in the history
  • Loading branch information
cjolowicz committed May 21, 2020
1 parent 246de89 commit eda056f
Show file tree
Hide file tree
Showing 37 changed files with 2,087 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .cookiecutter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"_template": "gh:cjolowicz/cookiecutter-hypermodern-python",
"author": "Claudio Jolowicz",
"email": "[email protected]",
"friendly_name": "nox-poetry",
"github_user": "cjolowicz",
"package_name": "nox_poetry",
"project_name": "nox-poetry",
"version": "0.1.0"
}
2 changes: 2 additions & 0 deletions .darglint
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[darglint]
strictness = short
26 changes: 26 additions & 0 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: 1
update_configs:
- package_manager: "python"
directory: "/"
update_schedule: "daily"
allowed_updates:
- match:
update_type: "all"
- package_manager: "python"
directory: "/docs"
update_schedule: "daily"
allowed_updates:
- match:
update_type: "all"
- package_manager: "python"
directory: "/.github/workflows"
update_schedule: "daily"
allowed_updates:
- match:
update_type: "all"
- package_manager: "github_actions"
directory: "/"
update_schedule: "daily"
allowed_updates:
- match:
update_type: "all"
7 changes: 7 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[flake8]
select = B,B9,C,D,DAR,E,F,N,RST,S,W
ignore = E203,E501,W503
max-line-length = 80
max-complexity = 10
docstring-convention = google
per-file-ignores = tests/*:S101
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
29 changes: 29 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
categories:
- title: ":boom: Breaking Changes"
label: "breaking"
- title: ":rocket: Features"
label: "enhancement"
- title: ":fire: Removals and Deprecations"
label: "removal"
- title: ":beetle: Fixes"
label: "bug"
- title: ":racehorse: Performance"
label: "performance"
- title: ":rotating_light: Testing"
label: "testing"
- title: ":construction_worker: Continuous Integration"
label: "ci"
- title: ":books: Documentation"
label: "documentation"
- title: ":hammer: Refactoring"
label: "refactoring"
- title: ":lipstick: Style"
label: "style"
- title: ":package: Dependencies"
labels:
- "dependencies"
- "build"
template: |
## Changes
$CHANGES
3 changes: 3 additions & 0 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pip==20.1
nox==2019.11.9
poetry==1.0.5
16 changes: 16 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Coverage
on: [push, pull_request]
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip install --constraint=.github/workflows/constraints.txt nox poetry
- run: nox --force-color --session=tests-3.8 -- --cov --cov-report=xml
- if: always()
uses: codecov/[email protected]
18 changes: 18 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build documentation
on: [push, pull_request]
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip install --constraint=.github/workflows/constraints.txt nox poetry
- run: nox --force-color --session=docs
- uses: actions/upload-artifact@v2
with:
name: docs
path: docs/_build
12 changes: 12 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Release Drafter
on:
push:
branches:
- master
jobs:
draft_release:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release
on:
release:
types: [published]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip install --constraint=.github/workflows/constraints.txt nox poetry
- name: Compute cache key prefix
if: matrix.os != 'windows-latest'
id: cache_key_prefix
shell: python
run: |
import hashlib
import sys
python = "py{}.{}".format(*sys.version_info[:2])
payload = sys.version.encode() + sys.executable.encode()
digest = hashlib.sha256(payload).hexdigest()
result = "${{ runner.os }}-{}-{}-pre-commit".format(python, digest[:8])
print("::set-output name=result::{}".format(result))
- uses: actions/[email protected]
if: matrix.os != 'windows-latest'
with:
path: ~/.cache/pre-commit
key: ${{ steps.cache_key_prefix.outputs.result }}-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ steps.cache_key_prefix.outputs.result }}-
- run: nox --force-color
- run: poetry build --ansi
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/test-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: TestPyPI
on:
push:
branches:
- master
jobs:
test_pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip install --constraint=.github/workflows/constraints.txt poetry
- run: >-
poetry version patch &&
version=$(poetry version | awk '{print $2}') &&
poetry version $version.dev.$(date +%s)
- run: poetry build --ansi
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
45 changes: 45 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Tests
on: [push, pull_request]
jobs:
tests:
strategy:
fail-fast: false
matrix:
include:
- { python-version: 3.8, os: ubuntu-latest }
- { python-version: 3.8, os: windows-latest }
- { python-version: 3.8, os: macos-latest }
- { python-version: 3.7, os: ubuntu-latest }
- { python-version: 3.6, os: ubuntu-latest }
runs-on: ${{ matrix.os }}
name: Python ${{ matrix.python-version }} (${{ matrix.os }})
steps:
- uses: actions/[email protected]
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Compute cache key prefix
if: matrix.os != 'windows-latest'
id: cache_key_prefix
shell: python
run: |
import hashlib
import sys
python = "py{}.{}".format(*sys.version_info[:2])
payload = sys.version.encode() + sys.executable.encode()
digest = hashlib.sha256(payload).hexdigest()
result = "${{ runner.os }}-{}-{}-pre-commit".format(python, digest[:8])
print("::set-output name=result::{}".format(result))
- uses: actions/[email protected]
if: matrix.os != 'windows-latest'
with:
path: ~/.cache/pre-commit
key: ${{ steps.cache_key_prefix.outputs.result }}-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ steps.cache_key_prefix.outputs.result }}-
- run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip install --constraint=.github/workflows/constraints.txt nox poetry
- run: nox --force-color
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.mypy_cache/
/.coverage
/.nox/
/.python-version
/.pytype/
/dist/
/docs/_build/
/src/*.egg-info/
__pycache__/
33 changes: 33 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.0.0
hooks:
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files
- repo: https://github.com/prettier/prettier
rev: 2.0.5
hooks:
- id: prettier
- repo: https://github.com/psf/black
rev: 19.10b0
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.1
hooks:
- id: flake8
additional_dependencies:
- flake8-bandit==2.1.2
- flake8-bugbear==20.1.4
- flake8-docstrings==1.5.0
- flake8-rst-docstrings==0.0.13
- pep8-naming==0.10.0
- darglint==1.3.0
- repo: https://github.com/asottile/reorder_python_imports
rev: v2.3.0
hooks:
- id: reorder-python-imports
args: [--application-directories=src]
9 changes: 9 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
sphinx:
configuration: docs/conf.py
formats: all
python:
version: 3.8
install:
- requirements: docs/requirements.txt
- path: .
Loading

0 comments on commit eda056f

Please sign in to comment.