Skip to content

Commit 76b78cd

Browse files
author
annbgn
committed
Merge remote-tracking branch 'parent/master' into add_support_for_of_s_part_in_nth_child
2 parents 2722ae6 + 9edc6c3 commit 76b78cd

16 files changed

+1219
-1033
lines changed

.bandit.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
skips:
2+
- B101

.flake8

+15
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

+36
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

+4-16
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

+3-1
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

+14-16
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/

cssselect/__init__.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@
1313
1414
"""
1515

16-
from cssselect.parser import (parse, Selector, FunctionalPseudoElement,
17-
SelectorError, SelectorSyntaxError)
16+
from cssselect.parser import (
17+
parse,
18+
Selector,
19+
FunctionalPseudoElement,
20+
SelectorError,
21+
SelectorSyntaxError,
22+
)
1823
from cssselect.xpath import GenericTranslator, HTMLTranslator, ExpressionError
1924

2025

21-
VERSION = '1.1.0'
26+
VERSION = "1.1.0"
2227
__version__ = VERSION

0 commit comments

Comments
 (0)