./textproc/py-cssselect, Parses CSS3 Selectors and translates them to XPath 1.0

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ]


Branch: CURRENT, Version: 1.6.0, Package name: py313-cssselect-1.6.0, Maintainer: pkgsrc-users

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.

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


Required to run:
[lang/python310]

Master sites:

Filesize: 50.53 KB

Version history: (Expand)


CVS history: (Expand)


   2026-10-12 16:42:51 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-cssselect: updated to 1.6.0

1.6.0

*   Dropped support for Python 3.10.

*   Added support for Python 3.15.

*   **Backward-incompatible change**: ``Relation``, which represents
    ``:has()``, now takes and exposes a list of ``(combinator, selector)``
    pairs as ``arguments``, replacing its ``combinator`` and ``subselector``
    arguments and attributes.

*   **Backward-incompatible change**: the
    ``GenericTranslator.xpath_relation_*_combinator()`` methods now take only
    the XPath expression of the ``:has()`` argument and return an XPath
    condition string. Translator subclasses that override them need to be
    updated.

*   ``:has()`` now supports any relative selector list, e.g.
    ``:has(> a.important, + p b)``, where it used to support a single
    argument made only of type, class and universal selectors.

*   ``:not()`` now supports a complex selector argument, e.g.
    ``:not(a.important[rel] > b)``.

*   Added support for the ``i`` and ``s`` attribute selector flags, e.g.
    ``[href^="HTTP" i]``, for ASCII case-insensitive and \ 
case-sensitive value
    matching.

*   ``*|element`` and ``[*|attrib]`` now match elements and attributes in any
    namespace, including none. They used to match only those with no
    namespace, like ``|element`` still does and the newly supported
    ``[|attrib]`` does.

    ``Element.namespace`` and ``Attrib.namespace`` are now ``"*"`` for the
    namespace wildcard.

*   Aligned the ``:enabled`` and ``:disabled`` pseudo-classes of
    ``HTMLTranslator`` with the HTML Living Standard:

    * ``input`` elements with no ``type`` attribute or with
      ``type="hidden"`` can now be ``:enabled`` and ``:disabled``.

    * Links (``a``, ``area`` and ``link`` with ``href``) are no longer
      ``:enabled``.

    * Form controls inside the first ``legend`` of a disabled ``fieldset`` are
      no longer ``:disabled``.

    * ``option`` elements inside a disabled ``optgroup`` are now
      ``:disabled``.

    * ``command`` elements are no longer ``:enabled`` or ``:disabled``, and
      ``keygen`` elements are no longer ``:enabled``.

*   Null and surrogate code points, both raw and escaped (e.g. ``\0``), are
    now replaced with U+FFFD, as the CSS specification requires. Raw null
    code points used to cause a ``SelectorSyntaxError``, and the others used
    to end up in the generated XPath.

*   The descendant combinator now translates into a ``descendant::`` step, e.g.
    ``e f`` into ``e/descendant::f`` instead of ``e/descendant-or-self::*/f``,
    which lxml evaluates faster.

*   Class selectors and the ``~=`` attribute operator now translate into an
    XPath expression that starts with a plain ``contains()`` check, which lxml
    evaluates faster on most documents.

*   Documented the support for ID selectors whose value is not a valid CSS
    identifier, e.g. ``#37signals``, as a non-standard extension.
   2026-08-11 16:45:19 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-cssselect: updated to 1.5.0

1.5.0

*   **Backward-incompatible change**: removed the no longer used
    ``closing_combiner`` and ``has_inner_condition`` arguments of
    ``XPathExpr.join()``. They were added for ``:has()`` support which no
    longer needs them.

*   Fixed and improved support for the following selector features:

    * ``:has()`` pseudo-class.

    * ``:is()``, ``:where()`` and ``:matches()`` pseudo-classes.

    * ``:scope`` pseudo-class.

    * ``:only-child`` and ``:only-of-type`` pseudo-classes.

    * Namespaces (``|``).

    * ``An+B`` arguments of pseudo-classes.

    * Type selectors in predicates.

*   Fixed some issues with the ``Selector.canonical()`` method.

*   Improved the ``Element.__repr__()`` and ``Relation.__repr__()`` methods.

*   Fixed ``Selector.specificity()`` calculation for the ``:is()``,
    ``:where()`` and ``:matches()`` pseudo-classes.

*   Fixed issues with whitespace and comment handling inside some selectors.

*   Fixed some exception types and messages.

*   Improved the docs about the ``:has()``, ``:is()`` and ``:where()``
    pseudo-classes and the `!=`` attribute operator.

*   Test improvements.
   2026-02-09 14:45:11 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-cssselect: updated to 1.4.0

Version 1.4.0

* Dropped support for Python 3.9 and PyPy 3.10.
* Added support for Python 3.14 and PyPy 3.11.
* Switched the build system to ``hatchling``.
* CI fixes and improvements.
   2025-04-14 13:57:58 by Adam Ciarcinski | Files touched by this commit (12) | Package updated
Log message:
Fix PLIST after py-setuptools update; bump depends and revision
   2025-03-13 16:19:52 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-cssselect: updated to 1.3.0

Version 1.3.0

* Dropped support for Python 3.7-3.8, added support for Python 3.12-3.13 and
  PyPy 3.10.
* Removed ``_unicode_safe_getattr()``, deprecated in 1.2.0.
* Added ``pre-commit`` and formatted the code with ``ruff``.
* Many CI additions and improvements.
   2023-01-11 12:48:35 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-cssselect: updated to 1.2.0

Version 1.2.0
-------------
* Drop support for Python 2.7, 3.4-3.6, add support for Python 3.7-3.11.
* Add type annotations (PEP 484 and PEP 561).
* More features from the CSS Selectors Level 4:
  * The ``:is()`` pseudo-class.
  * The ``:where()`` pseudo-class.
  * The ``:has()`` pseudo-class, with some limitations.
* Fix parsing ``:scope`` after a comma.
* Add parentheses to fix condition precedence in some cases.
* Private API changes related to the removal of the Python 2 support:
  * Remove ``_unicode`` and ``_unichr`` aliases from ``csselect.parser``.
  * Remove ``_basestring`` and ``_unicode`` aliases from ``csselect.xpath``.
  * Deprecate ``csselect.xpath._unicode_safe_getattr()`` and change it to just
    call ``getattr()``.
* Include tests in the PyPI tarball.
* Many CI additions and improvements.
* Improve the test coverage.
   2022-01-04 21:55:40 by Thomas Klausner | Files touched by this commit (1595)
Log message:
*: bump PKGREVISION for egg.mk users

They now have a tool dependency on py-setuptools instead of a DEPENDS
   2021-10-26 13:23:42 by Nia Alarie | Files touched by this commit (1161)
Log message:
textproc: Replace RMD160 checksums with BLAKE2s checksums

All checksums have been double-checked against existing RMD160 and
SHA512 hashes

Unfetchable distfiles (fetched conditionally?):
./textproc/convertlit/distinfo clit18src.zip