switch to poetry

This commit is contained in:
Robert Kaussow 2020-11-15 20:51:26 +01:00
parent 1d1d45d5e0
commit 8f9d40a31e
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61
11 changed files with 1674 additions and 1296 deletions

6
.style.yapf Normal file
View File

@ -0,0 +1,6 @@
[style]
based_on_style = google
column_limit = 99
dedent_closing_brackets = true
coalesce_brackets = true
split_before_logical_operator = true

20
Makefile Normal file
View File

@ -0,0 +1,20 @@
# renovate: datasource=github-releases depName=thegeeklab/hugo-geekdoc
THEME_VERSION := v0.5.0
THEME := hugo-geekdoc
BASEDIR := docs
THEMEDIR := $(BASEDIR)/themes
.PHONY: all
all: doc
.PHONY: doc
doc: doc-assets
.PHONY: doc-assets
doc-assets:
mkdir -p $(THEMEDIR)/$(THEME)/ ; \
curl -sSL "https://github.com/thegeeklab/$(THEME)/releases/download/${THEME_VERSION}/$(THEME).tar.gz" | tar -xz -C $(THEMEDIR)/$(THEME)/ --strip-components=1
.PHONY: clean
clean:
rm -rf $(THEMEDIR) && \

51
Pipfile
View File

@ -1,51 +0,0 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
pipenv-setup = "*"
pydocstyle = "<4.0.0"
flake8 = "*"
flake8-colors = "*"
flake8-blind-except = "*"
flake8-builtins = "*"
flake8-docstrings = "<=3.0.0"
flake8-isort = "*"
flake8-logging-format = "*"
flake8-polyfill = "*"
flake8-quotes = "*"
flake8-pep3101 = "*"
flake8-eradicate = {version = "*",markers = "python_version>='3.6'"}
pep8-naming = "*"
pytest = "*"
pytest-mock = "*"
pytest-cov = "*"
bandit = "*"
docker-tidy = {editable = true,path = "."}
autopep8 = "*"
yapf = "*"
pathlib2 = "*"
[packages]
zipp = "<2.0.0"
importlib-metadata = {version = "*",markers = "python_version<'3.8'"}
certifi = "*"
chardet = "*"
docker = "*"
docker-pycreds = "*"
idna = "*"
ipaddress = "*"
python-dateutil = "*"
requests = "*"
appdirs = "*"
colorama = "*"
anyconfig = "*"
pathspec = "*"
python-json-logger = "*"
jsonschema = "*"
environs = "*"
nested-lookup = "*"
"ruamel.yaml" = "*"
websocket-client = "*"
dateparser = "*"

1087
Pipfile.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -143,3 +143,7 @@ class DockerTidy:
self.gc.run()
elif self.config.config["command"] == "stop":
self.stop.run()
def main():
DockerTidy()

View File

@ -1,15 +1,3 @@
#!/usr/bin/env python3
"""Default package."""
try:
from importlib import metadata
except ImportError: # for Python<3.8
import importlib_metadata as metadata
__author__ = "Robert Kaussow"
__project__ = "docker-tidy"
__license__ = "Apache-2.0"
__maintainer__ = "Robert Kaussow"
__email__ = "mail@thegeeklab.de"
__url__ = "https://github.com/thegeeklab/docker-tidy"
__version__ = metadata.version("docker-tidy")
__version__ = "0.0.0"

View File

@ -1,12 +0,0 @@
#!/usr/bin/env python3
"""Main program."""
from dockertidy.Cli import DockerTidy
def main():
DockerTidy()
if __name__ == "__main__":
main()

1530
poetry.lock generated Normal file

File diff suppressed because it is too large Load Diff

113
pyproject.toml Normal file
View File

