Skip to content

Commit c51ff5d

Browse files
gh action
1 parent 08613d7 commit c51ff5d

File tree

4 files changed

+88
-0
lines changed

4 files changed

+88
-0
lines changed

.github/workflows/pre-commit.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-python@v2
14+
- uses: pre-commit/[email protected]

.github/workflows/pythonapp.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Python application
2+
3+
on: [push, pull_request]
4+
5+
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
# todo: extract from source
12+
python-version: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9]
13+
install-style: [full, editable]
14+
15+
steps:
16+
- uses: actions/checkout@v1
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install -U setuptools setuptools_scm
25+
pip install pytest
26+
27+
- name: install editable
28+
run: pip install -e .
29+
if: matrix.install-style=='editable'
30+
- name: install full
31+
run: pip install .
32+
33+
if: matrix.install-style=='full'
34+
35+
- name: pytest
36+
run: pytest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ __pycache__
33
*.egg-info
44
.pytest_cache/
55
.eggs/
6+
.tox/

.pre-commit-config.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 20.8b1
4+
hooks:
5+
- id: black
6+
args: [--safe, --quiet]
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v3.4.0
9+
hooks:
10+
- id: trailing-whitespace
11+
- id: end-of-file-fixer
12+
- id: fix-encoding-pragma
13+
args: [--remove]
14+
- id: check-yaml
15+
- id: debug-statements
16+
language_version: python3
17+
- repo: https://gitlab.com/pycqa/flake8
18+
rev: 3.8.4
19+
hooks:
20+
- id: flake8
21+
language_version: python3
22+
additional_dependencies:
23+
- flake8-typing-imports==1.9.0
24+
- repo: https://github.com/asottile/reorder_python_imports
25+
rev: v2.3.6
26+
hooks:
27+
- id: reorder-python-imports
28+
args: ['--application-directories=.:src']
29+
- repo: https://github.com/asottile/pyupgrade
30+
rev: v2.8.0
31+
hooks:
32+
- id: pyupgrade
33+
- repo: https://github.com/asottile/setup-cfg-fmt
34+
rev: v1.16.0
35+
hooks:
36+
- id: setup-cfg-fmt
37+
args: [--min-py3-version=3.4]

0 commit comments

Comments
 (0)