From 97f470887ac42458a59f3322a903cff93ee9edde Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 10 Sep 2022 11:02:40 -0500 Subject: [PATCH 1/6] refactor!: Move libtmux to src/ --- {libtmux => src/libtmux}/__about__.py | 0 {libtmux => src/libtmux}/__init__.py | 0 {libtmux => src/libtmux}/_compat.py | 0 {libtmux => src/libtmux}/common.py | 0 {libtmux => src/libtmux}/conftest.py | 0 {libtmux => src/libtmux}/exc.py | 0 {libtmux => src/libtmux}/formats.py | 0 {libtmux => src/libtmux}/pane.py | 0 {libtmux => src/libtmux}/py.typed | 0 {libtmux => src/libtmux}/pytest_plugin.py | 0 {libtmux => src/libtmux}/server.py | 0 {libtmux => src/libtmux}/session.py | 0 {libtmux => src/libtmux}/test.py | 0 {libtmux => src/libtmux}/window.py | 0 14 files changed, 0 insertions(+), 0 deletions(-) rename {libtmux => src/libtmux}/__about__.py (100%) rename {libtmux => src/libtmux}/__init__.py (100%) rename {libtmux => src/libtmux}/_compat.py (100%) rename {libtmux => src/libtmux}/common.py (100%) rename {libtmux => src/libtmux}/conftest.py (100%) rename {libtmux => src/libtmux}/exc.py (100%) rename {libtmux => src/libtmux}/formats.py (100%) rename {libtmux => src/libtmux}/pane.py (100%) rename {libtmux => src/libtmux}/py.typed (100%) rename {libtmux => src/libtmux}/pytest_plugin.py (100%) rename {libtmux => src/libtmux}/server.py (100%) rename {libtmux => src/libtmux}/session.py (100%) rename {libtmux => src/libtmux}/test.py (100%) rename {libtmux => src/libtmux}/window.py (100%) diff --git a/libtmux/__about__.py b/src/libtmux/__about__.py similarity index 100% rename from libtmux/__about__.py rename to src/libtmux/__about__.py diff --git a/libtmux/__init__.py b/src/libtmux/__init__.py similarity index 100% rename from libtmux/__init__.py rename to src/libtmux/__init__.py diff --git a/libtmux/_compat.py b/src/libtmux/_compat.py similarity index 100% rename from libtmux/_compat.py rename to src/libtmux/_compat.py diff --git a/libtmux/common.py b/src/libtmux/common.py similarity index 100% rename from libtmux/common.py rename to src/libtmux/common.py diff --git a/libtmux/conftest.py b/src/libtmux/conftest.py similarity index 100% rename from libtmux/conftest.py rename to src/libtmux/conftest.py diff --git a/libtmux/exc.py b/src/libtmux/exc.py similarity index 100% rename from libtmux/exc.py rename to src/libtmux/exc.py diff --git a/libtmux/formats.py b/src/libtmux/formats.py similarity index 100% rename from libtmux/formats.py rename to src/libtmux/formats.py diff --git a/libtmux/pane.py b/src/libtmux/pane.py similarity index 100% rename from libtmux/pane.py rename to src/libtmux/pane.py diff --git a/libtmux/py.typed b/src/libtmux/py.typed similarity index 100% rename from libtmux/py.typed rename to src/libtmux/py.typed diff --git a/libtmux/pytest_plugin.py b/src/libtmux/pytest_plugin.py similarity index 100% rename from libtmux/pytest_plugin.py rename to src/libtmux/pytest_plugin.py diff --git a/libtmux/server.py b/src/libtmux/server.py similarity index 100% rename from libtmux/server.py rename to src/libtmux/server.py diff --git a/libtmux/session.py b/src/libtmux/session.py similarity index 100% rename from libtmux/session.py rename to src/libtmux/session.py diff --git a/libtmux/test.py b/src/libtmux/test.py similarity index 100% rename from libtmux/test.py rename to src/libtmux/test.py diff --git a/libtmux/window.py b/src/libtmux/window.py similarity index 100% rename from libtmux/window.py rename to src/libtmux/window.py From 1957f34c98310b0a89deb8276bddc03663f4c2c3 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 10 Sep 2022 11:03:17 -0500 Subject: [PATCH 2/6] build(pyproject): Move libtmux to src/ --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b3331f6bc..0952659c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ keywords = ["tmux", "session manager", "terminal", "ncurses"] homepage = "http://github.com/tmux-python/libtmux/" readme = "README.md" packages = [ - { include = "libtmux" }, + { include = "*", from = "src" }, ] include = [ { path = "CHANGES", format = "sdist" }, From 0e8a506776b515703140bf690d71f1efad2383e3 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 10 Sep 2022 11:05:03 -0500 Subject: [PATCH 3/6] docs(conf): Update for src/ move --- docs/conf.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 3a8abd835..f5d81447b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -11,13 +11,14 @@ # Get the project root dir, which is the parent dir of this cwd = Path(__file__).parent project_root = cwd.parent +project_src = project_root / "src" -sys.path.insert(0, str(project_root)) +sys.path.insert(0, str(project_src)) sys.path.insert(0, str(cwd / "_ext")) # package data about: Dict[str, str] = {} -with open(project_root / "libtmux" / "__about__.py") as fp: +with open(project_src / "libtmux" / "__about__.py") as fp: exec(fp.read(), about) extensions = [ From d8e72521b6d19d95200e66ec06123263775d597b Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 10 Sep 2022 11:10:19 -0500 Subject: [PATCH 4/6] ci(pytest): Update testpaths for src/ --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 7fd0a0140..921540d5a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,6 +22,6 @@ filterwarnings = addopts = --tb=short --no-header --showlocals --doctest-docutils-modules --reruns 2 -p no:doctest doctest_optionflags = ELLIPSIS NORMALIZE_WHITESPACE testpaths = - libtmux + src/libtmux tests docs From 03a7a9e883c0dddb80217a23291141a5b9c37dc4 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 10 Sep 2022 11:10:43 -0500 Subject: [PATCH 5/6] docs(flake8): Use src directory --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 921540d5a..2547e7343 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [flake8] -exclude = .*/,*.egg,libtmux/_compat.py,libtmux/__*__.py +exclude = .*/,*.egg,src/libtmux/_compat.py,src/libtmux/__*__.py select = E,W,F,N max-line-length = 88 # Stuff we ignore thanks to black: https://github.com/ambv/black/issues/429 From 778ceebb33f137373d8096413eefac2eb3df03de Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 10 Sep 2022 11:17:03 -0500 Subject: [PATCH 6/6] docs(CHANGES): Note move to src/ --- CHANGES | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES b/CHANGES index e07a90c6c..892d74050 100644 --- a/CHANGES +++ b/CHANGES @@ -23,6 +23,7 @@ $ pip install --user --upgrade --pre libtmux - Fixes #402: {func}`common.tmux_cmd` will only strip _trailing_ empty lines. Before this change, all empty lines were filtered out. This will lead to a more accurate behavior when using {meth}`Pane.capture_pane`. Credit: @rockandska, via #405. +- Source files for `libtmux` modules moved to `src/`, via #414. ### Development