Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python-version: '3.9'
- os: ubuntu-latest
python-version: '3.10'
- os: ubuntu-latest
python-version: '3.11'
- os: ubuntu-latest
python-version: '3.12'
- os: ubuntu-latest
python-version: '3.13'
- os: ubuntu-latest
python-version: '3.14'

runs-on: ${{ matrix.os }}
timeout-minutes: 10
Expand Down
20 changes: 15 additions & 5 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
Change Log
==========

Version 0.12.0 (not released yet)
---------------------------------

Other changes:

- support Python 3.13 and 3.14, drop support for Python 3.9
- switch to SPDX license identifier
- use native ``pyproject.toml`` support in tox
- add scripts for sdist, signing, and PyPI upload

Version 0.11.0 (2024-04-05)
---------------------------

Fixes:

- html parser: fix extraction of encoding from meta element
- HTML parser: fix extraction of encoding from meta element
- use raw string for regex, fixes "DeprecationWarning: invalid escape
sequence \s" and others.

New features:

- include version infos into emeraldtree.__init__
- include version info into emeraldtree.__init__

Other changes:

- packaging modernized / enhanced: pyproject.toml, MANIFEST.in, setuptools-scm
- requires Python >= 3.9 now (dropped Python 2.x, removed "six")
- add github actions CI, remove travis CI config
- rst markup fixes / clean ups
- add GitHub Actions CI, remove Travis CI config
- rst markup fixes / cleanups
- use tox for testing

Version 0.10.0 (2015-06-10)
Expand All @@ -28,7 +38,7 @@ Version 0.10.0 (2015-06-10)
Fixes:

- fix setup.py - platform and no download_url
- invalid output from HTML converter parsing preformatted code, multiline
- fix invalid output from HTML converter parsing preformatted code, multiline
paragraphs: part 2 of 2 fixes moin2 #516

Other changes:
Expand Down
24 changes: 12 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ readme = "README.rst"
authors = [{name="Bastian Blank", email="bblank@thinkmo.de"}, ]
maintainers = [{name="Thomas Waldmann", email="tw@waldmann-edv.de"}, ]
description = "EmeraldTree - a light-weight XML object model for Python."
requires-python = ">=3.9"
requires-python = ">=3.10"
keywords = ["xml", "html", "html5", "polyglot", "element", "tree", "dom", "unicode"]
classifiers = [
"Development Status :: 4 - Beta",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: Python Software Foundation License",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Intended Audience :: Developers",
"Topic :: Text Processing :: Markup :: HTML",
"Topic :: Text Processing :: Markup :: XML",
]
license = {text="Python (MIT style)"}
license = "HPND-sell-variant" # aka "Python (MIT Style)" or "Elementtree" license

[project.urls]
"Homepage" = "https://github.com/moinwiki/emeraldtree"
Expand All @@ -30,18 +30,18 @@ license = {text="Python (MIT style)"}
where = ["src"]

[build-system]
requires = ["setuptools", "wheel", "setuptools_scm[toml]"]
requires = ["setuptools>=78.1.1", "wheel", "setuptools_scm[toml]"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "src/emeraldtree/_version.py"

[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py{39,310,311,312}
requires = ["tox>=4"]
env_list = ["py310", "py311", "py312", "py313", "py314"]

[testenv]
deps = pytest
commands = pytest -rs --pyargs {posargs:emeraldtree}
"""
[tool.tox.env.py]
deps = ["pytest"]
commands = [
["pytest", "-rs", "--pyargs", "{posargs:emeraldtree}"]
]
7 changes: 4 additions & 3 deletions src/emeraldtree/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ def handle_starttag(self, tag, attrs):
elif k == "content":
content = v
if http_equiv == "content-type" and content:
import cgi
_, params = cgi.parse_header(content)
encoding = params.get('charset')
from email.message import Message
msg = Message()
msg['content-type'] = content
encoding = msg.get_param('charset', header='content-type')
if encoding:
self.encoding = encoding
if tag.name in self.AUTOCLOSE:
Expand Down