From b1011a1ee5722e166d7b1c719d05a1c35c57d198 Mon Sep 17 00:00:00 2001 From: Patrick Kanzler Date: Thu, 10 Aug 2023 22:26:46 +0200 Subject: [PATCH] enable flake8-docstrings --- examples/barcodes.py | 2 ++ examples/docker-flask/requirements.txt | 1 - setup.cfg | 4 +--- src/escpos/printer.py | 4 ++-- tox.ini | 3 +-- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/examples/barcodes.py b/examples/barcodes.py index 9b13544..8fb26c1 100644 --- a/examples/barcodes.py +++ b/examples/barcodes.py @@ -1,3 +1,5 @@ +""" Example for printing barcodes. +""" from escpos.printer import Usb # Adapt to your needs diff --git a/examples/docker-flask/requirements.txt b/examples/docker-flask/requirements.txt index bb44932..5fdb1c6 100644 --- a/examples/docker-flask/requirements.txt +++ b/examples/docker-flask/requirements.txt @@ -3,7 +3,6 @@ argcomplete==3.0.8 blinker==1.6.2 click==8.1.3 Flask==2.3.2 -future==0.18.3 itsdangerous==2.1.2 Jinja2==3.1.2 MarkupSafe==2.1.2 diff --git a/setup.cfg b/setup.cfg index 4d8c4dc..ddc4195 100644 --- a/setup.cfg +++ b/setup.cfg @@ -31,7 +31,7 @@ project_urls = Release Notes = https://github.com/python-escpos/python-escpos/releases [options] -python_requires = >=3.6 +python_requires = >=3.8 zip_safe = false include_package_data = true install_requires = @@ -46,7 +46,6 @@ install_requires = PyYAML argparse argcomplete - future importlib_resources setup_requires = setuptools_scm tests_require = @@ -65,4 +64,3 @@ tests_require = exclude = .git,.tox,.github,.eggs,__pycache__,doc/conf.py,build,dist,capabilities-data,test,src/escpos/constants.py max-line-length = 120 extend-ignore = E203, W503 -# future-imports = absolute_import, division, print_function, unicode_literals # we are not there yet diff --git a/src/escpos/printer.py b/src/escpos/printer.py index 741966f..7d0697f 100644 --- a/src/escpos/printer.py +++ b/src/escpos/printer.py @@ -423,7 +423,7 @@ if _WIN32PRINT: self.hPrinter = None def _raw(self, msg): - """Print any command sent in raw format + """Print any command sent in raw format. :param msg: arbitrary code to be printed :type msg: bytes @@ -583,7 +583,7 @@ if not sys.platform.startswith("win"): self.lp.terminate() def flush(self): - """End line and wait for new commands""" + """End line and wait for new commands.""" if self.lp.stdin.writable(): self.lp.stdin.write(b"\n") if self.lp.stdin.closed is False: diff --git a/tox.ini b/tox.ini index cfd319d..2a1c134 100644 --- a/tox.ini +++ b/tox.ini @@ -39,7 +39,6 @@ commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html [testenv:flake8] basepython = python -# TODO add flake8-future -# TODO add flake8-docstrings deps = flake8 + flake8-docstrings commands = flake8