From 0ba53dbf800381b9e3777c1bd3da8be6ee4665ff Mon Sep 17 00:00:00 2001 From: Claudio Matsuoka Date: Tue, 9 May 2023 15:00:01 -0300 Subject: [PATCH] requirements: pin urllib3 version to prevent request problems (#440) * requirements: pin urllib3 version to prevent request problems * lint: temporary workaround for pyxdg pyright issues Co-authored-by: Alex Lowe Signed-off-by: Claudio Matsuoka --- setup.py | 1 + tests/conftest.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 8718046a9..e86579935 100644 --- a/setup.py +++ b/setup.py @@ -47,6 +47,7 @@ def is_rtd() -> bool: "pyxdg", "requests", "requests-unixsocket", + "urllib3<2", # keep compatible API ] diff --git a/tests/conftest.py b/tests/conftest.py index 74baea2fc..a83a55cd3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -72,10 +72,16 @@ def temp_xdg(tmpdir, mocker): mocker.patch("xdg.BaseDirectory.xdg_data_home", new=os.path.join(tmpdir, ".local")) mocker.patch("xdg.BaseDirectory.xdg_cache_home", new=os.path.join(tmpdir, ".cache")) mocker.patch( - "xdg.BaseDirectory.xdg_config_dirs", new=[xdg.BaseDirectory.xdg_config_home] + "xdg.BaseDirectory.xdg_config_dirs", + new=[ + xdg.BaseDirectory.xdg_config_home # pyright: ignore[reportGeneralTypeIssues] + ], ) mocker.patch( - "xdg.BaseDirectory.xdg_data_dirs", new=[xdg.BaseDirectory.xdg_data_home] + "xdg.BaseDirectory.xdg_data_dirs", + new=[ + xdg.BaseDirectory.xdg_data_home # pyright: ignore[reportGeneralTypeIssues] + ], ) mocker.patch.dict(os.environ, {"XDG_CONFIG_HOME": os.path.join(tmpdir, ".config")})