Skip to content

Commit

Permalink
Merge branch 'master' into constant_phases
Browse files Browse the repository at this point in the history
  • Loading branch information
ambv committed Mar 3, 2023
2 parents 8cff6aa + 3e500bb commit 0e79592
Show file tree
Hide file tree
Showing 37 changed files with 467 additions and 229 deletions.
6 changes: 1 addition & 5 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# To activate, change the Appveyor settings to use `.appveyor.yml`.
image: Visual Studio 2019
environment:
global:
PATH: "C:\\Python27\\Scripts\\;%PATH%"
Expand All @@ -9,10 +9,6 @@ environment:
- TOXENV: py35-optional
- TOXENV: py36-base
- TOXENV: py36-optional
- TOXENV: py37-base
- TOXENV: py37-optional
- TOXENV: py38-base
- TOXENV: py38-optional

install:
- git submodule update --init --recursive
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/python-tox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
on: [pull_request, push]
jobs:
build:
# Prevent duplicate builds for 'internal' pull requests on existing commits
# Credit: https://github.community/t/duplicate-checks-on-push-and-pull-request-simultaneous-event/18012
if: github.event.push || github.event.pull_request.head.repo.full_name != github.repository
strategy:
fail-fast: false
matrix:
# 2.7, 3.5, and 3.6 run on Windows via AppVeyor
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, windows-latest]
deps: [base, optional]
include:
- python: "pypy-2.7"
os: ubuntu-latest
deps: base
- python: "pypy-3.8"
os: ubuntu-latest
deps: base
- python: "2.7"
os: ubuntu-latest
deps: oldest
- python: "3.7"
os: ubuntu-latest
deps: oldest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- if: ${{ matrix.deps == 'base' }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: |
requirements.txt
requirements-test.txt
- if: ${{ matrix.deps == 'optional' }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: |
requirements.txt
requirements-optional.txt
requirements-test.txt
- if: ${{ matrix.deps == 'oldest' }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: |
requirements-oldest.txt
- if: ${{ matrix.os == 'windows-latest' }}
name: Determine environment name for Tox (PowerShell)
run: python toxver.py ${{ matrix.python }} ${{ matrix.deps }} >> $env:GITHUB_ENV
- if: ${{ matrix.os == 'ubuntu-latest' }}
name: Determine environment name for Tox (Bash)
run: python toxver.py ${{ matrix.python }} ${{ matrix.deps }} >> $GITHUB_ENV
- run: pip install tox
- run: tox
- if: ${{ always() }}
run: python debug-info.py
184 changes: 108 additions & 76 deletions .pytest.expect

Large diffs are not rendered by default.

25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

25 changes: 23 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
Change Log
----------

1.2
~~~

Unreleased yet

Features:

* Add support for the ``<wbr>`` element in the sanitizer, `which indicates
a line break opportunity <https://html.spec.whatwg.org/#the-wbr-element>`_.
This element is allowed by default. (#395) (Thank you, Tom Most!)
* Add support for serializing the ``<ol reversed>`` boolean attribute. (Thank
you, Tom Most!) (#396)
* The ``<ol reversed>`` and ``<ol start>`` attributes are now permitted by the
sanitizer. (#321) (Thank you, Tom Most!)

Bug fixes:

* The sanitizer now permits ``<summary>`` tags. It used to allow ``<details>``
already. (#423)

1.1
~~~

Released on June 23, 2020

Breaking changes:

* Drop support for Python 3.3. (#358)
Expand All @@ -22,7 +44,6 @@ Other changes:
``html5lib`` keeps working in future Python versions. (#403)
* Drop optional ``datrie`` dependency. (#442)


1.0.1
~~~~~

Expand Down Expand Up @@ -95,7 +116,7 @@ Released on July 14, 2016
tested, doesn't entirely work, and as far as I can tell is
completely unused by anyone.**

* Move testsuite to ``py.test``.
* Move testsuite to ``pytest``.

* **Fix #124: move to webencodings for decoding the input byte stream;
this makes html5lib compliant with the Encoding Standard, and
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ documentation. Some useful information:
- We keep the master branch passing all tests at all times on all
supported versions.

`Travis CI <https://travis-ci.org/html5lib/html5lib-python/>`_ is run
`GitHub Actions <https://github.com/html5lib/html5lib-python/actions>`_ is run
against all pull requests and should enforce all of the above.

We use `Opera Critic <https://critic.hoppipolla.co.uk/>`_ as an external
Expand Down
17 changes: 9 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
html5lib
========

.. image:: https://travis-ci.org/html5lib/html5lib-python.svg?branch=master
:target: https://travis-ci.org/html5lib/html5lib-python

.. image:: https://github.com/html5lib/html5lib-python/actions/workflows/python-tox.yml/badge.svg
:target: https://github.com/html5lib/html5lib-python/actions/workflows/python-tox.yml

html5lib is a pure-python library for parsing HTML. It is designed to
conform to the WHATWG HTML specification, as is implemented by all major
Expand Down Expand Up @@ -128,7 +127,7 @@ Tests
-----

Unit tests require the ``pytest`` and ``mock`` libraries and can be
run using the ``py.test`` command in the root directory.
run using the ``pytest`` command in the root directory.

Test data are contained in a separate `html5lib-tests
<https://github.com/html5lib/html5lib-tests>`_ repository and included
Expand All @@ -145,7 +144,9 @@ which can be found on PyPI.
Questions?
----------

There's a mailing list available for support on Google Groups,
`html5lib-discuss <http://groups.google.com/group/html5lib-discuss>`_,
though you may get a quicker response asking on IRC in `#whatwg on
irc.freenode.net <http://wiki.whatwg.org/wiki/IRC>`_.
Check out `the docs <https://html5lib.readthedocs.io/en/latest/>`_. Still
need help? Go to our `GitHub Discussions
<https://github.com/html5lib/html5lib-python/discussions>`_.

You can also browse the archives of the `html5lib-discuss mailing list
<https://www.mail-archive.com/html5lib-discuss@googlegroups.com/>`_.
10 changes: 9 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.viewcode']
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.viewcode',
'sphinx.ext.intersphinx']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down Expand Up @@ -92,6 +93,13 @@
]


intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'lxml': ('https://lxml.de/apidoc/', None),
'chardet': ('https://chardet.readthedocs.io/en/latest/', None),
}


class CExtMock(object):
"""Required for autodoc on readthedocs.org where you cannot build C extensions."""
def __init__(self, *args, **kwargs):
Expand Down
33 changes: 19 additions & 14 deletions doc/html5lib.filters.rst
Original file line number Diff line number Diff line change
@@ -1,56 +1,61 @@
filters Package
===============

:mod:`base` Module
-------------------
``base`` Module
----------------

.. automodule:: html5lib.filters.base
:members:
:show-inheritance:
:special-members: __init__

:mod:`alphabeticalattributes` Module
------------------------------------
.. autoclass:: html5lib.filters.base.Filter
:members:
:show-inheritance:
:special-members: __init__

``alphabeticalattributes`` Module
---------------------------------

.. automodule:: html5lib.filters.alphabeticalattributes
:members:
:show-inheritance:
:special-members: __init__

:mod:`inject_meta_charset` Module
---------------------------------
``inject_meta_charset`` Module
------------------------------

.. automodule:: html5lib.filters.inject_meta_charset
:members:
:show-inheritance:
:special-members: __init__

:mod:`lint` Module
------------------
``lint`` Module
---------------

.. automodule:: html5lib.filters.lint
:members:
:show-inheritance:
:special-members: __init__

:mod:`optionaltags` Module
--------------------------
``optionaltags`` Module
-----------------------

.. automodule:: html5lib.filters.optionaltags
:members:
:show-inheritance:
:special-members: __init__

:mod:`sanitizer` Module
-----------------------
``sanitizer`` Module
--------------------

.. automodule:: html5lib.filters.sanitizer
:members:
:show-inheritance:
:special-members: __init__

:mod:`whitespace` Module
------------------------
``whitespace`` Module
---------------------

.. automodule:: html5lib.filters.whitespace
:members:
Expand Down
17 changes: 11 additions & 6 deletions doc/html5lib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,34 @@ html5lib Package
.. automodule:: html5lib
:members: __version__

:mod:`constants` Module
-----------------------
``constants`` Module
--------------------

.. automodule:: html5lib.constants
:members:
:show-inheritance:

:mod:`html5parser` Module
-------------------------
``html5parser`` Module
----------------------

.. automodule:: html5lib.html5parser
:members:
:show-inheritance:
:special-members: __init__

:mod:`serializer` Module
------------------------
``serializer`` Module
---------------------

.. automodule:: html5lib.serializer
:members:
:show-inheritance:
:special-members: __init__

.. autoclass:: html5lib.serializer.HTMLSerializer
:members:
:show-inheritance:
:special-members: __init__

Subpackages
-----------

Expand Down
3 changes: 0 additions & 3 deletions doc/html5lib.treeadapters.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
treeadapters Package
====================

:mod:`~html5lib.treeadapters` Package
-------------------------------------

.. automodule:: html5lib.treeadapters
:members:
:show-inheritance:
Expand Down

0 comments on commit 0e79592

Please sign in to comment.