forked from cjolowicz/nox-poetry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hypermodern Python Cookiecutter 2020.5.15
- Loading branch information
Showing
37 changed files
with
2,087 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[darglint] | ||
strictness = short |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: . |
Oops, something went wrong.