diff --git a/docs/conf.py b/docs/conf.py index a3e583a02e0..98388a24b0c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -10,13 +10,14 @@ # Get the project root dir, which is the parent dir of this cwd = Path(__file__).parent project_root = cwd.parent +src_root = project_root / "src" -sys.path.insert(0, str(project_root)) +sys.path.insert(0, str(src_root)) sys.path.insert(0, str(cwd / "_ext")) # package data about: t.Dict[str, str] = {} -with open(project_root / "tmuxp" / "__about__.py") as fp: +with open(src_root / "tmuxp" / "__about__.py") as fp: exec(fp.read(), about) extensions = [ @@ -215,16 +216,18 @@ def linkcode_resolve(domain, info): # NOQA: C901 fn = relpath(fn, start=dirname(tmuxp.__file__)) if "dev" in about["__version__"]: - return "{}/blob/master/{}/{}{}".format( + return "{}/blob/master/{}/{}/{}{}".format( about["__github__"], + "src", about["__package_name__"], fn, linespec, ) else: - return "{}/blob/v{}/{}/{}{}".format( + return "{}/blob/v{}/{}/{}/{}{}".format( about["__github__"], about["__version__"], + "src", about["__package_name__"], fn, linespec, diff --git a/pyproject.toml b/pyproject.toml index 2b08763ed40..b21254b8164 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ keywords = ["tmux", "session manager", "terminal", "ncurses"] homepage = "http://github.com/tmux-python/tmuxp/" readme = "README.md" packages = [ - { include = "tmuxp" }, + { include = "*", from = "src" }, ] include = [ { path = "CHANGES", format = "sdist" }, diff --git a/setup.cfg b/setup.cfg index d9dbfd07435..4aea98a4add 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [flake8] -exclude = .*/,*.egg,tmuxp/_compat.py,tmuxp/__*__.py, +exclude = .*/,*.egg,src/tmuxp/_compat.py,src/tmuxp/__*__.py, select = E,W,F,N max-line-length = 88 # Stuff we ignore thanks to black: https://github.com/ambv/black/issues/429 @@ -22,6 +22,6 @@ filterwarnings = addopts = --reruns=0 --tb=short --no-header --showlocals --doctest-modules doctest_optionflags = ELLIPSIS NORMALIZE_WHITESPACE testpaths = - tmuxp + src/tmuxp tests docs diff --git a/tmuxp/__about__.py b/src/tmuxp/__about__.py similarity index 100% rename from tmuxp/__about__.py rename to src/tmuxp/__about__.py diff --git a/tmuxp/__init__.py b/src/tmuxp/__init__.py similarity index 100% rename from tmuxp/__init__.py rename to src/tmuxp/__init__.py diff --git a/tmuxp/_compat.py b/src/tmuxp/_compat.py similarity index 100% rename from tmuxp/_compat.py rename to src/tmuxp/_compat.py diff --git a/tmuxp/cli/__init__.py b/src/tmuxp/cli/__init__.py similarity index 100% rename from tmuxp/cli/__init__.py rename to src/tmuxp/cli/__init__.py diff --git a/tmuxp/cli/constants.py b/src/tmuxp/cli/constants.py similarity index 100% rename from tmuxp/cli/constants.py rename to src/tmuxp/cli/constants.py diff --git a/tmuxp/cli/convert.py b/src/tmuxp/cli/convert.py similarity index 100% rename from tmuxp/cli/convert.py rename to src/tmuxp/cli/convert.py diff --git a/tmuxp/cli/debug_info.py b/src/tmuxp/cli/debug_info.py similarity index 100% rename from tmuxp/cli/debug_info.py rename to src/tmuxp/cli/debug_info.py diff --git a/tmuxp/cli/edit.py b/src/tmuxp/cli/edit.py similarity index 100% rename from tmuxp/cli/edit.py rename to src/tmuxp/cli/edit.py diff --git a/tmuxp/cli/freeze.py b/src/tmuxp/cli/freeze.py similarity index 100% rename from tmuxp/cli/freeze.py rename to src/tmuxp/cli/freeze.py diff --git a/tmuxp/cli/import_config.py b/src/tmuxp/cli/import_config.py similarity index 100% rename from tmuxp/cli/import_config.py rename to src/tmuxp/cli/import_config.py diff --git a/tmuxp/cli/load.py b/src/tmuxp/cli/load.py similarity index 100% rename from tmuxp/cli/load.py rename to src/tmuxp/cli/load.py diff --git a/tmuxp/cli/ls.py b/src/tmuxp/cli/ls.py similarity index 100% rename from tmuxp/cli/ls.py rename to src/tmuxp/cli/ls.py diff --git a/tmuxp/cli/shell.py b/src/tmuxp/cli/shell.py similarity index 100% rename from tmuxp/cli/shell.py rename to src/tmuxp/cli/shell.py diff --git a/tmuxp/cli/utils.py b/src/tmuxp/cli/utils.py similarity index 100% rename from tmuxp/cli/utils.py rename to src/tmuxp/cli/utils.py diff --git a/tmuxp/config.py b/src/tmuxp/config.py similarity index 100% rename from tmuxp/config.py rename to src/tmuxp/config.py diff --git a/tmuxp/conftest.py b/src/tmuxp/conftest.py similarity index 100% rename from tmuxp/conftest.py rename to src/tmuxp/conftest.py diff --git a/tmuxp/exc.py b/src/tmuxp/exc.py similarity index 100% rename from tmuxp/exc.py rename to src/tmuxp/exc.py diff --git a/tmuxp/log.py b/src/tmuxp/log.py similarity index 100% rename from tmuxp/log.py rename to src/tmuxp/log.py diff --git a/tmuxp/plugin.py b/src/tmuxp/plugin.py similarity index 100% rename from tmuxp/plugin.py rename to src/tmuxp/plugin.py diff --git a/tmuxp/shell.py b/src/tmuxp/shell.py similarity index 100% rename from tmuxp/shell.py rename to src/tmuxp/shell.py diff --git a/tmuxp/util.py b/src/tmuxp/util.py similarity index 100% rename from tmuxp/util.py rename to src/tmuxp/util.py diff --git a/tmuxp/workspacebuilder.py b/src/tmuxp/workspacebuilder.py similarity index 100% rename from tmuxp/workspacebuilder.py rename to src/tmuxp/workspacebuilder.py