Skip to content

Commit

Permalink
Merge pull request #673 from ceache/chore/black
Browse files Browse the repository at this point in the history
chore(core): Introduce black code formatter
  • Loading branch information
ceache authored Oct 17, 2022
2 parents cb2fe85 + 644eeb7 commit a192b2e
Show file tree
Hide file tree
Showing 62 changed files with 2,087 additions and 1,447 deletions.
14 changes: 13 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
[flake8]
ignore = BLK100
builtins = _
exclude =
.git,
__pycache__,
.venv/,venv/,
.tox/,
build/,dist/,*egg,
docs/conf.py,
zookeeper/
# See black's documentation for E203
max-line-length = 79
extend-ignore = BLK100,E203

5 changes: 5 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Commit ignored from blame
# git config blame.ignoreRevsFile .git-blame-ignore-revs

# Reformat using black 22.10.0
686717629f71c66d39ab0352c605c73eace5bd1f
48 changes: 41 additions & 7 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,41 @@ on:
- release/*

jobs:
validate:
name: Code Validation

runs-on: ubuntu-latest

steps:
- name: Handle the code
uses: actions/checkout@v2

- name: "Set up Python 3.10"
uses: actions/setup-python@v2
with:
python-version: "3.10"

- name: Handle pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install required dependencies
run: |
python3 -m pip install --upgrade pip
pip install tox tox-wheel
- name: Code check
run: tox -e ${TOX_VENV}
env:
TOX_VENV: black,pep8

test:
needs: [validate]

name: >
Test Python ${{ matrix.python-version }},
ZK ${{ matrix.zk-version }}
Expand All @@ -21,18 +55,18 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", pypy-3.7]
zk-version: [3.4.14, 3.5.10, 3.6.3, 3.7.1]
python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.7"]
zk-version: ["3.4.14", "3.5.10", "3.6.3", "3.7.1"]
include:
- python-version: 3.7
- python-version: "3.7"
tox-env: py37
- python-version: 3.8
- python-version: "3.8"
tox-env: py38
- python-version: 3.9
- python-version: "3.9"
tox-env: py39
- python-version: "3.10"
tox-env: py310
- python-version: pypy-3.7
- python-version: "pypy-3.7"
tox-env: pypy3
steps:
- name: Handle the code
Expand Down Expand Up @@ -62,7 +96,7 @@ jobs:
- name: Install required dependencies
run: |
sudo apt-get -y install libevent-dev krb5-kdc krb5-admin-server libkrb5-dev
python -m pip install --upgrade pip
python3 -m pip install --upgrade pip
pip install tox
- name: Test with tox
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ zookeeper/
.project
.pydevproject
.tox
venv
/.settings
/.metadata

!.gitignore
!.git-blame-ignore-revs

3 changes: 2 additions & 1 deletion constraints.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Consistent testing environment.
black==22.10.0
coverage==6.3.2
flake8==3.9.2
flake8==5.0.2
mock==3.0.5
objgraph==3.5.0
pytest==6.2.5
Expand Down
Loading

0 comments on commit a192b2e

Please sign in to comment.