From d23cbcacf82ce2451852d30e4a260d18a6d39f32 Mon Sep 17 00:00:00 2001 From: Johan Wassberg Date: Tue, 18 Aug 2026 11:25:33 +0200 Subject: [PATCH 1/2] Remove unused namespaces Closes #318 --- src/pyff/builtins.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pyff/builtins.py b/src/pyff/builtins.py index 9c560956..a3a69ae2 100644 --- a/src/pyff/builtins.py +++ b/src/pyff/builtins.py @@ -551,6 +551,11 @@ def _nop(x): resource_name = m.group(2) out = output_file data = req.t + + # clean unused namespaces - the working document isn't always XML (eg discojson* produce JSON) + if isinstance(data, (etree._Element, etree._ElementTree)): + etree.cleanup_namespaces(data) + if not req.args.get('raw'): data = dumptree(req.t, pretty_print=req.args.get('pretty_print')) From 60c1fd1da1bff6ce5c4378288923dce750f52dd2 Mon Sep 17 00:00:00 2001 From: Johan Wassberg Date: Tue, 18 Aug 2026 12:16:54 +0200 Subject: [PATCH 2/2] ruff 0.16 widened its defaults from 2 to 38 rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make CI work and maybe™ fix the issues later. Features and bugs first. --- .github/workflows/python-package.yml | 4 +--- pyproject.toml | 9 +++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 6d056faa..fd4cbf0b 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -27,9 +27,7 @@ jobs: enable-cache: true activate-environment: true - name: Lint with Ruff - run: | - uv tool install ruff - uv run ruff check --output-format=github . + run: uvx ruff check --output-format=github . continue-on-error: false - name: Install dependencies diff --git a/pyproject.toml b/pyproject.toml index 0e815b3d..ba5e18fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,6 +87,15 @@ target-version = "py39" # "UP", # "W", #] +# Pin the rule set explicitly - ruff 0.16 widened its defaults from 2 to 38 rule +# prefixes, so relying on the defaults makes lint results depend on the ruff version. +select = [ + "E4", + "E7", + "E9", + "F", + "I", +] ignore = [ "PLR0915", "PLR0912",