Fixes #663 - Fixes linting/pylint errors

Signed-off-by: BugFest <bugfest.dev@pm.me>
This commit is contained in:
BugFest 2023-04-09 19:49:08 +02:00 committed by Muayyad Alsadi
parent 2df11674c4
commit 016c97fd1e
7 changed files with 22 additions and 13 deletions

View File

@ -7,6 +7,6 @@ RUN pip install --no-cache-dir -r requirements.txt
COPY . . COPY . .
CMD [ "python", "-m", "App.web" ] CMD [ "python", "-m", "app.web" ]
EXPOSE 8080 EXPOSE 8080

View File

@ -1,3 +1,5 @@
# pylint: disable=import-error
# pylint: disable=unused-import
import os import os
import asyncio # noqa: F401 import asyncio # noqa: F401
@ -14,13 +16,13 @@ routes = web.RouteTableDef()
@routes.get("/") @routes.get("/")
async def hello(request): async def hello(request): # pylint: disable=unused-argument
counter = await redis.incr("mycounter") counter = await redis.incr("mycounter")
return web.Response(text=f"counter={counter}") return web.Response(text=f"counter={counter}")
@routes.get("/hello.json") @routes.get("/hello.json")
async def hello_json(request): async def hello_json(request): # pylint: disable=unused-argument
counter = await redis.incr("mycounter") counter = await redis.incr("mycounter")
data = {"counter": counter} data = {"counter": counter}
return web.json_response(data) return web.json_response(data)

View File

@ -30,7 +30,7 @@ import shlex
try: try:
from shlex import quote as cmd_quote from shlex import quote as cmd_quote
except ImportError: except ImportError:
from pipes import quote as cmd_quote from pipes import quote as cmd_quote # pylint: disable=deprecated-module
# import fnmatch # import fnmatch
# fnmatch.fnmatchcase(env, "*_HOST") # fnmatch.fnmatchcase(env, "*_HOST")
@ -54,7 +54,11 @@ def is_dict(dict_object):
def is_list(list_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 # identity filter

View File

@ -1,3 +1,4 @@
# pylint: disable=redefined-outer-name
import pytest import pytest
from podman_compose import parse_short_mount from podman_compose import parse_short_mount

View File

@ -2,14 +2,16 @@ import os
from setuptools import setup from setuptools import setup
try: try:
readme = open(os.path.join(os.path.dirname(__file__), "README.md")).read() README = open(
except: # noqa: E722 os.path.join(os.path.dirname(__file__), "README.md"), encoding="utf-8"
readme = "" ).read()
except: # noqa: E722 # pylint: disable=bare-except
README = ""
setup( setup(
name="podman-compose", name="podman-compose",
description="A script to run docker-compose.yml using podman", description="A script to run docker-compose.yml using podman",
long_description=readme, long_description=README,
long_description_content_type="text/markdown", long_description_content_type="text/markdown",
classifiers=[ classifiers=[
"Programming Language :: Python", "Programming Language :: Python",

View File

@ -46,16 +46,16 @@ def test_podman_compose_extends_w_file_subdir():
"docker.io/library/busybox", "docker.io/library/busybox",
] ]
out, err, returncode = capture(command_up) out, _, returncode = capture(command_up)
assert 0 == returncode assert 0 == returncode
# check container was created and exists # check container was created and exists
out, err, returncode = capture(command_check_container) out, _, returncode = capture(command_check_container)
assert 0 == returncode assert 0 == returncode
assert out == b'"localhost/subdir_test:me"\n' assert out == b'"localhost/subdir_test:me"\n'
out, err, returncode = capture(command_down) out, _, returncode = capture(command_down)
# cleanup test image(tags) # cleanup test image(tags)
assert 0 == returncode assert 0 == returncode
# check container did not exists anymore # check container did not exists anymore
out, err, returncode = capture(command_check_container) out, _, returncode = capture(command_check_container)
assert 0 == returncode assert 0 == returncode
assert out == b"" assert out == b""