From 664c0eea08cb518ea03a32c5e6b343407aca4933 Mon Sep 17 00:00:00 2001 From: Daniel Hoherd Date: Mon, 15 Jun 2020 11:00:37 -0700 Subject: [PATCH] Rework tox config. Make a single test pass. Bump and fix some deps. --- plexdl/cli.py | 4 ++-- pyproject.toml | 31 ++++++++++++++++++++++++++----- requirements-dev.txt | 5 ----- requirements.txt | 2 -- setup.cfg | 2 -- tests/__init__.py | 1 + tests/example_test.py | 6 ++++-- tox.ini | 11 ----------- 8 files changed, 33 insertions(+), 29 deletions(-) delete mode 100644 requirements-dev.txt delete mode 100644 requirements.txt delete mode 100644 setup.cfg delete mode 100644 tox.ini diff --git a/plexdl/cli.py b/plexdl/cli.py index 9930796..694719b 100755 --- a/plexdl/cli.py +++ b/plexdl/cli.py @@ -13,7 +13,7 @@ __version__ = version(__package__) -import plexdl +from plexdl.plexdl import Client def get_logger(ctx, param, value): @@ -39,7 +39,7 @@ def get_logger(ctx, param, value): def main(username, password, title, relay, server_info, item_prefix, summary, ratings, metadata, v): """Search your plex account for media matching the given string, then prints out download commands.""" try: - p = plexdl.Client( + p = Client( username=username, password=password, title=title, diff --git a/pyproject.toml b/pyproject.toml index 03847e0..7d0d551 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,23 +18,44 @@ plexdl = 'plexdl.cli:main' [tool.poetry.dependencies] python = "^3.7" -click = "^7.0" -PlexAPI = "^3.2" -humanfriendly = "^7.0" +click = "^7.1.2" +PlexAPI = "^4.0.0" +humanfriendly = "^8.2" importlib_metadata = "^1.6.1" +requests = "^2.23.0" [tool.poetry.dev-dependencies] black = "^19.10b0" -bpython = "^0.18" flake8 = "^3.7" +tox = "^3.15.2" +pytest = "^5.4.3" [tool.black] -# https://github.com/psf/black#configuration-format line-length = 132 [tool.dephell.main] from = {format = "poetry", path = "pyproject.toml"} to = {format = "setuppy", path = "setup.py"} + +[tool.tox] +legacy_tox_ini = """ +[tox] +envlist = py37,38 +skipsdist = True + +[testenv] +whitelist_externals = poetry +#skip_install = true +deps = pre-commit +commands = + pre-commit install -f --install-hooks + pre-commit run --all-files + poetry install -vvv + poetry run pytest tests/ + +[pep8] +ignore = E265 +""" [build-system] requires = ["poetry>=1.0.2"] build-backend = "poetry.masonry.api" diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 18fe928..0000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,5 +0,0 @@ --e . --r requirements.txt -pre-commit>=0.18.0 -ptpython>=2.0.4 -pytest>=5.0.1 diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index fa392b9..0000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -Click>=7.0 -PlexAPI>=3.1.0 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index e57d130..0000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[wheel] -universal = True diff --git a/tests/__init__.py b/tests/__init__.py index e69de29..809cdd3 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -0,0 +1 @@ +"""plexdl test module.""" diff --git a/tests/example_test.py b/tests/example_test.py index 3c25b78..75f55b4 100644 --- a/tests/example_test.py +++ b/tests/example_test.py @@ -1,5 +1,7 @@ -from plexdl import Client +"""plexdl boilerplate tests.""" +from plexdl.plexdl import Client def test_hello(): - assert Client.hello() == "world" + """Hello world test.""" + assert Client.available_servers == [] diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 404131f..0000000 --- a/tox.ini +++ /dev/null @@ -1,11 +0,0 @@ -[tox] -envlist = py36,37 - -[testenv] -deps = -rrequirements-dev.txt -commands = - pre-commit install -f --install-hooks - pre-commit run --all-files - -[pep8] -ignore = E265