diff --git a/examples/hello-python/Dockerfile b/examples/hello-python/Dockerfile index b879d8f..9706413 100644 --- a/examples/hello-python/Dockerfile +++ b/examples/hello-python/Dockerfile @@ -7,6 +7,6 @@ RUN pip install --no-cache-dir -r requirements.txt COPY . . -CMD [ "python", "-m", "App.web" ] +CMD [ "python", "-m", "app.web" ] EXPOSE 8080 diff --git a/examples/hello-python/App/__init__.py b/examples/hello-python/app/__init__.py similarity index 100% rename from examples/hello-python/App/__init__.py rename to examples/hello-python/app/__init__.py diff --git a/examples/hello-python/App/web.py b/examples/hello-python/app/web.py similarity index 79% rename from examples/hello-python/App/web.py rename to examples/hello-python/app/web.py index e49958c..3008e69 100644 --- a/examples/hello-python/App/web.py +++ b/examples/hello-python/app/web.py @@ -1,3 +1,5 @@ +# pylint: disable=import-error +# pylint: disable=unused-import import os import asyncio # noqa: F401 @@ -14,13 +16,13 @@ routes = web.RouteTableDef() @routes.get("/") -async def hello(request): +async def hello(request): # pylint: disable=unused-argument counter = await redis.incr("mycounter") return web.Response(text=f"counter={counter}") @routes.get("/hello.json") -async def hello_json(request): +async def hello_json(request): # pylint: disable=unused-argument counter = await redis.incr("mycounter") data = {"counter": counter} return web.json_response(data) diff --git a/podman_compose.py b/podman_compose.py index d0125ae..f0b7327 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -30,7 +30,7 @@ import shlex try: from shlex import quote as cmd_quote except ImportError: - from pipes import quote as cmd_quote + from pipes import quote as cmd_quote # pylint: disable=deprecated-module # import fnmatch # fnmatch.fnmatchcase(env, "*_HOST") @@ -54,7 +54,11 @@ def is_dict(dict_object): def is_list(list_object): - return not is_str(list_object) and not is_dict(list_object) and hasattr(list_object, "__iter__") + return ( + not is_str(list_object) + and not is_dict(list_object) + and hasattr(list_object, "__iter__") + ) # identity filter diff --git a/pytests/test_volumes.py b/pytests/test_volumes.py index 8133115..7f9d698 100644 --- a/pytests/test_volumes.py +++ b/pytests/test_volumes.py @@ -1,3 +1,4 @@ +# pylint: disable=redefined-outer-name import pytest from podman_compose import parse_short_mount diff --git a/setup.py b/setup.py index edfdf9f..770649e 100644 --- a/setup.py +++ b/setup.py @@ -2,14 +2,16 @@ import os from setuptools import setup try: - readme = open(os.path.join(os.path.dirname(__file__), "README.md")).read() -except: # noqa: E722 - readme = "" + README = open( + os.path.join(os.path.dirname(__file__), "README.md"), encoding="utf-8" + ).read() +except: # noqa: E722 # pylint: disable=bare-except + README = "" setup( name="podman-compose", description="A script to run docker-compose.yml using podman", - long_description=readme, + long_description=README, long_description_content_type="text/markdown", classifiers=[ "Programming Language :: Python", diff --git a/tests/test_podman_compose.py b/tests/test_podman_compose.py index aaa4672..c255819 100644 --- a/tests/test_podman_compose.py +++ b/tests/test_podman_compose.py @@ -46,16 +46,16 @@ def test_podman_compose_extends_w_file_subdir(): "docker.io/library/busybox", ] - out, err, returncode = capture(command_up) + out, _, returncode = capture(command_up) assert 0 == returncode # check container was created and exists - out, err, returncode = capture(command_check_container) + out, _, returncode = capture(command_check_container) assert 0 == returncode assert out == b'"localhost/subdir_test:me"\n' - out, err, returncode = capture(command_down) + out, _, returncode = capture(command_down) # cleanup test image(tags) assert 0 == returncode # check container did not exists anymore - out, err, returncode = capture(command_check_container) + out, _, returncode = capture(command_check_container) assert 0 == returncode assert out == b""