Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ jobs:
strategy:
matrix:
include:
- python-version: 3
env:
TOXENV: black
- python-version: 3
env:
TOXENV: flake8
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[tool.black]
line-length = 99
exclude = 'cssselect/|tests/'
50 changes: 26 additions & 24 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,47 @@

import re
import os.path

try:
from setuptools import setup
extra_kwargs = {'test_suite': 'cssselect.tests'}

extra_kwargs = {"test_suite": "cssselect.tests"}
except ImportError:
from distutils.core import setup

extra_kwargs = {}


ROOT = os.path.dirname(__file__)
README = open(os.path.join(ROOT, 'README.rst')).read()
INIT_PY = open(os.path.join(ROOT, 'cssselect', '__init__.py')).read()
README = open(os.path.join(ROOT, "README.rst")).read()
INIT_PY = open(os.path.join(ROOT, "cssselect", "__init__.py")).read()
VERSION = re.search("VERSION = '([^']+)'", INIT_PY).group(1)


setup(
name='cssselect',
name="cssselect",
version=VERSION,
author='Ian Bicking',
author_email='ianb@colorstudy.com',
maintainer='Paul Tremberth',
maintainer_email='paul.tremberth@gmail.com',
description=
'cssselect parses CSS3 Selectors and translates them to XPath 1.0',
author="Ian Bicking",
author_email="ianb@colorstudy.com",
maintainer="Paul Tremberth",
maintainer_email="paul.tremberth@gmail.com",
description="cssselect parses CSS3 Selectors and translates them to XPath 1.0",
long_description=README,
url='https://github.com/scrapy/cssselect',
license='BSD',
packages=['cssselect'],
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
url="https://github.com/scrapy/cssselect",
license="BSD",
packages=["cssselect"],
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7'
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
],
**extra_kwargs
)
8 changes: 7 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = flake8,security,py
envlist = black,flake8,security,py

[testenv]
basepython = python3
Expand All @@ -8,6 +8,12 @@ deps=
commands =
py.test --cov-report term --cov=cssselect

[testenv:black]
deps =
black==21.6b0
commands =
black --check {posargs: cssselect setup.py tests}

[testenv:flake8]
deps =
flake8==3.9.2
Expand Down