Skip to content

Commit

Permalink
V1.0.0 (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
iMicknl authored Jan 21, 2021
1 parent f14c9f2 commit 3c5c6f7
Show file tree
Hide file tree
Showing 27 changed files with 1,817 additions and 283 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ensure Docker script files uses LF to support Docker for Windows.
# Ensure "git config --global core.autocrlf input" before you clone
* text eol=lf
*.py whitespace=error
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @iMicknl
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: weekly
time: "04:00"
open-pull-requests-limit: 10
5 changes: 5 additions & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
feature: ['feature/*', 'feat/*']
enhancement: enhancement/*
bug: fix/*
breaking: breaking/*
documentation: doc/*
21 changes: 21 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name-template: 'v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
exclude-labels:
- 'exclude-from-changelog'
categories:
- title: '⚠️ Breaking changes'
label: 'breaking'
- title: '🚀 Features'
label: 'feature'
- title: '✨ Enhancement'
label: 'enhancement'
- title: '📘 Documentation'
label: 'documentation'
- title: '🐛 Bug Fixes'
label: 'bug'
template: |
## What's changed
$CHANGES
## Contributors to this release
$CONTRIBUTORS
49 changes: 49 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Linters

on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
analyse:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python 3.7
uses: actions/[email protected]
with:
python-version: 3.7

- name: Set up Poetry
uses: Gr1N/setup-poetry@v4

- name: Cache venv
uses: actions/[email protected]
with:
path: .venv
key: venv-${{ hashFiles('**/poetry.lock') }}

- name: Cache pre-commit
uses: actions/[email protected]
with:
path: ~/.cache/pre-commit/
key: ${{ runner.os }}-pre-commit-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('**/.pre-commit-config.yaml') }} # yamllint disable-line

- name: Install dependencies
run: poetry install

- name: Register problems matchers
run: |
echo "::add-matcher::.github/workflows/matchers/pylint.json"
echo "::add-matcher::.github/workflows/matchers/flake8.json"
echo "::add-matcher::.github/workflows/matchers/mypy.json"
echo "::add-matcher::.github/workflows/matchers/python.json"
- name: Apply all pre-commit
run: poetry run pre-commit run -a
30 changes: 30 additions & 0 deletions .github/workflows/matchers/flake8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"problemMatcher": [
{
"owner": "flake8-error",
"severity": "error",
"pattern": [
{
"regexp": "^(.*):(\\d+):(\\d+):\\s([EF]\\d{3}\\s.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
]
},
{
"owner": "flake8-warning",
"severity": "warning",
"pattern": [
{
"regexp": "^(.*):(\\d+):(\\d+):\\s([CDNW]\\d{3}\\s.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
]
}
]
}
16 changes: 16 additions & 0 deletions .github/workflows/matchers/mypy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"problemMatcher": [
{
"owner": "mypy",
"pattern": [
{
"regexp": "^(.+):(\\d+):\\s(error|warning):\\s(.+)$",
"file": 1,
"line": 2,
"severity": 3,
"message": 4
}
]
}
]
}
32 changes: 32 additions & 0 deletions .github/workflows/matchers/pylint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"problemMatcher": [
{
"owner": "pylint-error",
"severity": "error",
"pattern": [
{
"regexp": "^(.+):(\\d+):(\\d+):\\s(([EF]\\d{4}):\\s.+)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4,
"code": 5
}
]
},
{
"owner": "pylint-warning",
"severity": "warning",
"pattern": [
{
"regexp": "^(.+):(\\d+):(\\d+):\\s(([CRW]\\d{4}):\\s.+)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4,
"code": 5
}
]
}
]
}
18 changes: 18 additions & 0 deletions .github/workflows/matchers/python.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"problemMatcher": [
{
"owner": "python",
"pattern": [
{
"regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$",
"file": 1,
"line": 2
},
{
"regexp": "^\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$",
"message": 2
}
]
}
]
}
12 changes: 12 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: PR Labeler
on:
pull_request:
types: [opened]

jobs:
pr-labeler:
runs-on: ubuntu-latest
steps:
- uses: TimonVS/pr-labeler-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30 changes: 30 additions & 0 deletions .github/workflows/publish-pypi-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# yamllint disable-file
# This workflows will upload a Python Package
# using Poetry when a release is created

name: Publish Python Package (test)

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Set up Poetry
uses: Gr1N/setup-poetry@v4
- name: Build and publish to PyPi
env:
POETRY_PYPI_TOKEN_TESTPYPI: ${{ secrets.TEST_PYPI_API_TOKEN }}
run: |
poetry config http-basic.testpypi ${{ secrets.TEST_PYPI_API_TOKEN }} ""
poetry build
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry publish -r testpypi
15 changes: 15 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Release Drafter

on:
push:
branches:
- master

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- name: Update release draft
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39 changes: 39 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.2
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
args:
- --safe
- --quiet
files: ^((sagemcom_api|tests)/.+)?[^/]+\.py$
- repo: https://github.com/codespell-project/codespell
rev: v1.17.1
hooks:
- id: codespell
args:
- --skip="./.*,*.csv,*.json,*.md"
- --quiet-level=2
exclude_types: [csv, json]
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
hooks:
- id: flake8
args: ['--ignore=E501']
additional_dependencies:
- flake8-docstrings==1.5.0
- pydocstyle==5.1.1
files: ^(sagemcom_api|tests)/.+\.py$
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.24.2
hooks:
- id: yamllint
- repo: https://github.com/PyCQA/isort
rev: 5.5.3
hooks:
- id: isort
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Mick Vleeshouwer
Copyright (c) 2021 Mick Vleeshouwer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit 3c5c6f7

Please sign in to comment.