Skip to content

Commit

Permalink
Merge remote-tracking branch 'parent/master' into add_support_for_of_…
Browse files Browse the repository at this point in the history
…s_part_in_nth_child
  • Loading branch information
annbgn committed Jul 26, 2021
2 parents 2722ae6 + 9edc6c3 commit 4872d29
Show file tree
Hide file tree
Showing 16 changed files with 1,230 additions and 1,030 deletions.
2 changes: 2 additions & 0 deletions .bandit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
skips:
- B101
15 changes: 15 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[flake8]
max-line-length = 99
ignore = W503
exclude =
.git
.tox
venv*

# pending revision
cssselect/__init__.py
cssselect/parser.py
cssselect/xpath.py
docs/conf.py
setup.py
tests/test_cssselect.py
36 changes: 36 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Checks
on: [push, pull_request]

jobs:
checks:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- python-version: 3
env:
TOXENV: black
- python-version: 3
env:
TOXENV: flake8
- python-version: 3
env:
TOXENV: pylint
- python-version: 3
env:
TOXENV: security

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Run check
env: ${{ matrix.env }}
run: |
pip install -U pip
pip install -U tox
tox
20 changes: 4 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- python-version: 2.7
env:
TOXENV: py
- python-version: 3.5
env:
TOXENV: py
- python-version: 3.6
env:
TOXENV: py
- python-version: 3.7
env:
TOXENV: py
python-version: [3.6, 3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
Expand All @@ -29,10 +17,10 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Run tests
env: ${{ matrix.env }}
run: |
pip install -U pip
pip install -U tox
tox
tox -e py
- name: Upload coverage report
run: bash <(curl -s https://codecov.io/bash)
run: bash <(curl -s https://codecov.io/bash)
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
/dist
/docs/_build
/.coverage
.idea
.idea
htmlcov/
coverage.xml
30 changes: 14 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,30 @@ cssselect: CSS Selectors for Python
:target: https://pypi.python.org/pypi/cssselect
:alt: Supported Python Versions

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

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

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

This module used to live inside of lxml as ``lxml.cssselect`` before it was
extracted as a stand-alone project.

.. _CSS3 Selectors: https://www.w3.org/TR/css3-selectors/
.. _XPath 1.0: https://www.w3.org/TR/xpath/
.. _lxml: http://lxml.de/
`XPath 1.0`_ expressions can be used in lxml_ or another XPath engine to find
the matching elements in an XML or HTML document.

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

Quick facts:

* Free software: BSD licensed
* Compatible with Python 2.7 and 3.4+
* Latest documentation `on Read the Docs <https://cssselect.readthedocs.io/>`_
* Source, issues and pull requests `on GitHub
<https://github.com/scrapy/cssselect>`_
* Releases `on PyPI <http://pypi.python.org/pypi/cssselect>`_
* Releases `on PyPI <https://pypi.org/project/cssselect/>`_
* Install with ``pip install cssselect``


.. _CSS3 selectors: https://www.w3.org/TR/selectors-3/
.. _XPath 1.0: https://www.w3.org/TR/xpath/all/
.. _lxml: https://lxml.de/
11 changes: 8 additions & 3 deletions cssselect/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@
"""

from cssselect.parser import (parse, Selector, FunctionalPseudoElement,
SelectorError, SelectorSyntaxError)
from cssselect.parser import (
parse,
Selector,
FunctionalPseudoElement,
SelectorError,
SelectorSyntaxError,
)
from cssselect.xpath import GenericTranslator, HTMLTranslator, ExpressionError


VERSION = '1.1.0'
VERSION = "1.1.0"
__version__ = VERSION

0 comments on commit 4872d29

Please sign in to comment.