Closed pgajdos closed 2 years ago
openSUSE Tumbleweed unpins black and currently uses 21.12b0. It even ignores that black pins tomli to <2 until black 22.1.0
tomli 2 expects a BinaryIO object.
Fixed by
--- blue-0.8.0.orig/blue/__init__.py
+++ blue-0.8.0/blue/__init__.py
@@ -263,8 +263,8 @@ def parse_pyproject_toml(path_config: st
If parsing fails, will raise a tomli.TOMLDecodeError
"""
- with open(path_config, encoding="utf8") as f:
- pyproject_toml = tomli.load(f) # type: ignore # due to deprecated API usage
+ with open(path_config, mode='rb') as f:
+ pyproject_toml = tomli.load(f)
config = pyproject_toml.get("tool", {}).get("blue", {})
return {k.replace("--", "").replace("-", "_"): v for k, v in config.items()}
I believe these issues and the mentioned change will be available in 0.9.0, which I intend to release today. If not, please open a new issue.
I get:
Details at: https://build.opensuse.org/package/live_build_log/devel:languages:python/python-blue/openSUSE_Tumbleweed/x86_64