port from deprecated appdirs to platformdirs

This commit is contained in:
Alexandru Fikl 2023-02-01 17:08:09 +02:00
parent 2782205efc
commit 8366e519d6
No known key found for this signature in database
GPG key ID: 32C1509CB6EE436B
8 changed files with 8 additions and 11 deletions

View file

@ -18,7 +18,7 @@ jobs:
${{ runner.os }}-${{ env.cache-name }}- ${{ runner.os }}-${{ env.cache-name }}-
${{ runner.os }}-cache-pip- ${{ runner.os }}-cache-pip-
- name: Install deps - 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 - name: Run mypy for --install-types
run: PATH=$HOME/.local/bin:$PATH mypy --namespace-packages --explicit-package-bases nvchecker nvchecker_source tests run: PATH=$HOME/.local/bin:$PATH mypy --namespace-packages --explicit-package-bases nvchecker nvchecker_source tests
continue-on-error: true continue-on-error: true

View file

@ -45,7 +45,7 @@ jobs:
sudo apt install -y libcurl4-openssl-dev sudo apt install -y libcurl4-openssl-dev
# werkzeug is pinned for httpbin compatibility https://github.com/postmanlabs/httpbin/issues/673 # werkzeug is pinned for httpbin compatibility https://github.com/postmanlabs/httpbin/issues/673
- name: Install Python deps - 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 - name: Decrypt keys
env: env:
KEY: ${{ secrets.KEY }} KEY: ${{ secrets.KEY }}

View file

@ -24,7 +24,7 @@ This is the version 2.0 branch. For the old version 1.x, please switch to the ``
Dependency Dependency
---------- ----------
- Python 3.7+ - Python 3.7+
- Python library: structlog, tomli, appdirs - Python library: structlog, tomli, platformdirs
- One of these Python library combinations (ordered by preference): - One of these Python library combinations (ordered by preference):
* tornado + pycurl * tornado + pycurl

View file

@ -1,6 +1,6 @@
tomli tomli
structlog structlog
appdirs platformdirs
tornado>=6 tornado>=6
sphinx>=3.2 sphinx>=3.2
# <5 has strange bottom margins for p, and no list indicators # <5 has strange bottom margins for p, and no list indicators

View file

@ -18,7 +18,7 @@ This is the version 2.0 branch. For the old version 1.x, please switch to the ``
Dependency Dependency
---------- ----------
- Python 3.7+ - Python 3.7+
- Python library: structlog, tomli, appdirs - Python library: structlog, tomli, platformdirs
- One of these Python library combinations (ordered by preference): - One of these Python library combinations (ordered by preference):
* tornado + pycurl * tornado + pycurl

View file

@ -18,8 +18,5 @@ ignore_missing_imports = True
[mypy-pytest_httpbin] [mypy-pytest_httpbin]
ignore_missing_imports = True ignore_missing_imports = True
[mypy-appdirs]
ignore_missing_imports = True
[mypy-lxml] [mypy-lxml]
ignore_missing_imports = True ignore_missing_imports = True

View file

@ -22,7 +22,7 @@ import json
import structlog import structlog
import tomli import tomli
import appdirs import platformdirs
from .lib import nicelogger from .lib import nicelogger
from . import slogconf from . import slogconf
@ -40,7 +40,7 @@ from . import httpclient
logger = structlog.get_logger(logger_name=__name__) logger = structlog.get_logger(logger_name=__name__)
def get_default_config() -> str: 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') file = os.path.join(confdir, 'nvchecker.toml')
return file return file

View file

@ -43,7 +43,7 @@ install_requires =
setuptools; python_version<"3.8" setuptools; python_version<"3.8"
tomli tomli
structlog structlog
appdirs platformdirs
tornado>=6 tornado>=6
pycurl pycurl
scripts = scripts =