diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5ba1d63..6c19858 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -41,7 +41,7 @@ jobs: if: ${{ contains(matrix.deps, 'pycurl') }} run: sudo apt install -y libcurl4-openssl-dev - name: Install Python deps - run: pip install -U ${{ matrix.deps }} pytest pytest-asyncio pytest-httpbin flaky structlog toml appdirs + run: pip install -U ${{ matrix.deps }} pytest pytest-asyncio pytest-httpbin flaky structlog toml appdirs lxml - name: Decrypt keys env: KEY: ${{ secrets.KEY }} diff --git a/docs/usage.rst b/docs/usage.rst index 417f3ba..3ea61a6 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -286,7 +286,7 @@ xpath An xpath expression used to find the version string. .. note:: - An additional dependency "lxml" is required + An additional dependency "lxml" is required. Find with a Command ~~~~~~~~~~~~~~~~~~~ diff --git a/mypy.ini b/mypy.ini index a02b84b..1aead6f 100644 --- a/mypy.ini +++ b/mypy.ini @@ -20,3 +20,6 @@ ignore_missing_imports = True [mypy-appdirs] ignore_missing_imports = True + +[mypy-lxml] +ignore_missing_imports = True diff --git a/nvchecker/api.py b/nvchecker/api.py index e03a076..cd9b991 100644 --- a/nvchecker/api.py +++ b/nvchecker/api.py @@ -8,4 +8,4 @@ from .util import ( ) from .sortversion import sort_version_keys -from .ctxvars import tries, proxy, user_agent, httptoken, entry_waiter \ No newline at end of file +from .ctxvars import tries, proxy, user_agent, httptoken, entry_waiter diff --git a/nvchecker/ctxvars.py b/nvchecker/ctxvars.py index b827850..eb82a29 100644 --- a/nvchecker/ctxvars.py +++ b/nvchecker/ctxvars.py @@ -17,4 +17,4 @@ tries = ContextVar('tries', default=1) proxy: ContextVar[Optional[str]] = ContextVar('proxy', default=None) user_agent = ContextVar('user_agent', default=DEFAULT_USER_AGENT) httptoken = ContextVar('httptoken', default=None) -entry_waiter: ContextVar[EntryWaiter] = ContextVar('entry_waiter') \ No newline at end of file +entry_waiter: ContextVar[EntryWaiter] = ContextVar('entry_waiter') diff --git a/nvchecker/util.py b/nvchecker/util.py index 0d6bb5d..42994e2 100644 --- a/nvchecker/util.py +++ b/nvchecker/util.py @@ -264,7 +264,6 @@ class FunctionWorker(BaseWorker): except Exception as e: await self.result_q.put(RawResult(name, e, entry)) - class GetVersionError(Exception): '''An error occurred while getting version information. diff --git a/tests/test_htmlpasrer.py b/tests/test_htmlpasrer.py index dcbabae..f3be52b 100644 --- a/tests/test_htmlpasrer.py +++ b/tests/test_htmlpasrer.py @@ -18,4 +18,4 @@ async def test_xpath_missing_ok(get_version): "url": "http://httpbin.org/", "xpath": '//pre[@class="test-is-ok"]/text()', "missing_ok": True, - }) is None \ No newline at end of file + }) is None diff --git a/tests/test_httpheader.py b/tests/test_httpheader.py index 53ddd3a..091dbc2 100644 --- a/tests/test_httpheader.py +++ b/tests/test_httpheader.py @@ -3,7 +3,7 @@ import pytest import pytest_httpbin -assert pytest_httpbin # for pyflakes +assert pytest_httpbin # for pyflakes pytestmark = [pytest.mark.asyncio, pytest.mark.needs_net] async def test_redirection(get_version): @@ -11,7 +11,7 @@ async def test_redirection(get_version): "source": "httpheader", "url": "https://www.unifiedremote.com/download/linux-x64-deb", "regex": r'urserver-([\d.]+).deb', - }) != None + }) is not None async def test_get_version_withtoken(get_version, httpbin): assert await get_version("unifiedremote", { @@ -20,4 +20,4 @@ async def test_get_version_withtoken(get_version, httpbin): "httptoken": "Basic dXNlcm5hbWU6c3VwZXJwYXNzd29yZA==", "header": "server", "regex": r'([0-9.]+)*', - }) != None \ No newline at end of file + }) is not None diff --git a/tests/test_regex.py b/tests/test_regex.py index 65f4102..739700c 100644 --- a/tests/test_regex.py +++ b/tests/test_regex.py @@ -5,7 +5,7 @@ import base64 import pytest import pytest_httpbin -assert pytest_httpbin # for pyflakes +assert pytest_httpbin # for pyflakes pytestmark = pytest.mark.asyncio @@ -57,4 +57,4 @@ async def test_regex_with_tokenBearer(get_version, httpbin): "url": httpbin.url + "/bearer", "httptoken": "Bearer username:password", "regex": r'"token":"([a-w]+):.*"', - }) == "username" \ No newline at end of file + }) == "username"