Skip to content

Commit ad584d6

Browse files
committed
Merge branch 'master' into add_support_for_has
2 parents 7bcc7e0 + 577ca9c commit ad584d6

File tree

11 files changed

+168
-67
lines changed

11 files changed

+168
-67
lines changed

.bandit.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
skips:
2+
- B101

.flake8

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[flake8]
2+
max-line-length = 99
3+
ignore = W503
4+
exclude =
5+
.git
6+
.tox
7+
venv*
8+
9+
# pending revision
10+
cssselect/__init__.py
11+
cssselect/parser.py
12+
cssselect/xpath.py
13+
docs/conf.py
14+
setup.py
15+
tests/test_cssselect.py

.github/workflows/checks.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Checks
2+
on: [push, pull_request]
3+
4+
jobs:
5+
checks:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
include:
10+
- python-version: 3
11+
env:
12+
TOXENV: black
13+
- python-version: 3
14+
env:
15+
TOXENV: flake8
16+
- python-version: 3
17+
env:
18+
TOXENV: pylint
19+
- python-version: 3
20+
env:
21+
TOXENV: security
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v2
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Run check
32+
env: ${{ matrix.env }}
33+
run: |
34+
pip install -U pip
35+
pip install -U tox
36+
tox

.github/workflows/tests.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,7 @@ jobs:
66
runs-on: ubuntu-latest
77
strategy:
88
matrix:
9-
include:
10-
- python-version: 2.7
11-
env:
12-
TOXENV: py
13-
- python-version: 3.5
14-
env:
15-
TOXENV: py
16-
- python-version: 3.6
17-
env:
18-
TOXENV: py
19-
- python-version: 3.7
20-
env:
21-
TOXENV: py
9+
python-version: [3.6, 3.7, 3.8, 3.9]
2210

2311
steps:
2412
- uses: actions/checkout@v2
@@ -29,10 +17,10 @@ jobs:
2917
python-version: ${{ matrix.python-version }}
3018

3119
- name: Run tests
32-
env: ${{ matrix.env }}
3320
run: |
21+
pip install -U pip
3422
pip install -U tox
35-
tox
23+
tox -e py
3624
3725
- name: Upload coverage report
38-
run: bash <(curl -s https://codecov.io/bash)
26+
run: bash <(curl -s https://codecov.io/bash)

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55
/dist
66
/docs/_build
77
/.coverage
8-
.idea
8+
.idea
9+
htmlcov/
10+
coverage.xml

README.rst

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,30 @@ cssselect: CSS Selectors for Python
1010
:target: https://pypi.python.org/pypi/cssselect
1111
:alt: Supported Python Versions
1212

13-
.. image:: https://img.shields.io/travis/scrapy/cssselect/master.svg
14-
:target: https://travis-ci.org/scrapy/cssselect
15-
:alt: Build Status
13+
.. image:: https://github.com/scrapy/cssselect/actions/workflows/tests.yml/badge.svg
14+
:target: https://github.com/scrapy/cssselect/actions/workflows/tests.yml
15+
:alt: Tests
1616

1717
.. image:: https://img.shields.io/codecov/c/github/scrapy/cssselect/master.svg
1818
:target: https://codecov.io/github/scrapy/cssselect?branch=master
1919
:alt: Coverage report
2020

21-
*cssselect* parses `CSS3 Selectors`_ and translate them to `XPath 1.0`_
22-
expressions. Such expressions can be used in lxml_ or another XPath engine
23-
to find the matching elements in an XML or HTML document.
21+
**cssselect** is a BSD-licensed Python library to parse `CSS3 selectors`_ and
22+
translate them to `XPath 1.0`_ expressions.
2423

25-
This module used to live inside of lxml as ``lxml.cssselect`` before it was
26-
extracted as a stand-alone project.
27-
28-
.. _CSS3 Selectors: https://www.w3.org/TR/css3-selectors/
29-
.. _XPath 1.0: https://www.w3.org/TR/xpath/
30-
.. _lxml: http://lxml.de/
24+
`XPath 1.0`_ expressions can be used in lxml_ or another XPath engine to find
25+
the matching elements in an XML or HTML document.
3126

27+
Find the cssselect online documentation at https://cssselect.readthedocs.io.
3228

3329
Quick facts:
3430

35-
* Free software: BSD licensed
36-
* Compatible with Python 2.7 and 3.4+
37-
* Latest documentation `on Read the Docs <https://cssselect.readthedocs.io/>`_
3831
* Source, issues and pull requests `on GitHub
3932
<https://github.com/scrapy/cssselect>`_
40-
* Releases `on PyPI <http://pypi.python.org/pypi/cssselect>`_
33+
* Releases `on PyPI <https://pypi.org/project/cssselect/>`_
4134
* Install with ``pip install cssselect``
35+
36+
37+
.. _CSS3 selectors: https://www.w3.org/TR/selectors-3/
38+
.. _XPath 1.0: https://www.w3.org/TR/xpath/all/
39+
.. _lxml: https://lxml.de/

pylintrc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[MASTER]
2+
persistent=no
3+
4+
[MESSAGES CONTROL]
5+
disable=assignment-from-no-return,
6+
bad-continuation,
7+
bad-whitespace,
8+
c-extension-no-member,
9+
consider-using-in,
10+
fixme,
11+
inconsistent-return-statements,
12+
invalid-name,
13+
missing-class-docstring,
14+
missing-function-docstring,
15+
missing-module-docstring,
16+
multiple-imports,
17+
no-else-return,
18+
no-member,
19+
no-self-use,
20+
raise-missing-from,
21+
redefined-builtin,
22+
redefined-outer-name,
23+
too-few-public-methods,
24+
too-many-arguments,
25+
too-many-branches,
26+
too-many-function-args,
27+
too-many-lines,
28+
too-many-public-methods,
29+
too-many-statements,
30+
undefined-variable,
31+
unidiomatic-typecheck,
32+
unused-argument,
33+
unused-import,
34+
useless-object-inheritance # Required for Python 2 support

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: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,45 @@
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=">=3.6",
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 :: 3",
40+
"Programming Language :: Python :: 3.6",
41+
"Programming Language :: Python :: 3.7",
42+
"Programming Language :: Python :: 3.8",
43+
"Programming Language :: Python :: 3.9",
4444
],
45-
**extra_kwargs
45+
**extra_kwargs,
4646
)

tests/requirements.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)