fix setuptools_scm argparse usage

This commit is contained in:
Robert Kaussow 2020-03-01 18:55:30 +01:00
parent 4284f65f7f
commit 12b6e10737
3 changed files with 9 additions and 3 deletions

View File

@ -6,11 +6,14 @@ import logging
import os
import sys
from importlib_metadata import PackageNotFoundError
from importlib_metadata import version
import dockertidy.Exception
from dockertidy import __version__
from dockertidy.Config import SingleConfig
from dockertidy.Utils import SingleLog
from dockertidy.Utils import timedelta_type
from importlib_metadata import version, PackageNotFoundError
class DockerTidy:
@ -34,7 +37,7 @@ class DockerTidy:
parser.add_argument("-q", dest="logging.level", action="append_const",
const=1, help="decrease log level")
parser.add_argument("--version", action="version",
version=version(__name__))
version="%(prog)s {}".format(__version__))
subparsers = parser.add_subparsers(help="sub-command help")

View File

@ -1,4 +1,6 @@
"""Default package."""
from importlib_metadata import PackageNotFoundError
from importlib_metadata import version
__author__ = "Robert Kaussow"
__project__ = "docker-tidy"
@ -6,3 +8,4 @@ __license__ = "Apache-2.0"
__maintainer__ = "Robert Kaussow"
__email__ = "mail@geeklabor.de"
__url__ = "https://github.com/xoxys/docker-tidy"
__version__ = version("docker-tidy")

View File

@ -1,9 +1,9 @@
import textwrap
from io import StringIO
import docker.errors
import requests.exceptions
from docker_custodian import docker_gc
from io import StringIO
try:
from unittest import mock