diff --git a/libtmux/_compat.py b/libtmux/_compat.py index 19a3d944b..5f3d0ad7f 100644 --- a/libtmux/_compat.py +++ b/libtmux/_compat.py @@ -97,6 +97,7 @@ def reraise(tp, value, tb=None): number_types = integer_types + (float,) + def str_from_console(s): try: return text_type(s) diff --git a/poetry.lock b/poetry.lock index 448478a1e..b9c3000f1 100644 --- a/poetry.lock +++ b/poetry.lock @@ -29,7 +29,7 @@ version = "1.4.4" [[package]] category = "dev" description = "Atomic file writes." -marker = "python_version >= \"3\" and sys_platform == \"win32\" or python_version < \"3\"" +marker = "python_version >= \"3\" and sys_platform == \"win32\" or sys_platform == \"win32\" or python_version < \"3\"" name = "atomicwrites" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" @@ -38,7 +38,6 @@ version = "1.4.0" [[package]] category = "dev" description = "Classes Without Boilerplate" -marker = "python_version >= \"3.6\" and python_version < \"4.0\" or python_version >= \"3\" or python_version < \"3\"" name = "attrs" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" @@ -53,7 +52,6 @@ tests = ["coverage", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.i [[package]] category = "dev" description = "Internationalization utilities" -marker = "python_version < \"3\" or python_version >= \"3\"" name = "babel" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" @@ -82,18 +80,24 @@ marker = "python_version >= \"3.6\" and python_version < \"4.0\"" name = "black" optional = false python-versions = ">=3.6" -version = "19.10b0" +version = "20.8b1" [package.dependencies] appdirs = "*" -attrs = ">=18.1.0" -click = ">=6.5" +click = ">=7.1.2" +mypy-extensions = ">=0.4.3" pathspec = ">=0.6,<1" -regex = "*" -toml = ">=0.9.4" +regex = ">=2020.1.8" +toml = ">=0.10.1" typed-ast = ">=1.4.0" +typing-extensions = ">=3.7.4" + +[package.dependencies.dataclasses] +python = "<3.7" +version = ">=0.6" [package.extras] +colorama = ["colorama (>=0.4.3)"] d = ["aiohttp (>=3.3.2)", "aiohttp-cors"] [[package]] @@ -198,7 +202,7 @@ testing = ["pytest (>=3.5,<3.7.3 || >3.7.3)", "pytest-checkdocs (>=1.2)", "pytes [[package]] category = "dev" description = "Backports and enhancements for the contextlib module" -marker = "python_version < \"3\"" +marker = "python_version < \"3.4\" or python_version >= \"3\" and python_version < \"3.4\"" name = "contextlib2" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" @@ -236,6 +240,15 @@ pep8test = ["black", "flake8", "flake8-import-order", "pep8-naming"] ssh = ["bcrypt (>=3.1.5)"] test = ["pytest (>=3.6.0,<3.9.0 || >3.9.0,<3.9.1 || >3.9.1,<3.9.2 || >3.9.2)", "pretend", "iso8601", "pytz", "hypothesis (>=1.11.4,<3.79.2 || >3.79.2)"] +[[package]] +category = "dev" +description = "A backport of the dataclasses module for Python 3.6" +marker = "python_version >= \"3.6\" and python_version < \"3.7\"" +name = "dataclasses" +optional = false +python-versions = ">=3.6, <3.7" +version = "0.7" + [[package]] category = "dev" description = "Docutils -- Python Documentation Utilities" @@ -333,7 +346,6 @@ version = "2.10" [[package]] category = "dev" description = "Getting image size from png/jpeg/jpeg2000/gif file" -marker = "python_version < \"3\" or python_version >= \"3\"" name = "imagesize" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" @@ -370,7 +382,6 @@ testing = ["packaging", "pep517", "importlib-resources (>=1.3)"] [[package]] category = "dev" description = "iniconfig: brain-dead simple config-ini parsing" -marker = "python_version >= \"3\"" name = "iniconfig" optional = false python-versions = "*" @@ -429,7 +440,6 @@ dev = ["testpath"] [[package]] category = "dev" description = "A very fast and expressive template engine." -marker = "python_version < \"3\" or python_version >= \"3\"" name = "jinja2" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" @@ -515,12 +525,20 @@ six = ">=1.0.0,<2.0.0" [[package]] category = "dev" description = "More routines for operating on iterables, beyond itertools" -marker = "python_version >= \"3\"" name = "more-itertools" optional = false python-versions = ">=3.5" version = "8.4.0" +[[package]] +category = "dev" +description = "Experimental type system extensions for programs checked with the mypy typechecker." +marker = "python_version >= \"3.6\" and python_version < \"4.0\"" +name = "mypy-extensions" +optional = false +python-versions = "*" +version = "0.4.3" + [[package]] category = "dev" description = "Core utilities for Python packages" @@ -552,7 +570,7 @@ version = "*" [[package]] category = "dev" description = "Object-oriented filesystem paths" -marker = "python_version >= \"3\" and python_version < \"3.6\"" +marker = "python_version >= \"3\" and python_version < \"3.6\" or python_version < \"3.6\"" name = "pathlib2" optional = false python-versions = "*" @@ -584,7 +602,6 @@ testing = ["nose", "coverage"] [[package]] category = "dev" description = "plugin and hook calling mechanisms for python" -marker = "python_version < \"3\" or python_version >= \"3\"" name = "pluggy" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" @@ -601,7 +618,6 @@ dev = ["pre-commit", "tox"] [[package]] category = "dev" description = "library with cross-python path, ini-parsing, io, code, log facilities" -marker = "python_version < \"3\" or python_version >= \"3\"" name = "py" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" @@ -651,7 +667,6 @@ version = "2.6.1" [[package]] category = "dev" description = "Python parsing module" -marker = "python_version < \"3\" or python_version >= \"3\"" name = "pyparsing" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" @@ -948,7 +963,6 @@ version = "1.15.0" [[package]] category = "dev" description = "This package provides 26 stemmers for 25 languages generated from Snowball algorithms." -marker = "python_version < \"3\" or python_version >= \"3\"" name = "snowballstemmer" optional = false python-versions = "*" @@ -1036,7 +1050,6 @@ tests = ["pytest", "mock"] [[package]] category = "dev" description = "sphinxcontrib-applehelp is a sphinx extension which outputs Apple help books" -marker = "python_version >= \"3\"" name = "sphinxcontrib-applehelp" optional = false python-versions = ">=3.5" @@ -1049,7 +1062,6 @@ test = ["pytest"] [[package]] category = "dev" description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp document." -marker = "python_version >= \"3\"" name = "sphinxcontrib-devhelp" optional = false python-versions = ">=3.5" @@ -1062,7 +1074,6 @@ test = ["pytest"] [[package]] category = "dev" description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" -marker = "python_version >= \"3\"" name = "sphinxcontrib-htmlhelp" optional = false python-versions = ">=3.5" @@ -1075,7 +1086,6 @@ test = ["pytest", "html5lib"] [[package]] category = "dev" description = "A sphinx extension which renders display math in HTML via JavaScript" -marker = "python_version >= \"3\"" name = "sphinxcontrib-jsmath" optional = false python-versions = ">=3.5" @@ -1087,7 +1097,6 @@ test = ["pytest", "flake8", "mypy"] [[package]] category = "dev" description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp document." -marker = "python_version >= \"3\"" name = "sphinxcontrib-qthelp" optional = false python-versions = ">=3.5" @@ -1100,7 +1109,6 @@ test = ["pytest"] [[package]] category = "dev" description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)." -marker = "python_version >= \"3\"" name = "sphinxcontrib-serializinghtml" optional = false python-versions = ">=3.5" @@ -1125,7 +1133,6 @@ test = ["pytest", "mock"] [[package]] category = "dev" description = "Python Library for Tom's Obvious, Minimal Language" -marker = "python_version >= \"3.6\" and python_version < \"4.0\" or python_version >= \"3\"" name = "toml" optional = false python-versions = "*" @@ -1203,6 +1210,15 @@ optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" version = "3.7.4.3" +[[package]] +category = "dev" +description = "Backported and Experimental Type Hints for Python 3.5+" +marker = "python_version >= \"3.6\" and python_version < \"4.0\"" +name = "typing-extensions" +optional = false +python-versions = "*" +version = "3.7.4.3" + [[package]] category = "dev" description = "HTTP library with thread-safe connection pooling, file post, and more." @@ -1241,7 +1257,7 @@ version = "0.5.1" [[package]] category = "dev" description = "Backport of pathlib-compatible object wrapper for zip files" -marker = "python_version >= \"3\" and python_version < \"3.8\" or python_version < \"3\"" +marker = "python_version < \"3.8\" or python_version >= \"3\" and python_version < \"3.8\" or python_version >= \"3\" and python_version < \"3.8\" and (python_version < \"3.8\" or python_version >= \"3\" and python_version < \"3.8\")" name = "zipp" optional = false python-versions = ">=2.7" @@ -1259,7 +1275,7 @@ testing = ["pathlib2", "unittest2", "jaraco.itertools", "func-timeout"] [[package]] category = "dev" description = "Backport of pathlib-compatible object wrapper for zip files" -marker = "python_version >= \"3\" and python_version < \"3.8\"" +marker = "python_version >= \"3\" and python_version < \"3.8\" or python_version >= \"3\" and python_version < \"3.8\" and (python_version < \"3.8\" or python_version >= \"3\" and python_version < \"3.8\") or python_version < \"3.8\"" name = "zipp" optional = false python-versions = ">=3.6" @@ -1278,7 +1294,7 @@ lint = [] test = [] [metadata] -content-hash = "de6760b7f3f560320576ddbc89cf631b582905d63a8a4225bac47f93e1bd8f1f" +content-hash = "f28da7e555c79c5d3654d3112f1c463bfd65bb72414cbc9de430b5510e87e279" lock-version = "1.0" python-versions = "~2.7 || ^3.5" @@ -1312,8 +1328,7 @@ babel = [ {file = "backports.functools_lru_cache-1.6.1.tar.gz", hash = "sha256:8fde5f188da2d593bd5bc0be98d9abc46c95bb8a9dde93429570192ee6cc2d4a"}, ] black = [ - {file = "black-19.10b0-py36-none-any.whl", hash = "sha256:1b30e59be925fafc1ee4565e5e08abef6b03fe455102883820fe5ee2e4734e0b"}, - {file = "black-19.10b0.tar.gz", hash = "sha256:c2edb73a08e9e0e6f65a0e6af18b059b8b1cdd5bef997d7a0b181df93dc81539"}, + {file = "black-20.8b1.tar.gz", hash = "sha256:1c02557aa099101b9d21496f8a914e9ed2222ef70336404eeeac8edba836fbea"}, ] bleach = [ {file = "bleach-3.1.5-py2.py3-none-any.whl", hash = "sha256:2bce3d8fab545a6528c8fa5d9f9ae8ebc85a56da365c7f85180bfe96a35ef22f"}, @@ -1439,6 +1454,10 @@ cryptography = [ {file = "cryptography-3.0-cp38-cp38-win_amd64.whl", hash = "sha256:bea0b0468f89cdea625bb3f692cd7a4222d80a6bdafd6fb923963f2b9da0e15f"}, {file = "cryptography-3.0.tar.gz", hash = "sha256:8e924dbc025206e97756e8903039662aa58aa9ba357d8e1d8fc29e3092322053"}, ] +dataclasses = [ + {file = "dataclasses-0.7-py3-none-any.whl", hash = "sha256:3459118f7ede7c8bea0fe795bff7c6c2ce287d01dd226202f7c9ebc0610a7836"}, + {file = "dataclasses-0.7.tar.gz", hash = "sha256:494a6dcae3b8bcf80848eea2ef64c0cc5cd307ffc263e17cdf42f3e5420808e6"}, +] docutils = [ {file = "docutils-0.16-py2.py3-none-any.whl", hash = "sha256:0c5b78adfbf7762415433f5515cd5c9e762339e23369dbe8000d84a4bf4ab3af"}, {file = "docutils-0.16.tar.gz", hash = "sha256:c2de3a60e9e7d07be26b7f2b00ca0309c207e06c100f9cc2a94931fc75a478fc"}, @@ -1551,6 +1570,10 @@ more-itertools = [ {file = "more-itertools-8.4.0.tar.gz", hash = "sha256:68c70cc7167bdf5c7c9d8f6954a7837089c6a36bf565383919bb595efb8a17e5"}, {file = "more_itertools-8.4.0-py3-none-any.whl", hash = "sha256:b78134b2063dd214000685165d81c154522c3ee0a1c0d4d113c80361c234c5a2"}, ] +mypy-extensions = [ + {file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"}, + {file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"}, +] packaging = [ {file = "packaging-20.4-py2.py3-none-any.whl", hash = "sha256:998416ba6962ae7fbd6596850b80e17859a5753ba17c32284f67bfff33784181"}, {file = "packaging-20.4.tar.gz", hash = "sha256:4357f74f47b9c12db93624a82154e9b120fa8293699949152b22065d556079f8"}, @@ -1778,6 +1801,11 @@ typing = [ {file = "typing-3.7.4.3-py2-none-any.whl", hash = "sha256:283d868f5071ab9ad873e5e52268d611e851c870a2ba354193026f2dfb29d8b5"}, {file = "typing-3.7.4.3.tar.gz", hash = "sha256:1187fb9c82fd670d10aa07bbb6cfcfe4bdda42d6fab8d5134f04e8c4d0b71cc9"}, ] +typing-extensions = [ + {file = "typing_extensions-3.7.4.3-py2-none-any.whl", hash = "sha256:dafc7639cde7f1b6e1acc0f457842a83e722ccca8eef5270af2d74792619a89f"}, + {file = "typing_extensions-3.7.4.3-py3-none-any.whl", hash = "sha256:7cb407020f00f7bfc3cb3e7881628838e69d8f3fcab2f64742a5e76b2f841918"}, + {file = "typing_extensions-3.7.4.3.tar.gz", hash = "sha256:99d4073b617d30288f569d3f13d2bd7548c3a7e4c8de87db09a9d29bb3a4a60c"}, +] urllib3 = [ {file = "urllib3-1.25.10-py2.py3-none-any.whl", hash = "sha256:e7983572181f5e1522d9c98453462384ee92a0be7fac5f1413a1e35c56cc0461"}, {file = "urllib3-1.25.10.tar.gz", hash = "sha256:91056c15fa70756691db97756772bb1eb9678fa585d9184f24534b100dc60f4a"}, diff --git a/pyproject.toml b/pyproject.toml index 766d34b3f..83f08900d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,7 +68,7 @@ pytest-cov = [ ] ### Format ### -black = {version="==19.10b0", python="^3.6"} +black = {version="==20.08b1", python="^3.6"} isort = [ {version="<5", python="<3.6"}, {version="*", python=">=3.6"} diff --git a/tests/test_server.py b/tests/test_server.py index 45e67bb99..99368fc88 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -15,7 +15,7 @@ def test_has_session(server, session): def test_socket_name(server): - """ ``-L`` socket_name. + """``-L`` socket_name. ``-L`` socket_name file name of socket. which will be stored in env TMUX_TMPDIR or /tmp if unset.)