summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2019-05-23 07:32:54 -0400
committerJason R. Coombs <jaraco@jaraco.com>2019-05-23 07:32:54 -0400
commite0dd0f119cfbd69cf3d703e45c83b68ac8ba24fe (patch)
tree45580175722196d424e62c36e6940781bd6f3b75
parent1bfab3a9b1cc68a3c8a2722fe1a7522ddc61ec2e (diff)
parent79733f08c43f9b2e0fd1830b37311fa52a16537c (diff)
downloadpytest-runner-e0dd0f119cfbd69cf3d703e45c83b68ac8ba24fe.tar.gz
Merge https://github.com/jaraco/skeleton
-rw-r--r--.flake87
-rw-r--r--.pre-commit-config.yaml5
-rw-r--r--.travis.yml1
-rw-r--r--README.rst4
-rw-r--r--docs/conf.py26
-rw-r--r--pyproject.toml3
-rw-r--r--pytest.ini2
-rw-r--r--setup.cfg1
-rw-r--r--skeleton.md7
-rw-r--r--tox.ini4
10 files changed, 40 insertions, 20 deletions
diff --git a/.flake8 b/.flake8
index 04d2d97..790c109 100644
--- a/.flake8
+++ b/.flake8
@@ -1,10 +1,9 @@
[flake8]
+max-line-length = 88
ignore =
- # Allow tabs for indentation
- W191
- # Workaround for https://github.com/PyCQA/pycodestyle/issues/836
- E117
# W503 violates spec https://github.com/PyCQA/pycodestyle/issues/513
W503
# W504 has issues https://github.com/OCA/maintainer-quality-tools/issues/545
W504
+ # Black creates whitespace before colon
+ E203
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000..922d942
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,5 @@
+repos:
+- repo: https://github.com/ambv/black
+ rev: 18.9b0
+ hooks:
+ - id: black
diff --git a/.travis.yml b/.travis.yml
index 88e69ef..cb30c47 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,4 @@
dist: xenial
-sudo: false
language: python
python:
diff --git a/README.rst b/README.rst
index 80247ce..879e84a 100644
--- a/README.rst
+++ b/README.rst
@@ -6,6 +6,10 @@
.. image:: https://img.shields.io/travis/pytest-dev/pytest-runner/master.svg
:target: https://travis-ci.org/pytest-dev/pytest-runner
+.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
+ :target: https://github.com/ambv/black
+ :alt: Code style: Black
+
.. .. image:: https://img.shields.io/appveyor/ci/pytest-dev/pytest-runner/master.svg
.. :target: https://ci.appveyor.com/project/pytest-dev/pytest-runner/branch/master
diff --git a/docs/conf.py b/docs/conf.py
index 84b53da..be9b89c 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,25 +1,31 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
-extensions = ["sphinx.ext.autodoc", "jaraco.packaging.sphinx", "rst.linker"]
+extensions = [
+ 'sphinx.ext.autodoc',
+ 'jaraco.packaging.sphinx',
+ 'rst.linker',
+]
master_doc = "index"
link_files = {
- "../CHANGES.rst": dict(
- using=dict(GH="https://github.com"),
+ '../CHANGES.rst': dict(
+ using=dict(
+ GH='https://github.com',
+ ),
replace=[
dict(
- pattern=r"(Issue #|\B#)(?P<issue>\d+)",
- url="{package_url}/issues/{issue}",
+ pattern=r'(Issue #|\B#)(?P<issue>\d+)',
+ url='{package_url}/issues/{issue}',
),
dict(
- pattern=r"^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n",
- with_scm="{text}\n{rev[timestamp]:%d %b %Y}\n",
+ pattern=r'^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n',
+ with_scm='{text}\n{rev[timestamp]:%d %b %Y}\n',
),
dict(
- pattern=r"PEP[- ](?P<pep_number>\d+)",
- url="https://www.python.org/dev/peps/pep-{pep_number:0>4}/",
+ pattern=r'PEP[- ](?P<pep_number>\d+)',
+ url='https://www.python.org/dev/peps/pep-{pep_number:0>4}/',
),
dict(
pattern=r'Setuptools #(?P<setuptools_issue>\d+)',
@@ -27,5 +33,5 @@ link_files = {
'/issues/{setuptools_issue}/',
),
],
- )
+ ),
}
diff --git a/pyproject.toml b/pyproject.toml
index 6f0a516..3afc8c3 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,3 +1,6 @@
[build-system]
requires = ["setuptools>=34.4", "wheel", "setuptools_scm>=1.15"]
build-backend = "setuptools.build_meta"
+
+[tool.black]
+skip-string-normalization = true
diff --git a/pytest.ini b/pytest.ini
index 9b3c1ec..10681ad 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -1,6 +1,6 @@
[pytest]
norecursedirs=dist build .tox .eggs
-addopts=--doctest-modules --flake8
+addopts=--doctest-modules --flake8 --black
doctest_optionflags=ALLOW_UNICODE ELLIPSIS
filterwarnings=
ignore:Possible nested set::pycodestyle:113
diff --git a/setup.cfg b/setup.cfg
index f86b3e7..31585db 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -30,6 +30,7 @@ testing =
pytest >= 3.5, !=3.7.3
pytest-checkdocs
pytest-flake8
+ pytest-black-multipy
# local
pytest-virtualenv
diff --git a/skeleton.md b/skeleton.md
index 09485cc..7249407 100644
--- a/skeleton.md
+++ b/skeleton.md
@@ -50,7 +50,8 @@ The features/techniques employed by the skeleton include:
- setuptools declarative configuration using setup.cfg
- tox for running tests
- A README.rst as reStructuredText with some popular badges, but with readthedocs and appveyor badges commented out
-- A CHANGES.rst file intended for publishing release notes about the project.
+- A CHANGES.rst file intended for publishing release notes about the project
+- Use of [black](https://black.readthedocs.io/en/stable/) for code formatting (disabled on unsupported Python 3.5 and earlier)
## Packaging Conventions
@@ -97,8 +98,8 @@ A pytest.ini is included to define common options around running tests. In parti
Relies a .flake8 file to correct some default behaviors:
-- allow tabs for indentation (legacy for jaraco projects)
-- disable mutually incompatible rules W503 and W504.
+- disable mutually incompatible rules W503 and W504
+- support for black format
## Continuous Integration
diff --git a/tox.ini b/tox.ini
index 28e0f1d..82fb9ea 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,8 @@
[tox]
envlist = python
-minversion = 2.4
+minversion = 3.2
+# https://github.com/jaraco/skeleton/issues/6
+tox_pip_extensions_ext_venv_update = true
[testenv]
deps =