summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Gordon <jogo@pinterest.com>2021-12-02 16:14:27 -0800
committerJoe Gordon <jogo@pinterest.com>2021-12-03 09:27:18 -0800
commitd43b10cbe4d35abf79fea816bdaafbd6c41f6c32 (patch)
tree32476063399066404c6aea94406ea10da9158753
parentdcd2a26b54eda26d02394e7538a1cdc1f2123b4c (diff)
downloadpymemcache-d43b10cbe4d35abf79fea816bdaafbd6c41f6c32.tar.gz
Add black CI configuration
Since we already have a tox based ci.yml file add black there instead of using https://black.readthedocs.io/en/stable/integrations/github_actions.html
-rw-r--r--.github/workflows/ci.yml2
-rw-r--r--pyproject.toml2
-rw-r--r--test-requirements.txt1
-rw-r--r--tox.ini6
4 files changed, 9 insertions, 2 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 9a7105f..038d4f2 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -29,7 +29,7 @@ jobs:
if: matrix.python-version == '3.9'
run: |
pip install tox tox-gh-actions
- tox -e flake8
+ tox -e flake8,black
- name: Disable IPv6 localhost
run: |
sudo sed -i '/::1/d' /etc/hosts
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..86d2590
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,2 @@
+[tool.black]
+target-version = ['py36', 'py37', 'py38', 'py39']
diff --git a/test-requirements.txt b/test-requirements.txt
index dceb81f..82a07e1 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -1,3 +1,4 @@
+black==21.11b1
pytest
pytest-cov
gevent==20.9.0; "PyPy" not in platform_python_implementation
diff --git a/tox.ini b/tox.ini
index e549a38..63d4a32 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist = py36, py37, py38, py39, pypy, pypy3, flake8, integration
+envlist = py36, py37, py38, py39, pypy, pypy3, flake8, black, integration
skip_missing_interpreters = True
# Automatic envs (pyXX) will only use the python version appropriate to that
# env and ignore basepython inherited from [testenv] if we set
@@ -27,6 +27,10 @@ commands =
flake8
python setup.py check --restructuredtext
+[testenv:black]
+commands =
+ black --check .
+
[testenv:coverage]
commands =
py.test --cov=pymemcache