diff --git a/pyproject.toml b/pyproject.toml index 441ffa4e..bd989f6b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ authors = [{ name = "Mycli Core Team", email = "mycli-dev@googlegroups.com" }] urls = { homepage = "http://mycli.net" } dependencies = [ - "click >= 7.0,<8.1.8", + "click >= 7.0", "cryptography >= 1.0.0", "Pygments>=1.6", "prompt_toolkit>=3.0.6,<4.0.0", diff --git a/test/features/environment.py b/test/features/environment.py index 515a2a28..25572502 100644 --- a/test/features/environment.py +++ b/test/features/environment.py @@ -27,6 +27,27 @@ def get_db_name_from_context(context): return context.config.userdata.get("my_test_db", None) or "mycli_behave_tests" +WRAPPAGER_TEMPLATE = """\ +#!{sys_executable} +import os +import sys + + +def wrappager(boundary): + print(boundary) + while 1: + buf = sys.stdin.read(2048) + if not buf: + break + sys.stdout.write(buf) + print(boundary) + + +if __name__ == "__main__": + wrappager({pager_boundary}) +""" + + def before_all(context): """Set env parameters.""" os.environ["LINES"] = "100" @@ -64,13 +85,18 @@ def before_all(context): "pager_boundary": "---boundary---", } + wrappager_fd, wrappager = mkstemp() + with open(wrappager, "w") as f: + f.write(WRAPPAGER_TEMPLATE.format( + sys_executable=sys.executable, + pager_boundary=repr(context.conf["pager_boundary"]), + )) + os.close(wrappager_fd) + os.chmod(wrappager, 0o755) + _, my_cnf = mkstemp() with open(my_cnf, "w") as f: - f.write( - "[client]\npager={0} {1} {2}\n".format( - sys.executable, os.path.join(context.package_root, "test/features/wrappager.py"), context.conf["pager_boundary"] - ) - ) + f.write("[client]\npager={0}\n".format(wrappager)) context.conf["defaults-file"] = my_cnf context.conf["myclirc"] = os.path.join(context.package_root, "test", "myclirc") diff --git a/test/features/wrappager.py b/test/features/wrappager.py deleted file mode 100755 index b61a7d00..00000000 --- a/test/features/wrappager.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env python - -import sys - - -def wrappager(boundary: str) -> None: - print(boundary) - while 1: - buf = sys.stdin.read(2048) - if not buf: - break - sys.stdout.write(buf) - print(boundary) - - -if __name__ == "__main__": - wrappager(sys.argv[1])