Skip to content

Commit a192b2e

Browse files
authored
Merge pull request #673 from ceache/chore/black
chore(core): Introduce black code formatter
2 parents cb2fe85 + 644eeb7 commit a192b2e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+2087
-1447
lines changed

.flake8

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,14 @@
11
[flake8]
2-
ignore = BLK100
2+
builtins = _
3+
exclude =
4+
.git,
5+
__pycache__,
6+
.venv/,venv/,
7+
.tox/,
8+
build/,dist/,*egg,
9+
docs/conf.py,
10+
zookeeper/
11+
# See black's documentation for E203
12+
max-line-length = 79
13+
extend-ignore = BLK100,E203
14+

.git-blame-ignore-revs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Commit ignored from blame
2+
# git config blame.ignoreRevsFile .git-blame-ignore-revs
3+
4+
# Reformat using black 22.10.0
5+
686717629f71c66d39ab0352c605c73eace5bd1f

.github/workflows/testing.yml

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,41 @@ on:
1111
- release/*
1212

1313
jobs:
14+
validate:
15+
name: Code Validation
16+
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Handle the code
21+
uses: actions/checkout@v2
22+
23+
- name: "Set up Python 3.10"
24+
uses: actions/setup-python@v2
25+
with:
26+
python-version: "3.10"
27+
28+
- name: Handle pip cache
29+
uses: actions/cache@v2
30+
with:
31+
path: ~/.cache/pip
32+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
33+
restore-keys: |
34+
${{ runner.os }}-pip-
35+
36+
- name: Install required dependencies
37+
run: |
38+
python3 -m pip install --upgrade pip
39+
pip install tox tox-wheel
40+
41+
- name: Code check
42+
run: tox -e ${TOX_VENV}
43+
env:
44+
TOX_VENV: black,pep8
45+
1446
test:
47+
needs: [validate]
48+
1549
name: >
1650
Test Python ${{ matrix.python-version }},
1751
ZK ${{ matrix.zk-version }}
@@ -21,18 +55,18 @@ jobs:
2155
strategy:
2256
fail-fast: false
2357
matrix:
24-
python-version: [3.7, 3.8, 3.9, "3.10", pypy-3.7]
25-
zk-version: [3.4.14, 3.5.10, 3.6.3, 3.7.1]
58+
python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.7"]
59+
zk-version: ["3.4.14", "3.5.10", "3.6.3", "3.7.1"]
2660
include:
27-
- python-version: 3.7
61+
- python-version: "3.7"
2862
tox-env: py37
29-
- python-version: 3.8
63+
- python-version: "3.8"
3064
tox-env: py38
31-
- python-version: 3.9
65+
- python-version: "3.9"
3266
tox-env: py39
3367
- python-version: "3.10"
3468
tox-env: py310
35-
- python-version: pypy-3.7
69+
- python-version: "pypy-3.7"
3670
tox-env: pypy3
3771
steps:
3872
- name: Handle the code
@@ -62,7 +96,7 @@ jobs:
6296
- name: Install required dependencies
6397
run: |
6498
sudo apt-get -y install libevent-dev krb5-kdc krb5-admin-server libkrb5-dev
65-
python -m pip install --upgrade pip
99+
python3 -m pip install --upgrade pip
66100
pip install tox
67101
68102
- name: Test with tox

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ zookeeper/
3030
.project
3131
.pydevproject
3232
.tox
33+
venv
3334
/.settings
3435
/.metadata
3536

3637
!.gitignore
38+
!.git-blame-ignore-revs
39+

constraints.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Consistent testing environment.
2+
black==22.10.0
23
coverage==6.3.2
3-
flake8==3.9.2
4+
flake8==5.0.2
45
mock==3.0.5
56
objgraph==3.5.0
67
pytest==6.2.5

0 commit comments

Comments
 (0)