From 87dce9b579878acca4eb7be771899eefe0b77fae Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Mon, 6 Apr 2020 22:14:31 +0200 Subject: [PATCH] rename test folder and cleanup packaging --- .drone.jsonnet | 4 ++-- .drone.yml | 6 +++--- CHANGELOG.md | 5 ++--- dockertidy/{tests => test}/__init__.py | 0 .../{tests => test}/fixtures/__init__.py | 0 .../{tests => test}/fixtures/fixtures.py | 0 .../{tests => test}/unit/test_autostop.py | 2 +- .../unit/test_garbagecollector.py | 2 +- setup.cfg | 5 ++++- setup.py | 21 ++++++++++--------- 10 files changed, 24 insertions(+), 21 deletions(-) rename dockertidy/{tests => test}/__init__.py (100%) rename dockertidy/{tests => test}/fixtures/__init__.py (100%) rename dockertidy/{tests => test}/fixtures/fixtures.py (100%) rename dockertidy/{tests => test}/unit/test_autostop.py (96%) rename dockertidy/{tests => test}/unit/test_garbagecollector.py (99%) diff --git a/.drone.jsonnet b/.drone.jsonnet index 623d720..18b1713 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -89,7 +89,7 @@ local PipelineTest = { commands: [ 'pip install pipenv -qq', 'pipenv --bare install --dev --keep-outdated', - 'pipenv run pytest dockertidy/tests/ --cov=dockertidy/ --no-cov-on-fail', + 'pipenv run pytest dockertidy --cov=dockertidy --no-cov-on-fail', ], }, { @@ -151,7 +151,7 @@ local PipelineSecurity = { commands: [ 'pip install pipenv -qq', 'pipenv --bare install --dev --keep-outdated', - 'pipenv run bandit -r ./dockertidy -x ./dockertidy/tests', + 'pipenv run bandit -r ./dockertidy -x ./dockertidy/test', ], }, ], diff --git a/.drone.yml b/.drone.yml index 7c77539..2fc6934 100644 --- a/.drone.yml +++ b/.drone.yml @@ -65,7 +65,7 @@ steps: commands: - pip install pipenv -qq - pipenv --bare install --dev --keep-outdated - - pipenv run pytest dockertidy/tests/ --cov=dockertidy/ --no-cov-on-fail + - pipenv run pytest dockertidy --cov=dockertidy --no-cov-on-fail environment: PY_COLORS: 1 @@ -168,7 +168,7 @@ steps: commands: - pip install pipenv -qq - pipenv --bare install --dev --keep-outdated - - pipenv run bandit -r ./dockertidy -x ./dockertidy/tests + - pipenv run bandit -r ./dockertidy -x ./dockertidy/test environment: PY_COLORS: 1 @@ -540,6 +540,6 @@ depends_on: --- kind: signature -hmac: db08f11618d3ac957b55287ac41ae743df3d3b9a87a68cda3b25c1add3f0c346 +hmac: d375570b943723373904590f1138d9c8e1fc05970040ff2fd71596fa5c03d207 ... diff --git a/CHANGELOG.md b/CHANGELOG.md index 231e05d..8881135 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,2 @@ -* BUGFIX - * fix timedelta validation for env vars - * fix formatting of `exclude_container_labels` +* ENHANCEMENT + * cleanup pypi packaging diff --git a/dockertidy/tests/__init__.py b/dockertidy/test/__init__.py similarity index 100% rename from dockertidy/tests/__init__.py rename to dockertidy/test/__init__.py diff --git a/dockertidy/tests/fixtures/__init__.py b/dockertidy/test/fixtures/__init__.py similarity index 100% rename from dockertidy/tests/fixtures/__init__.py rename to dockertidy/test/fixtures/__init__.py diff --git a/dockertidy/tests/fixtures/fixtures.py b/dockertidy/test/fixtures/fixtures.py similarity index 100% rename from dockertidy/tests/fixtures/fixtures.py rename to dockertidy/test/fixtures/fixtures.py diff --git a/dockertidy/tests/unit/test_autostop.py b/dockertidy/test/unit/test_autostop.py similarity index 96% rename from dockertidy/tests/unit/test_autostop.py rename to dockertidy/test/unit/test_autostop.py index 8b76fdf..2998af3 100644 --- a/dockertidy/tests/unit/test_autostop.py +++ b/dockertidy/test/unit/test_autostop.py @@ -6,7 +6,7 @@ import pytest from dockertidy import Autostop pytest_plugins = [ - "dockertidy.tests.fixtures.fixtures", + "dockertidy.test.fixtures.fixtures", ] diff --git a/dockertidy/tests/unit/test_garbagecollector.py b/dockertidy/test/unit/test_garbagecollector.py similarity index 99% rename from dockertidy/tests/unit/test_garbagecollector.py rename to dockertidy/test/unit/test_garbagecollector.py index adb2388..dbdef07 100644 --- a/dockertidy/tests/unit/test_garbagecollector.py +++ b/dockertidy/test/unit/test_garbagecollector.py @@ -7,7 +7,7 @@ import requests from dockertidy import GarbageCollector pytest_plugins = [ - "dockertidy.tests.fixtures.fixtures", + "dockertidy.test.fixtures.fixtures", ] diff --git a/setup.cfg b/setup.cfg index c43b1d4..ca1ab87 100644 --- a/setup.cfg +++ b/setup.cfg @@ -11,7 +11,7 @@ known_first_party = dockertidy sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER force_single_line = true line_length = 99 -skip_glob = **/env/*,**/docs/* +skip_glob = **/.env*,**/env/*,**/docs/* [yapf] based_on_style = google @@ -25,3 +25,6 @@ filterwarnings = ignore::FutureWarning ignore:.*collections.*:DeprecationWarning ignore:.*pep8.*:FutureWarning + +[coverage:run] +omit = **/test/* diff --git a/setup.py b/setup.py index 32ce7e8..1d4eb49 100644 --- a/setup.py +++ b/setup.py @@ -38,29 +38,31 @@ setup( keywords="docker gc prune garbage", author=get_property("__author__", PACKAGE_NAME), author_email=get_property("__email__", PACKAGE_NAME), - url="https://github.com/xoxys/docker-tidy", - license=get_property("__url__", 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=["*.tests", "tests", "tests.*"]), + packages=find_packages(exclude=["*.test", "test", "test.*"]), include_package_data=True, zip_safe=False, - python_requires=">=3.5", + 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", - "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", "Natural Language :: English", "Operating System :: POSIX", - "Programming Language :: Python :: 3 :: Only", - "Topic :: System :: Installation/Setup", + "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", - "Topic :: Software Development :: Documentation", ], install_requires=[ "anyconfig==0.9.10", @@ -88,7 +90,7 @@ setup( "regex==2020.2.20", "requests==2.23.0", "ruamel.yaml==0.16.10", - "ruamel.yaml.clib==0.2.0; platform_python_implementation == 'CPython' and python_version < '3.9'", + "ruamel.yaml.clib==0.2.0; platform_python_implementation == 'CPython' and python_version < '3.9'", # noqa "six==1.14.0", "tzlocal==2.0.0", "urllib3==1.25.8", @@ -98,5 +100,4 @@ setup( dependency_links=[], setup_requires=["setuptools_scm"], entry_points={"console_scripts": ["docker-tidy = dockertidy.__main__:main"]}, - test_suite="tests", )