diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index d2a6adc..519a366 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -14,4 +14,5 @@ jobs: uses: fizyk/actions-reuse/.github/workflows/linters-python.yml@v1.6.3 with: pipenv: true - mypy: true \ No newline at end of file + mypy: true + pydocstyle: false \ No newline at end of file diff --git a/Pipfile b/Pipfile index 603708f..ea678bb 100644 --- a/Pipfile +++ b/Pipfile @@ -11,7 +11,6 @@ pytest = "==7.2.0" pytest-cov = "==4.0.0" coverage = "==6.5.0" black = "==22.12.0" -pydocstyle = {version = "==6.1.1", extras = ["toml"]} pycodestyle = "==2.10.0" mypy = "==0.991" tbump = "==6.9.0" diff --git a/Pipfile.lock b/Pipfile.lock index 28672bd..ea3b749 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "6d3cabf24024e99de98efca883c80051b3a7be0561bde81c7c7c8914e448f72c" + "sha256": "e6062a19cbdea4937bb91a710c02501b9569644e9f5039cd2efcace2e32fa839" }, "pipfile-spec": 6, "requires": {}, @@ -292,17 +292,6 @@ "index": "pypi", "version": "==2.10.0" }, - "pydocstyle": { - "extras": [ - "toml" - ], - "hashes": [ - "sha256:1d41b7c459ba0ee6c345f2eb9ae827cab14a7533a88c5c6f7e94923f72df92dc", - "sha256:6987826d6775056839940041beef5c08cc7e3d71d63149b48e36727f70144dc4" - ], - "index": "pypi", - "version": "==6.1.1" - }, "pytest": { "hashes": [ "sha256:892f933d339f068883b6fd5a459f03d85bfcb355e4981e146d2c7616c21fef71", diff --git a/newsfragments/112.misc.rst b/newsfragments/112.misc.rst new file mode 100644 index 0000000..400ad82 --- /dev/null +++ b/newsfragments/112.misc.rst @@ -0,0 +1,2 @@ +Moved as much of the setup.cfg settings into the pyproject.toml as possible. +Dropped pydocstyle support. \ No newline at end of file diff --git a/port_for/__init__.py b/port_for/__init__.py index 54ec646..4586dc0 100644 --- a/port_for/__init__.py +++ b/port_for/__init__.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +"""port_for package.""" __version__ = "0.6.2" from ._ranges import UNASSIGNED_RANGES diff --git a/port_for/cmd.py b/port_for/cmd.py index 8667dd7..be28902 100644 --- a/port_for/cmd.py +++ b/port_for/cmd.py @@ -1,9 +1,8 @@ #!/usr/bin/env python """ -cmd.py is a command-line utility that -helps with local TCP ports management. It -finds 'good' unused TCP localhost port and -remembers the association. +cmd.py is a command-line utility that helps with local TCP ports management. + +It finds 'good' unused TCP localhost port and remembers the association. Usage: port-for @@ -48,6 +47,7 @@ def _unbind(app: str) -> None: def main() -> None: + """port-for executable entrypoint.""" args = docopt( __doc__, version="port-for %s" % port_for.__version__, diff --git a/port_for/docopt.py b/port_for/docopt.py index 57cccd6..88a494a 100644 --- a/port_for/docopt.py +++ b/port_for/docopt.py @@ -4,12 +4,10 @@ class DocoptLanguageError(Exception): - """Error in construction of usage-message by developer.""" class DocoptExit(SystemExit): - """Exit in case user invoked program with incorrect arguments.""" usage = "" @@ -447,11 +445,13 @@ def extras(help, version, options, doc): class Dict(dict): + """Dictionary with custom repr bbehaviour.""" def __repr__(self): + """Dictionary representation for docopt.""" return "{%s}" % ",\n ".join("%r: %r" % i for i in sorted(self.items())) -def docopt(doc, argv=sys.argv[1:], help=True, version=None): +def docopt(doc, argv=sys.argv[1:], help=True, version=None): # noqa DocoptExit.usage = docopt.usage = usage = printable_usage(doc) pot_options = parse_doc_options(doc) formal_pattern = parse_pattern(formal_usage(usage), options=pot_options) diff --git a/pyproject.toml b/pyproject.toml index 83d8e5a..14d8cd9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,6 +49,11 @@ packages = ["port_for"] [tool.setuptools.package-data] port_for = ["py.typed"] +[tool.pytest.ini_options] +xfail_strict=true +testpaths = "tests" +filterwarnings = "error" + [tool.towncrier] directory = "newsfragments" single_file=true @@ -71,6 +76,9 @@ showcontent = true name = "Miscellaneus" showcontent = true +[tool.pydocstyle] +ignore = "D203,D212" + [tool.black] line-length = 80 target-version = ['py38'] diff --git a/setup.cfg b/setup.cfg index 7592ce9..93005b3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,10 +2,6 @@ max-line-length = 80 exclude = docs/*,build/*,venv/* -[pydocstyle] -ignore = D203,D212 -match = '(?!docs|build|venv).*\.py' - [tool:pytest] addopts = -vvv --capture=no --showlocals testpaths = tests/