From eb4ba24921e87edcaf55a60d93708476e25b9f21 Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Mon, 20 Jul 2020 00:40:05 -0400 Subject: [PATCH] setup.py template, metadata --- .mypy.ini | 6 ++++ archive/matlab.py | 4 --- pyproject.toml | 3 ++ pytest.ini | 2 -- setup.cfg | 42 +--------------------------- setup.py | 10 +++++-- src/findssh/tests/test_coro.py | 5 ---- src/findssh/tests/test_threadpool.py | 6 +--- 8 files changed, 18 insertions(+), 60 deletions(-) create mode 100644 .mypy.ini delete mode 100644 pytest.ini diff --git a/.mypy.ini b/.mypy.ini new file mode 100644 index 0000000..b1712f9 --- /dev/null +++ b/.mypy.ini @@ -0,0 +1,6 @@ +[mypy] +ignore_missing_imports = True +strict_optional = False +allow_redefinition = True +show_error_context = False +show_column_numbers = True diff --git a/archive/matlab.py b/archive/matlab.py index fcf4d79..6b863ae 100644 --- a/archive/matlab.py +++ b/archive/matlab.py @@ -19,7 +19,3 @@ def test_matlab(): [matlab, "-batch", "findssh"], universal_newlines=True, timeout=60 ) print(ret) - - -if __name__ == "__main__": - pytest.main(["-s", __file__]) diff --git a/pyproject.toml b/pyproject.toml index 90ccf9c..a3e8a88 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,3 +3,6 @@ requires = ["setuptools", "wheel"] [tool.black] line-length = 100 + +[tool.pytest.ini_options] +addopts = "-ra -v" diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index b175c60..0000000 --- a/pytest.ini +++ /dev/null @@ -1,2 +0,0 @@ -[pytest] -addopts = -ra -v diff --git a/setup.cfg b/setup.cfg index 6e6211d..0510e93 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = findssh -version = 1.5.0 +version = 1.4.1 author = Michael Hirsch, Ph.D. author_email = scivision@users.noreply.github.com url = https://github.com/scivision/findssh @@ -57,43 +57,3 @@ lint = flake8-builtins flake8-blind-except mypy - - -[flake8] -max-line-length = 132 -exclude = .git,__pycache__,.eggs/,doc/,docs/,build/,dist/,archive/ -per-file-ignores = - __init__.py:F401 - -[mypy] -ignore_missing_imports = True -strict_optional = False -allow_redefinition = True -show_error_context = False -show_column_numbers = True - -[tool:pytest] -addopts = -ra -v - -[coverage:run] -cover_pylib = false -omit = - /home/travis/virtualenv/* - */site-packages/* - */bin/* - -[coverage:report] -exclude_lines = - pragma: no cover - def __repr__ - except RuntimeError - except NotImplementedError - except ImportError - except FileNotFoundError - except CalledProcessError - raise AssertionError - raise NotImplementedError - logging.warning - logging.error - logging.critical - if __name__ == .__main__.: diff --git a/setup.py b/setup.py index c823345..b1ef310 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,8 @@ -#!/usr/bin/env python -from setuptools import setup +#!/usr/bin/env python3 +import site +import setuptools -setup() +# PEP517 workaround +site.ENABLE_USER_SITE = True + +setuptools.setup() diff --git a/src/findssh/tests/test_coro.py b/src/findssh/tests/test_coro.py index ca1cec5..c9eea60 100755 --- a/src/findssh/tests/test_coro.py +++ b/src/findssh/tests/test_coro.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -import pytest import ipaddress import findssh @@ -16,7 +15,3 @@ def test_coroutine(): host = hosts[0] assert isinstance(host[0], ipaddress.IPv4Address) assert isinstance(host[1], str) - - -if __name__ == "__main__": - pytest.main([__file__]) diff --git a/src/findssh/tests/test_threadpool.py b/src/findssh/tests/test_threadpool.py index 7be99b3..6ce569f 100644 --- a/src/findssh/tests/test_threadpool.py +++ b/src/findssh/tests/test_threadpool.py @@ -2,7 +2,7 @@ normally we use coroutines, but for demo purposes we have threadpool too. """ import ipaddress -import pytest + import findssh.threadpool PORT = 22 @@ -17,7 +17,3 @@ def test_threadpool(): assert isinstance(host, ipaddress.IPv4Address) assert isinstance(svc, str) break - - -if __name__ == "__main__": - pytest.main([__file__])