From 951f744272ad69875827689b3f15ca43c79aae11 Mon Sep 17 00:00:00 2001 From: Charles-Henri de Boysson Date: Fri, 14 Oct 2022 23:54:43 -0400 Subject: [PATCH] chore: add black dependencies to the build --- .gitignore | 1 + constraints.txt | 1 + pyproject.toml | 16 ++++++++++++++++ setup.cfg | 4 +++- tox.ini | 18 ++++++++++++++---- 5 files changed, 35 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 87c74571..f46e93c3 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,7 @@ zookeeper/ .project .pydevproject .tox +venv /.settings /.metadata diff --git a/constraints.txt b/constraints.txt index 92d70e54..ce767e33 100644 --- a/constraints.txt +++ b/constraints.txt @@ -1,4 +1,5 @@ # Consistent testing environment. +black==22.10.0 coverage==6.3.2 flake8==3.9.2 mock==3.0.5 diff --git a/pyproject.toml b/pyproject.toml index 9db4899e..70668b17 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,3 +3,19 @@ build-backend = 'setuptools.build_meta' requires = [ 'setuptools >= 46.4.0', ] + +[tool.black] +line-length = 79 +target-version = ['py37', 'py38', 'py39', 'py310'] +include = '\.pyi?$' +# 'extend-exclude' excludes files or directories in addition to the defaults +# A regex preceded with ^/ will apply only to files and directories +# in the root of the project. +# ( +# ^/foo.py # exclude a file named foo.py in the root of the project. +# | .*_pb2.py # exclude autogenerated Protocol Buffer files anywhere in the +# ) +# # project. +extend-exclude = ''' +''' + diff --git a/setup.cfg b/setup.cfg index ba528cda..5380435c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -8,7 +8,8 @@ description = "Higher Level Zookeeper Client" long_description = file: README.md, CHANGES.md long_description_content_type = text/markdown license = Apache 2.0 -license_file = LICENSE +license_files = + LICENSE platform = any keywords = zookeeper, lock, leader, configuration classifiers = @@ -95,3 +96,4 @@ exclude = build/,dist/,*egg, docs/conf.py, zookeeper/ + diff --git a/tox.ini b/tox.ini index 5ab4f335..222f663a 100644 --- a/tox.ini +++ b/tox.ini @@ -5,8 +5,9 @@ requires= tox-wheel>=0.6.0 skip_missing_interpreters=True envlist = - pep8, - {gevent,eventlet,sasl,docs}, + pep8,black, + gevent,eventlet,sasl, + docs, pypy3 isolated_build = true @@ -42,9 +43,18 @@ commands = commands = - codecov -e TOX_VENV,ZOOKEEPER_VERSION [testenv:pep8] -extra = alldeps +basepython = python3 +extras = alldeps deps = - flake8==3.7.9 + flake8 usedevelop = True commands = flake8 {posargs} {toxinidir}/kazoo +[testenv:black] +basepython = python3 +extras = +deps = + black +usedevelop = True +commands = black --check {posargs: {toxinidir}/kazoo {toxinidir}/kazoo} +