From 0ccd024602059956384b732170ece64e4ed11316 Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Mon, 27 Apr 2026 19:40:31 +0200 Subject: [PATCH 01/13] Add tox.ini to do local matrix test --- README.md | 4 ++++ tox.ini | 10 ++++++++++ 2 files changed, 14 insertions(+) create mode 100644 tox.ini diff --git a/README.md b/README.md index 60a6b8b..ad2c78d 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,10 @@ automatically by Travis-CI) pip install pytest python -m pytest +To run the full matrix of Python versions locally using Docker: + + docker run --rm -v .:/src -w /src makukha/multipython:unsafe tox run -m old + Quick Start ----------- diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..2781735 --- /dev/null +++ b/tox.ini @@ -0,0 +1,10 @@ +[tox] +envlist = py27,py34,py35,py36 +labels = + old = py27,py34,py35,py36 + +[testenv] +deps = + pytest + mf2py +commands = pytest tests From bbfc43881de49f1b874289c3070d01f6a86923ac Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Mon, 27 Apr 2026 19:40:41 +0200 Subject: [PATCH 02/13] Drop py34, not available in multipython --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 2781735..05bcd18 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] -envlist = py27,py34,py35,py36 +envlist = py27,py35,py36 labels = - old = py27,py34,py35,py36 + old = py27,py35,py36 [testenv] deps = From 6ce823398322934c6c2caf1ec48ce81ef2aee656 Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Mon, 27 Apr 2026 19:40:46 +0200 Subject: [PATCH 03/13] Fix Unicode test failures on non-UTF-8 locales --- tests/test_interpret.py | 3 ++- tests/test_post_type_discovery.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_interpret.py b/tests/test_interpret.py index e134d94..19b32d2 100644 --- a/tests/test_interpret.py +++ b/tests/test_interpret.py @@ -4,12 +4,13 @@ """ from __future__ import unicode_literals from datetime import datetime, date, timedelta +import io import mf2util import json def load_test(testname): - return json.load(open('tests/interpret/%s.json' % testname)) + return json.load(io.open('tests/interpret/%s.json' % testname, encoding='utf-8')) def test_event(): diff --git a/tests/test_post_type_discovery.py b/tests/test_post_type_discovery.py index fffdd54..a169fbe 100644 --- a/tests/test_post_type_discovery.py +++ b/tests/test_post_type_discovery.py @@ -1,6 +1,7 @@ """Tests for post_type_discovery """ +import io import json import mf2util @@ -21,7 +22,7 @@ def test_post_type_discovery(): ('posttype/hcard_org', 'org'), # TODO add more tests ]: - parsed = json.load(open('tests/' + test + '.json')) + parsed = json.load(io.open('tests/' + test + '.json', encoding='utf-8')) types = (['h-card'] if implied_type in ('person', 'org') else ['h-entry', 'h-event']) entry = mf2util.find_first_entry(parsed, types) From 90f189ce338e2ea5ad7d124ccc51e3906076ace4 Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Mon, 27 Apr 2026 19:40:53 +0200 Subject: [PATCH 04/13] Add py37 to test matrix --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 05bcd18..ed1d20c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] -envlist = py27,py35,py36 +envlist = py27,py35,py36,py37 labels = - old = py27,py35,py36 + old = py27,py35,py36,py37 [testenv] deps = From 9216a6f8b769813db0e44e412e1267619ea43bbe Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Mon, 27 Apr 2026 19:40:57 +0200 Subject: [PATCH 05/13] Fix invalid regex escape sequences --- mf2util.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mf2util.py b/mf2util.py index 6354d0c..b0015f6 100644 --- a/mf2util.py +++ b/mf2util.py @@ -385,7 +385,7 @@ def do_convert(match): for tagname, attributes in URL_ATTRIBUTES.items(): for attribute in attributes: pattern = re.compile( - '<%s[^>]*?%s\s*=\s*[\'"](.*?)[\'"]' % (tagname, attribute), + r'<%s[^>]*?%s\s*=\s*[\'"](.*?)[\'"]' % (tagname, attribute), flags=re.DOTALL | re.MULTILINE | re.IGNORECASE) html = pattern.sub(do_convert, html) @@ -484,10 +484,10 @@ def parse_datetime(s): if not s: return None - s = re.sub('\s+', ' ', s) - date_re = "(?P\d{4,})-(?P\d{1,2})-(?P\d{1,2})" - time_re = "(?P\d{1,2}):(?P\d{2})(:(?P\d{2})(\.(?P\d+))?)?" - tz_re = "(?PZ)|(?P[+-])(?P\d{1,2}):?(?P\d{2})" + s = re.sub(r'\s+', ' ', s) + date_re = r"(?P\d{4,})-(?P\d{1,2})-(?P\d{1,2})" + time_re = r"(?P\d{1,2}):(?P\d{2})(:(?P\d{2})(\.(?P\d+))?)?" + tz_re = r"(?PZ)|(?P[+-])(?P\d{1,2}):?(?P\d{2})" dt_re = "%s((T| )%s ?(%s)?)?$" % (date_re, time_re, tz_re) m = re.match(dt_re, s) From 87cd37461201dea852e3ce4b6c97fc28df9bf57c Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Mon, 27 Apr 2026 19:41:13 +0200 Subject: [PATCH 06/13] Add py38 to test matrix --- README.md | 6 +++++- tox.ini | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ad2c78d..047b9c5 100644 --- a/README.md +++ b/README.md @@ -38,10 +38,14 @@ automatically by Travis-CI) pip install pytest python -m pytest -To run the full matrix of Python versions locally using Docker: +To run the full matrix of Python versions locally, use two commands: + # old Python versions (via Docker) docker run --rm -v .:/src -w /src makukha/multipython:unsafe tox run -m old + # modern Python versions (via uv) + uvx --with tox-uv tox run -m new + Quick Start ----------- diff --git a/tox.ini b/tox.ini index ed1d20c..638eee4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,8 @@ [tox] -envlist = py27,py35,py36,py37 +envlist = py27,py35,py36,py37,py38 labels = old = py27,py35,py36,py37 + new = py38 [testenv] deps = From 52315ea2e772eb099350a9c74432a34753018280 Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Mon, 27 Apr 2026 19:41:38 +0200 Subject: [PATCH 07/13] Add py39 to test matrix --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 638eee4..bbd7a3e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] -envlist = py27,py35,py36,py37,py38 +envlist = py27,py35,py36,py37,py38,py39 labels = old = py27,py35,py36,py37 - new = py38 + new = py38,py39 [testenv] deps = From 2e9525981dc68817aaeb5b51d3bdbb1b11041a65 Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Mon, 27 Apr 2026 19:41:44 +0200 Subject: [PATCH 08/13] Add py310 to test matrix --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index bbd7a3e..ac573ba 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] -envlist = py27,py35,py36,py37,py38,py39 +envlist = py27,py35,py36,py37,py38,py39,py310 labels = old = py27,py35,py36,py37 - new = py38,py39 + new = py38,py39,py310 [testenv] deps = From 27dcb89a4900d1cc285b468631a50f62fa37ca53 Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Mon, 27 Apr 2026 19:41:54 +0200 Subject: [PATCH 09/13] Add py311 to test matrix --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index ac573ba..a3a1207 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] -envlist = py27,py35,py36,py37,py38,py39,py310 +envlist = py27,py35,py36,py37,py38,py39,py310,py311 labels = old = py27,py35,py36,py37 - new = py38,py39,py310 + new = py38,py39,py310,py311 [testenv] deps = From 0ad64187591c3162dae005644880518979cf27df Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Mon, 27 Apr 2026 19:42:01 +0200 Subject: [PATCH 10/13] Add py312 to test matrix --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index a3a1207..0d23ed7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] -envlist = py27,py35,py36,py37,py38,py39,py310,py311 +envlist = py27,py35,py36,py37,py38,py39,py310,py311,py312 labels = old = py27,py35,py36,py37 - new = py38,py39,py310,py311 + new = py38,py39,py310,py311,py312 [testenv] deps = From 34e8add01e503d9976507d1063272d9ad53217f9 Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Mon, 27 Apr 2026 19:42:10 +0200 Subject: [PATCH 11/13] Add py313 to test matrix --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 0d23ed7..601b90e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] -envlist = py27,py35,py36,py37,py38,py39,py310,py311,py312 +envlist = py27,py35,py36,py37,py38,py39,py310,py311,py312,py313 labels = old = py27,py35,py36,py37 - new = py38,py39,py310,py311,py312 + new = py38,py39,py310,py311,py312,py313 [testenv] deps = From 7294ca3fb4dc0178f43c93a53b4750f0f2208cb4 Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Mon, 27 Apr 2026 19:42:19 +0200 Subject: [PATCH 12/13] Add py314 to test matrix --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 601b90e..938071e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] -envlist = py27,py35,py36,py37,py38,py39,py310,py311,py312,py313 +envlist = py27,py35,py36,py37,py38,py39,py310,py311,py312,py313,py314 labels = old = py27,py35,py36,py37 - new = py38,py39,py310,py311,py312,py313 + new = py38,py39,py310,py311,py312,py313,py314 [testenv] deps = From b35f901f825c8f583a679e457acc4dd91ac7c333 Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Mon, 27 Apr 2026 20:04:54 +0200 Subject: [PATCH 13/13] Set local fork version to 0.5.2+zegnat.1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5dd522b..fe830f4 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ def run_tests(self): setup(name='mf2util', - version='0.5.2', + version='0.5.2+zegnat.1', description='Python Microformats2 utilities, a companion to mf2py', long_description=""" Microformats2 Utilities