Skip to content

Commit 39e350a

Browse files
authored
Merge pull request #118 from scrapy/black
Add black check
2 parents e447cc1 + 5399d41 commit 39e350a

File tree

4 files changed

+39
-25
lines changed

4 files changed

+39
-25
lines changed

.github/workflows/checks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ jobs:
77
strategy:
88
matrix:
99
include:
10+
- python-version: 3
11+
env:
12+
TOXENV: black
1013
- python-version: 3
1114
env:
1215
TOXENV: flake8

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[tool.black]
2+
line-length = 99
3+
exclude = 'cssselect/|tests/'

setup.py

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,47 @@
22

33
import re
44
import os.path
5+
56
try:
67
from setuptools import setup
7-
extra_kwargs = {'test_suite': 'cssselect.tests'}
8+
9+
extra_kwargs = {"test_suite": "cssselect.tests"}
810
except ImportError:
911
from distutils.core import setup
12+
1013
extra_kwargs = {}
1114

1215

1316
ROOT = os.path.dirname(__file__)
14-
README = open(os.path.join(ROOT, 'README.rst')).read()
15-
INIT_PY = open(os.path.join(ROOT, 'cssselect', '__init__.py')).read()
17+
README = open(os.path.join(ROOT, "README.rst")).read()
18+
INIT_PY = open(os.path.join(ROOT, "cssselect", "__init__.py")).read()
1619
VERSION = re.search("VERSION = '([^']+)'", INIT_PY).group(1)
1720

1821

1922
setup(
20-
name='cssselect',
23+
name="cssselect",
2124
version=VERSION,
22-
author='Ian Bicking',
23-
author_email='[email protected]',
24-
maintainer='Paul Tremberth',
25-
maintainer_email='[email protected]',
26-
description=
27-
'cssselect parses CSS3 Selectors and translates them to XPath 1.0',
25+
author="Ian Bicking",
26+
author_email="[email protected]",
27+
maintainer="Paul Tremberth",
28+
maintainer_email="[email protected]",
29+
description="cssselect parses CSS3 Selectors and translates them to XPath 1.0",
2830
long_description=README,
29-
url='https://github.com/scrapy/cssselect',
30-
license='BSD',
31-
packages=['cssselect'],
32-
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
31+
url="https://github.com/scrapy/cssselect",
32+
license="BSD",
33+
packages=["cssselect"],
34+
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
3335
classifiers=[
34-
'Development Status :: 4 - Beta',
35-
'Intended Audience :: Developers',
36-
'License :: OSI Approved :: BSD License',
37-
'Programming Language :: Python :: 2',
38-
'Programming Language :: Python :: 2.7',
39-
'Programming Language :: Python :: 3',
40-
'Programming Language :: Python :: 3.4',
41-
'Programming Language :: Python :: 3.5',
42-
'Programming Language :: Python :: 3.6',
43-
'Programming Language :: Python :: 3.7'
36+
"Development Status :: 4 - Beta",
37+
"Intended Audience :: Developers",
38+
"License :: OSI Approved :: BSD License",
39+
"Programming Language :: Python :: 2",
40+
"Programming Language :: Python :: 2.7",
41+
"Programming Language :: Python :: 3",
42+
"Programming Language :: Python :: 3.4",
43+
"Programming Language :: Python :: 3.5",
44+
"Programming Language :: Python :: 3.6",
45+
"Programming Language :: Python :: 3.7",
4446
],
4547
**extra_kwargs
4648
)

tox.ini

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = flake8,security,py
2+
envlist = black,flake8,security,py
33

44
[testenv]
55
basepython = python3
@@ -8,6 +8,12 @@ deps=
88
commands =
99
py.test --cov-report term --cov=cssselect
1010

11+
[testenv:black]
12+
deps =
13+
black==21.6b0
14+
commands =
15+
black --check {posargs: cssselect setup.py tests}
16+
1117
[testenv:flake8]
1218
deps =
1319
flake8==3.9.2

0 commit comments

Comments
 (0)