Skip to content

Commit

Permalink
Move as much setup.cfg to pyproject.toml as possible
Browse files Browse the repository at this point in the history
  • Loading branch information
fizyk committed Dec 15, 2022
1 parent 57d82c1 commit 6de9f10
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 31 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/linters.yml
Expand Up @@ -14,4 +14,5 @@ jobs:
uses: fizyk/actions-reuse/.github/workflows/linters-python.yml@v1.6.3
with:
pipenv: true
mypy: true
mypy: true
pydocstyle: false
1 change: 0 additions & 1 deletion Pipfile
Expand Up @@ -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"
13 changes: 1 addition & 12 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions 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.
1 change: 1 addition & 0 deletions port_for/__init__.py
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
"""port_for package."""
__version__ = "0.6.2"

from ._ranges import UNASSIGNED_RANGES
Expand Down
8 changes: 4 additions & 4 deletions 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 <NAME>
Expand Down Expand Up @@ -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__,
Expand Down
6 changes: 3 additions & 3 deletions port_for/docopt.py
Expand Up @@ -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 = ""
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions setup.cfg
@@ -1,13 +1,3 @@
[pycodestyle]
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/
filterwarnings = error
xfail_strict = True

0 comments on commit 6de9f10

Please sign in to comment.