-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
368 additions
and
150 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,5 @@ | ||
[flake8] | ||
max-line-length = 120 | ||
max-complexity = 10 | ||
exclude = | ||
tests |
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,6 @@ | ||
addReviewers: true | ||
|
||
addAssignees: author | ||
|
||
reviewers: | ||
- shawalli |
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,123 @@ | ||
name: Build, Lint, Test | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
|
||
jobs: | ||
lint: | ||
name: ️⚒️ & 👕 | ||
|
||
strategy: | ||
matrix: | ||
python-version: [3.6.7, 3.7, 3.8] | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install poetry | ||
uses: dschep/install-poetry-action@v1.3 | ||
with: | ||
create_virtualenvs: true | ||
|
||
- name: Cache Poetry virtualenv | ||
uses: actions/cache@v2 | ||
id: cache | ||
with: | ||
path: ~/.virtualenvs | ||
key: poetry-${{ github.ref }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }} | ||
restore-keys: | | ||
poetry-${{ github.ref }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }} | ||
- name: Set Poetry config | ||
run: | | ||
poetry config virtualenvs.in-project false | ||
poetry config virtualenvs.path ~/.virtualenvs | ||
- name: Install Dependencies | ||
run: poetry install | ||
|
||
- name: Run pre-commit | ||
if: github.event_name == 'pull_request' | ||
run: | | ||
git fetch origin master:master | ||
poetry run pre-commit run --from-ref master --to-ref HEAD | ||
test: | ||
name: 🧪 | ||
needs: lint | ||
|
||
strategy: | ||
matrix: | ||
python-version: [3.6.7, 3.7, 3.8] | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install poetry | ||
uses: dschep/install-poetry-action@v1.3 | ||
with: | ||
create_virtualenvs: true | ||
|
||
- name: Cache Poetry virtualenv | ||
uses: actions/cache@v2 | ||
id: cache | ||
with: | ||
path: ~/.virtualenvs | ||
key: poetry-${{ github.ref }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }} | ||
restore-keys: | | ||
poetry-${{ github.ref }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }} | ||
- name: Set Poetry config | ||
run: | | ||
poetry config virtualenvs.in-project false | ||
poetry config virtualenvs.path ~/.virtualenvs | ||
- name: Install Dependencies | ||
run: poetry install | ||
|
||
- name: Unit Test | ||
run: poetry run python -m pytest --cov=src --cov-branch tests/ | ||
|
||
- name: Submit Code Coverage | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COVERALLS_FLAG_NAME: py-${{ matrix.python-version }} | ||
COVERALLS_PARALLEL: true | ||
run: poetry run coveralls | ||
|
||
test-finish: | ||
name: 🚪 | ||
needs: test | ||
|
||
runs-on: ubuntu-latest | ||
container: python:3-slim | ||
|
||
steps: | ||
- name: Finished | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
pip3 install coveralls | ||
coveralls --finish |
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 @@ | ||
name: Assign Reviewers | ||
on: | ||
pull_request: | ||
|
||
jobs: | ||
add-reviewers: | ||
name: 👪 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: kentaro-m/auto-assign-action@v1.1.1 |
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,73 @@ | ||
name: Package, Ship | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
package: | ||
name: 📦 & 🚢 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: '0' | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Get next package version | ||
id: bumpversion | ||
uses: anothrNick/github-tag-action@1.23.0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
WITH_V: false | ||
DRY_RUN: true | ||
|
||
- name: Install poetry | ||
uses: dschep/install-poetry-action@v1.3 | ||
with: | ||
create_virtualenvs: true | ||
|
||
- name: Bump release version | ||
run: poetry version ${{ steps.bumpversion.outputs.new_tag }} | ||
|
||
- name: Build package | ||
run: poetry build | ||
|
||
- name: Publish package (Test PyPI) | ||
run: | | ||
poetry config repositories.testpypi https://test.pypi.org/legacy/ | ||
poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_PASSWORD }} | ||
poetry publish -r testpypi | ||
- name: Publish package (PyPI) | ||
run: | | ||
poetry config pypi-token.pypi ${{ secrets.PYPI_PASSWORD }} | ||
poetry publish | ||
- name: Generate release message | ||
id: release_message | ||
run: | | ||
# Get (squashed) commit summaries since last tag, convert to list, | ||
# escape multi-lines into a format GitHub Actions respect, and set as output | ||
export NOTES=`git log --pretty=format:'%s' $(git describe --tags --abbrev=0 HEAD^)..HEAD | tr '\n' '\0' | xargs -0 -I{} echo '- {}'` | ||
export NOTES_ENCODED_NEWLINES="${NOTES//$'\n'/'%0A'}" | ||
echo "::set-output name=message::$NOTES_ENCODED_NEWLINES" | ||
- name: Create release | ||
uses: actions/create-release@v1.1.2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.bumpversion.outputs.new_tag }} | ||
release_name: ${{ steps.bumpversion.outputs.new_tag }} | ||
body: ${{ steps.release_message.outputs.message}} | ||
draft: false | ||
prerelease: false |
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 |
---|---|---|
|
@@ -104,4 +104,4 @@ venv.bak/ | |
.mypy_cache/ | ||
|
||
# Editors | ||
.vscode/ | ||
.vscode/ |
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,4 @@ | ||
[settings] | ||
known_third_party = github_webhook | ||
multi_line_output=3 | ||
include_trailing_comma=True |
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,31 @@ | ||
--- | ||
repos: | ||
- repo: https://gitlab.com/smop/pre-commit-hooks | ||
rev: v1.0.0 | ||
hooks: | ||
- id: check-poetry | ||
- repo: https://github.com/asottile/seed-isort-config | ||
rev: v2.2.0 | ||
hooks: | ||
- id: seed-isort-config | ||
args: | ||
- --exclude=tests/.*\.py | ||
- repo: https://github.com/psf/black | ||
rev: 19.10b0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/pre-commit/mirrors-isort | ||
rev: v5.0.9 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.1.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: check-toml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 3.8.3 | ||
hooks: | ||
- id: flake8 |
This file was deleted.
Oops, something went wrong.
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
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,60 @@ | ||
[tool.poetry] | ||
name = "flask-github-webhook" | ||
version = "0.2.0" | ||
description = "Flask extension for github-webhooks" | ||
readme = "README.md" | ||
homepage = "https://github.com/shawalli/flask-github-webhook" | ||
repository = "https://github.com/shawalli/flask-github-webhook" | ||
authors = ["Shawn Wallis <shawn.p.wallis@gmail.com>"] | ||
license = "Apache License 2.0" | ||
classifiers = [ | ||
"Development Status :: 3 - Alpha", | ||
"Framework :: Flask", | ||
"Environment :: Web Environment", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: System Administrators", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Topic :: Software Development :: Version Control :: Git" | ||
] | ||
include = [ | ||
"LICENSE.md", | ||
] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.6.7" | ||
github-webhook = "^1.0.2" | ||
|
||
[tool.poetry.dev-dependencies] | ||
coveralls = "^2.1.1" | ||
pre-commit = "^2.6.0" | ||
pytest = "^5.4.3" | ||
pytest-cov = "^2.10.0" | ||
|
||
[tool.black] | ||
line-length = 120 | ||
target-version = ["py36", "py37", "py38"] | ||
include = "\\.pyi?$" | ||
exclude = """ | ||
/( | ||
\\.eggs | ||
| \\.git | ||
| \\.hg | ||
| \\.mypy_cache | ||
| \\.tox | ||
| \\.venv | ||
| _build | ||
| buck-out | ||
| build | ||
| dist | ||
)/ | ||
""" | ||
|
||
[build-system] | ||
requires = ["poetry>=0.12"] | ||
build-backend = "poetry.masonry.api" |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.