From 8366e519d60884aa61011795cacc617bf5721d28 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Wed, 1 Feb 2023 17:08:09 +0200 Subject: [PATCH] port from deprecated appdirs to platformdirs --- .github/workflows/mypy.yaml | 2 +- .github/workflows/tests.yaml | 2 +- README.rst | 2 +- docs/requirements.txt | 2 +- docs/usage.rst | 2 +- mypy.ini | 3 --- nvchecker/core.py | 4 ++-- setup.cfg | 2 +- 8 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/mypy.yaml b/.github/workflows/mypy.yaml index 83fc70d..6102194 100644 --- a/.github/workflows/mypy.yaml +++ b/.github/workflows/mypy.yaml @@ -18,7 +18,7 @@ jobs: ${{ runner.os }}-${{ env.cache-name }}- ${{ runner.os }}-cache-pip- - name: Install deps - run: pip3 install -U tornado pytest pytest-asyncio pytest-httpbin flaky structlog tomli aiohttp httpx mypy awesomeversion + run: pip3 install -U tornado pytest pytest-asyncio pytest-httpbin flaky structlog tomli platformdirs aiohttp httpx mypy awesomeversion - name: Run mypy for --install-types run: PATH=$HOME/.local/bin:$PATH mypy --namespace-packages --explicit-package-bases nvchecker nvchecker_source tests continue-on-error: true diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 9e10083..df1bd15 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -45,7 +45,7 @@ jobs: sudo apt install -y libcurl4-openssl-dev # werkzeug is pinned for httpbin compatibility https://github.com/postmanlabs/httpbin/issues/673 - name: Install Python deps - run: pip install -U ${{ matrix.deps }} pytest pytest-asyncio pytest-httpbin flaky structlog tomli appdirs lxml 'werkzeug<2.1' awesomeversion + run: pip install -U ${{ matrix.deps }} pytest pytest-asyncio pytest-httpbin flaky structlog tomli platformdirs lxml 'werkzeug<2.1' awesomeversion - name: Decrypt keys env: KEY: ${{ secrets.KEY }} diff --git a/README.rst b/README.rst index 08ef28f..30f5d19 100644 --- a/README.rst +++ b/README.rst @@ -24,7 +24,7 @@ This is the version 2.0 branch. For the old version 1.x, please switch to the `` Dependency ---------- - Python 3.7+ -- Python library: structlog, tomli, appdirs +- Python library: structlog, tomli, platformdirs - One of these Python library combinations (ordered by preference): * tornado + pycurl diff --git a/docs/requirements.txt b/docs/requirements.txt index b1552e9..b11546c 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,6 +1,6 @@ tomli structlog -appdirs +platformdirs tornado>=6 sphinx>=3.2 # <5 has strange bottom margins for p, and no list indicators diff --git a/docs/usage.rst b/docs/usage.rst index 5be3fe0..53ebddb 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -18,7 +18,7 @@ This is the version 2.0 branch. For the old version 1.x, please switch to the `` Dependency ---------- - Python 3.7+ -- Python library: structlog, tomli, appdirs +- Python library: structlog, tomli, platformdirs - One of these Python library combinations (ordered by preference): * tornado + pycurl diff --git a/mypy.ini b/mypy.ini index 1aead6f..35e49cb 100644 --- a/mypy.ini +++ b/mypy.ini @@ -18,8 +18,5 @@ ignore_missing_imports = True [mypy-pytest_httpbin] ignore_missing_imports = True -[mypy-appdirs] -ignore_missing_imports = True - [mypy-lxml] ignore_missing_imports = True diff --git a/nvchecker/core.py b/nvchecker/core.py index 5373601..84a3829 100644 --- a/nvchecker/core.py +++ b/nvchecker/core.py @@ -22,7 +22,7 @@ import json import structlog import tomli -import appdirs +import platformdirs from .lib import nicelogger from . import slogconf @@ -40,7 +40,7 @@ from . import httpclient logger = structlog.get_logger(logger_name=__name__) def get_default_config() -> str: - confdir = appdirs.user_config_dir(appname='nvchecker') + confdir = platformdirs.user_config_dir(appname='nvchecker') file = os.path.join(confdir, 'nvchecker.toml') return file diff --git a/setup.cfg b/setup.cfg index a876b3d..c0b7627 100644 --- a/setup.cfg +++ b/setup.cfg @@ -43,7 +43,7 @@ install_requires = setuptools; python_version<"3.8" tomli structlog - appdirs + platformdirs tornado>=6 pycurl scripts =