diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12fe688..1037467 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/CHANGES.rst b/CHANGES.rst index 3b5abe0..4be64ef 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -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) @@ -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: diff --git a/pyproject.toml b/pyproject.toml index e20114c..2a37c1a 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" @@ -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}"] +] diff --git a/src/emeraldtree/html.py b/src/emeraldtree/html.py index 2d94742..21dd91e 100644 --- a/src/emeraldtree/html.py +++ b/src/emeraldtree/html.py @@ -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: