Skip to content

Commit 3ae9c06

Browse files
committed
Add Initial structure of the project.
0 parents  commit 3ae9c06

36 files changed

+2721
-0
lines changed

.cookiecutter.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"_template": "gh:cjolowicz/cookiecutter-hypermodern-python",
3+
"author": "Thomas D.",
4+
"email": "asteroide@domtombox.net",
5+
"friendly_name": "Hello Garden",
6+
"github_user": "asteroide",
7+
"package_name": "hello_garden",
8+
"project_name": "hello-garden",
9+
"version": "0.0.1"
10+
}

.darglint

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[darglint]
2+
strictness = short

.flake8

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[flake8]
2+
select = B,B9,C,D,DAR,E,F,N,RST,S,W
3+
ignore = E203,E501,RST201,RST203,RST301,W503
4+
max-line-length = 80
5+
max-complexity = 10
6+
docstring-convention = google
7+
per-file-ignores = tests/*:S101

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/dependabot.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
- package-ecosystem: pip
8+
directory: "/.github/workflows"
9+
schedule:
10+
interval: daily
11+
- package-ecosystem: pip
12+
directory: "/docs"
13+
schedule:
14+
interval: daily
15+
- package-ecosystem: pip
16+
directory: "/"
17+
schedule:
18+
interval: daily

.github/labels.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
# Labels names are important as they are used by Release Drafter to decide
3+
# regarding where to record them in changelog or if to skip them.
4+
#
5+
# The repository labels will be automatically configured using this file and
6+
# the GitHub Action https://github.com/marketplace/actions/github-labeler.
7+
- name: breaking
8+
description: Breaking Changes
9+
color: bfd4f2
10+
- name: bug
11+
description: Something isn't working
12+
color: d73a4a
13+
- name: build
14+
description: Build System and Dependencies
15+
color: bfdadc
16+
- name: ci
17+
description: Continuous Integration
18+
color: 4a97d6
19+
- name: dependencies
20+
description: Pull requests that update a dependency file
21+
color: 0366d6
22+
- name: documentation
23+
description: Improvements or additions to documentation
24+
color: 0075ca
25+
- name: duplicate
26+
description: This issue or pull request already exists
27+
color: cfd3d7
28+
- name: enhancement
29+
description: New feature or request
30+
color: a2eeef
31+
- name: github_actions
32+
description: Pull requests that update Github_actions code
33+
color: "000000"
34+
- name: good first issue
35+
description: Good for newcomers
36+
color: 7057ff
37+
- name: help wanted
38+
description: Extra attention is needed
39+
color: 008672
40+
- name: invalid
41+
description: This doesn't seem right
42+
color: e4e669
43+
- name: performance
44+
description: Performance
45+
color: "016175"
46+
- name: python
47+
description: Pull requests that update Python code
48+
color: 2b67c6
49+
- name: question
50+
description: Further information is requested
51+
color: d876e3
52+
- name: refactoring
53+
description: Refactoring
54+
color: ef67c4
55+
- name: removal
56+
description: Removals and Deprecations
57+
color: 9ae7ea
58+
- name: style
59+
description: Style
60+
color: c120e5
61+
- name: testing
62+
description: Testing
63+
color: b1fc6f
64+
- name: wontfix
65+
description: This will not be worked on
66+
color: ffffff

.github/release-drafter.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
categories:
2+
- title: ":boom: Breaking Changes"
3+
label: "breaking"
4+
- title: ":rocket: Features"
5+
label: "enhancement"
6+
- title: ":fire: Removals and Deprecations"
7+
label: "removal"
8+
- title: ":beetle: Fixes"
9+
label: "bug"
10+
- title: ":racehorse: Performance"
11+
label: "performance"
12+
- title: ":rotating_light: Testing"
13+
label: "testing"
14+
- title: ":construction_worker: Continuous Integration"
15+
label: "ci"
16+
- title: ":books: Documentation"
17+
label: "documentation"
18+
- title: ":hammer: Refactoring"
19+
label: "refactoring"
20+
- title: ":lipstick: Style"
21+
label: "style"
22+
- title: ":package: Dependencies"
23+
labels:
24+
- "dependencies"
25+
- "build"
26+
template: |
27+
## Changes
28+
29+
$CHANGES

.github/workflows/constraints.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pip==21.0
2+
nox==2020.12.31
3+
nox-poetry==0.7.1
4+
poetry==1.1.4
5+
virtualenv==20.4.0

.github/workflows/labeler.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Labeler
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
9+
jobs:
10+
labeler:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check out the repository
14+
uses: actions/checkout@v2.3.3
15+
16+
- name: Run Labeler
17+
uses: crazy-max/ghaction-github-labeler@v3.1.1
18+
with:
19+
skip-delete: true

.github/workflows/release.yml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
9+
jobs:
10+
release:
11+
name: Release
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out the repository
15+
uses: actions/checkout@v2.3.4
16+
with:
17+
fetch-depth: 2
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v2.2.1
21+
with:
22+
python-version: "3.9"
23+
24+
- name: Upgrade pip
25+
run: |
26+
pip install --constraint=.github/workflows/constraints.txt pip
27+
pip --version
28+
29+
- name: Install Poetry
30+
run: |
31+
pip install --constraint=.github/workflows/constraints.txt poetry
32+
poetry --version
33+
34+
- name: Check if there is a parent commit
35+
id: check-parent-commit
36+
run: |
37+
echo "::set-output name=sha::$(git rev-parse --verify --quiet HEAD^)"
38+
39+
- name: Detect and tag new version
40+
id: check-version
41+
if: steps.check-parent-commit.outputs.sha
42+
uses: salsify/action-detect-and-tag-new-version@v2.0.1
43+
with:
44+
version-command: |
45+
bash -o pipefail -c "poetry version | awk '{ print \$2 }'"
46+
47+
- name: Bump version for developmental release
48+
if: "! steps.check-version.outputs.tag"
49+
run: |
50+
poetry version patch &&
51+
version=$(poetry version | awk '{ print $2 }') &&
52+
poetry version $version.dev.$(date +%s)
53+
54+
- name: Build package
55+
run: |
56+
poetry build --ansi
57+
58+
- name: Publish package on PyPI
59+
if: steps.check-version.outputs.tag
60+
uses: pypa/gh-action-pypi-publish@v1.4.1
61+
with:
62+
user: __token__
63+
password: ${{ secrets.PYPI_TOKEN }}
64+
65+
- name: Publish package on TestPyPI
66+
if: "! steps.check-version.outputs.tag"
67+
uses: pypa/gh-action-pypi-publish@v1.4.1
68+
with:
69+
user: __token__
70+
password: ${{ secrets.TEST_PYPI_TOKEN }}
71+
repository_url: https://test.pypi.org/legacy/
72+
73+
- name: Publish the release notes
74+
uses: release-drafter/release-drafter@v5.13.0
75+
with:
76+
publish: ${{ steps.check-version.outputs.tag != '' }}
77+
tag: ${{ steps.check-version.outputs.tag }}
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/tests.yml

+141
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
name: Tests
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
tests:
9+
name: ${{ matrix.session }} ${{ matrix.python-version }} / ${{ matrix.os }}
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
- { python-version: 3.9, os: ubuntu-latest, session: "pre-commit" }
16+
- { python-version: 3.9, os: ubuntu-latest, session: "safety" }
17+
- { python-version: 3.9, os: ubuntu-latest, session: "mypy" }
18+
- { python-version: 3.8, os: ubuntu-latest, session: "mypy" }
19+
- { python-version: 3.7, os: ubuntu-latest, session: "mypy" }
20+
- { python-version: 3.6, os: ubuntu-latest, session: "mypy" }
21+
- { python-version: 3.9, os: ubuntu-latest, session: "tests" }
22+
- { python-version: 3.8, os: ubuntu-latest, session: "tests" }
23+
- { python-version: 3.7, os: ubuntu-latest, session: "tests" }
24+
- { python-version: 3.6, os: ubuntu-latest, session: "tests" }
25+
- { python-version: 3.9, os: windows-latest, session: "tests" }
26+
- { python-version: 3.9, os: macos-latest, session: "tests" }
27+
- { python-version: 3.9, os: ubuntu-latest, session: "typeguard" }
28+
- { python-version: 3.9, os: ubuntu-latest, session: "xdoctest" }
29+
- { python-version: 3.8, os: ubuntu-latest, session: "docs-build" }
30+
31+
env:
32+
NOXSESSION: ${{ matrix.session }}
33+
34+
steps:
35+
- name: Check out the repository
36+
uses: actions/checkout@v2.3.4
37+
38+
- name: Set up Python ${{ matrix.python-version }}
39+
uses: actions/setup-python@v2.2.1
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
43+
- name: Upgrade pip
44+
run: |
45+
pip install --constraint=.github/workflows/constraints.txt pip
46+
pip --version
47+
48+
- name: Install Poetry
49+
run: |
50+
pip install --constraint=.github/workflows/constraints.txt poetry
51+
poetry --version
52+
53+
- name: Install Nox
54+
run: |
55+
pip install --constraint=.github/workflows/constraints.txt nox nox-poetry
56+
nox --version
57+
58+
- name: Compute pre-commit cache key
59+
if: matrix.session == 'pre-commit'
60+
id: pre-commit-cache
61+
shell: python
62+
run: |
63+
import hashlib
64+
import sys
65+
66+
python = "py{}.{}".format(*sys.version_info[:2])
67+
payload = sys.version.encode() + sys.executable.encode()
68+
digest = hashlib.sha256(payload).hexdigest()
69+
result = "${{ runner.os }}-{}-{}-pre-commit".format(python, digest[:8])
70+
71+
print("::set-output name=result::{}".format(result))
72+
73+
- name: Restore pre-commit cache
74+
uses: actions/cache@v2.1.3
75+
if: matrix.session == 'pre-commit'
76+
with:
77+
path: ~/.cache/pre-commit
78+
key: ${{ steps.pre-commit-cache.outputs.result }}-${{ hashFiles('.pre-commit-config.yaml') }}
79+
restore-keys: |
80+
${{ steps.pre-commit-cache.outputs.result }}-
81+
82+
- name: Run Nox
83+
run: |
84+
nox --force-color --python=${{ matrix.python-version }}
85+
86+
- name: Upload coverage data
87+
if: always() && matrix.session == 'tests'
88+
uses: "actions/upload-artifact@v2.2.2"
89+
with:
90+
name: coverage-data
91+
path: ".coverage.*"
92+
93+
- name: Upload documentation
94+
if: matrix.session == 'docs-build'
95+
uses: actions/upload-artifact@v2.2.2
96+
with:
97+
name: docs
98+
path: docs/_build
99+
100+
coverage:
101+
runs-on: ubuntu-latest
102+
needs: tests
103+
steps:
104+
- name: Check out the repository
105+
uses: actions/checkout@v2.3.4
106+
107+
- name: Set up Python 3.9
108+
uses: actions/setup-python@v2.2.1
109+
with:
110+
python-version: 3.9
111+
112+
- name: Upgrade pip
113+
run: |
114+
pip install --constraint=.github/workflows/constraints.txt pip
115+
pip --version
116+
117+
- name: Install Poetry
118+
run: |
119+
pip install --constraint=.github/workflows/constraints.txt poetry
120+
poetry --version
121+
122+
- name: Install Nox
123+
run: |
124+
pip install --constraint=.github/workflows/constraints.txt nox nox-poetry
125+
nox --version
126+
127+
- name: Download coverage data
128+
uses: actions/download-artifact@v2.0.8
129+
with:
130+
name: coverage-data
131+
132+
- name: Combine coverage data and display human readable report
133+
run: |
134+
nox --force-color --session=coverage
135+
136+
- name: Create coverage report
137+
run: |
138+
nox --force-color --session=coverage -- xml
139+
140+
- name: Upload coverage report
141+
uses: codecov/codecov-action@v1.2.1

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.mypy_cache/
2+
/.coverage
3+
/.nox/
4+
/.python-version
5+
/.pytype/
6+
/dist/
7+
/docs/_build/
8+
/src/*.egg-info/
9+
__pycache__/

0 commit comments

Comments
 (0)