Port to non-MacOS platforms (#1026)

* Port to non-MacOS platforms

* Keep NFD normalization on macOS

* Update locale_util.py

Fix lint error from ruff (runs in CI)

* Update query.py

click.Option first arg needs to be a list (different than click.option)

* Dynamically normalize Unicode paths in test

* Fix missing import

---------

Co-authored-by: Rhet Turnbull <rturnbull@gmail.com>
This commit is contained in:
dvdkon
2023-05-07 15:55:56 +02:00
committed by GitHub
parent 0c85298c03
commit ca3da647f2
51 changed files with 726 additions and 360 deletions

16
tests/locale_util.py Normal file
View File

@@ -0,0 +1,16 @@
""" Helpers for running locale-dependent tests """
import contextlib
import locale
import pytest
def setlocale(typ, name):
try:
with contextlib.suppress(Exception):
locale.setlocale(typ, name)
# On Linux UTF-8 locales are separate
locale.setlocale(typ, f"{name}.UTF-8")
except locale.Error:
pytest.skip(f"Locale {name} not available")