@ -0,0 +1,113 @@
[tool.poetry]
authors = ["Robert Kaussow <mail@thegeeklab.de>"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: System Administrators",
"Natural Language :: English",
"Operating System :: POSIX",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: System :: Systems Administration",
"Topic :: Utilities",
"Topic :: Software Development",
]
description = "Keep docker hosts tidy"
documentation = "https://docker-tidy.geekdocs.de/"
homepage = "https://docker-tidy.geekdocs.de/"
include = [
"LICENSE",
]
keywords = ["docker", "gc", "prune", "garbage"]
license = "Apache-2.0"
name = "docker-tidy"
packages = [
{include = "dockertidy"},
]
readme = "README.md"
repository = "https://github.com/thegeeklab/docker-tidy/"
version = "0.0.0"
[tool.poetry.dependencies]
anyconfig = "*"
appdirs = "*"
certifi = "*"
chardet = "*"
colorama = "*"
dateparser = "*"
docker = "*"
docker-pycreds = "*"
environs = "*"
idna = "*"
importlib-metadata = {version = "*", markers = "python_version<'3.8'"}
ipaddress = "*"
jsonschema = "*"
nested-lookup = "*"
pathspec = "*"
python = "^3.5.0"
python-dateutil = "*"
python-json-logger = "*"
requests = "*"
"ruamel.yaml" = "*"
websocket-client = "*"
zipp = "<2.0.0"
[tool.poetry.dev-dependencies]
autopep8 = "*"
bandit = "*"
flake8 = "*"
flake8-blind-except = "*"
flake8-builtins = "*"
flake8-colors = "*"
flake8-docstrings = "<=3.0.0"
flake8-eradicate = {version = "*", markers = "python_version>='3.6'"}
flake8-isort = "*"
flake8-logging-format = "*"
flake8-pep3101 = "*"
flake8-polyfill = "*"
flake8-quotes = "*"
pathlib2 = "*"
pep8-naming = "*"
pipenv-setup = "*"
pydocstyle = "<4.0.0"
pytest = "*"
pytest-cov = "*"
pytest-mock = "*"
yapf = "*"
[tool.poetry.scripts]
docker-tidy = "dockertidy.Cli:main"
[tool.poetry-dynamic-versioning]
enable = true
style = "semver"
vcs = "git"
[tool.isort]
default_section = "THIRDPARTY"
force_single_line = true
known_first_party = "dockertidy"
line_length = 99
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
skip_glob = ["**/.env*", "**/env/*", "**/docs/*"]
[tool.pytest]
filterwarnings = [
"ignore::FutureWarning",
"ignore:.*collections.*:DeprecationWarning",
"ignore:.*pep8.*:FutureWarning",
]
[tool.coverage.run]
omit = "**/test/*"
[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]

View File

@ -1,30 +0,0 @@
[metadata]
description-file = README.md
license_file = LICENSE
[bdist_wheel]
universal = 1
[isort]
default_section = THIRDPARTY
known_first_party = dockertidy
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
force_single_line = true
line_length = 99
skip_glob = **/.env*,**/env/*,**/docs/*
[yapf]
based_on_style = google
column_limit = 99
dedent_closing_brackets = true
coalesce_brackets = true
split_before_logical_operator = true
[tool:pytest]
filterwarnings =
ignore::FutureWarning
ignore:.*collections.*:DeprecationWarning
ignore:.*pep8.*:FutureWarning
[coverage:run]
omit = **/test/*

103
setup.py
View File

@ -1,103 +0,0 @@
#!/usr/bin/env python
"""Setup script for the package."""
import io
import os
import re
from setuptools import find_packages
from setuptools import setup
PACKAGE_NAME = "dockertidy"
def get_property(prop, project):
current_dir = os.path.dirname(os.path.realpath(__file__))
result = re.search(
r'{}\s*=\s*[\'"]([^\'"]*)[\'"]'.format(prop),
open(os.path.join(current_dir, project, "__init__.py")).read(),
)
return result.group(1)
def get_readme(filename="README.md"):
this = os.path.abspath(os.path.dirname(__file__))
with io.open(os.path.join(this, filename), encoding="utf-8") as f:
long_description = f.read()
return long_description
setup(
name=get_property("__project__", PACKAGE_NAME),
use_scm_version={
"version_scheme": "python-simplified-semver",
"local_scheme": "no-local-version",
"fallback_version": "unknown",
},
description="Keep docker hosts tidy",
keywords="docker gc prune garbage",
author=get_property("__author__", PACKAGE_NAME),
author_email=get_property("__email__", PACKAGE_NAME),
url=get_property("__url__", PACKAGE_NAME),
license=get_property("__license__", PACKAGE_NAME),
long_description=get_readme(),
long_description_content_type="text/markdown",
packages=find_packages(exclude=["*.test", "test", "test.*"]),
include_package_data=True,
zip_safe=False,
python_requires=">=3.5,<4",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: System Administrators",
"Natural Language :: English",
"Operating System :: POSIX",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: System :: Systems Administration",
"Topic :: Utilities",
"Topic :: Software Development",
],
install_requires=[
"anyconfig==0.9.11",
"appdirs==1.4.4",
"attrs==19.3.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
"certifi==2020.4.5.1",
"chardet==3.0.4",
"colorama==0.4.3",
"dateparser==0.7.4",
"docker==4.2.1",
"docker-pycreds==0.4.0",
"environs==8.0.0",
"idna==2.9",
"importlib-metadata==1.6.0; python_version < '3.8'",
"ipaddress==1.0.23",
"jsonschema==3.2.0",
"marshmallow==3.6.1; python_version >= '3.5'",
"nested-lookup==0.2.21",
"pathspec==0.8.0",
"pyrsistent==0.16.0",
"python-dateutil==2.8.1",
"python-dotenv==0.13.0",
"python-json-logger==0.1.11",
"pytz==2020.1",
"regex==2020.5.14",
"requests==2.23.0",
"ruamel.yaml==0.16.10",
"ruamel.yaml.clib==0.2.0; python_version < '3.9' and platform_python_implementation == 'CPython'",
"six==1.15.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
"tzlocal==2.1",
"urllib3==1.25.9; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'",
"websocket-client==0.57.0",
"zipp==1.2.0",
],
dependency_links=[],
setup_requires=["setuptools_scm"],
entry_points={"console_scripts": ["docker-tidy = dockertidy.__main__:main"]},
)