Skip to content

Commit b39b14e

Browse files
committed
refactor: Updates for src/ layout
1 parent 316de89 commit b39b14e

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

docs/conf.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010
# Get the project root dir, which is the parent dir of this
1111
cwd = Path(__file__).parent
1212
project_root = cwd.parent
13+
src_root = project_root / "src"
1314

14-
sys.path.insert(0, str(project_root))
15+
sys.path.insert(0, str(src_root))
1516
sys.path.insert(0, str(cwd / "_ext"))
1617

1718
# package data
1819
about: t.Dict[str, str] = {}
19-
with open(project_root / "tmuxp" / "__about__.py") as fp:
20+
with open(src_root / "tmuxp" / "__about__.py") as fp:
2021
exec(fp.read(), about)
2122

2223
extensions = [
@@ -215,16 +216,18 @@ def linkcode_resolve(domain, info): # NOQA: C901
215216
fn = relpath(fn, start=dirname(tmuxp.__file__))
216217

217218
if "dev" in about["__version__"]:
218-
return "{}/blob/master/{}/{}{}".format(
219+
return "{}/blob/master/{}/{}/{}{}".format(
219220
about["__github__"],
221+
"src",
220222
about["__package_name__"],
221223
fn,
222224
linespec,
223225
)
224226
else:
225-
return "{}/blob/v{}/{}/{}{}".format(
227+
return "{}/blob/v{}/{}/{}/{}{}".format(
226228
about["__github__"],
227229
about["__version__"],
230+
"src",
228231
about["__package_name__"],
229232
fn,
230233
linespec,

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ keywords = ["tmux", "session manager", "terminal", "ncurses"]
2424
homepage = "http://github.com/tmux-python/tmuxp/"
2525
readme = "README.md"
2626
packages = [
27-
{ include = "tmuxp" },
27+
{ include = "*", from = "src" },
2828
]
2929
include = [
3030
{ path = "CHANGES", format = "sdist" },

setup.cfg

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flake8]
2-
exclude = .*/,*.egg,tmuxp/_compat.py,tmuxp/__*__.py,
2+
exclude = .*/,*.egg,src/tmuxp/_compat.py,src/tmuxp/__*__.py,
33
select = E,W,F,N
44
max-line-length = 88
55
# Stuff we ignore thanks to black: https://github.com/ambv/black/issues/429
@@ -22,6 +22,6 @@ filterwarnings =
2222
addopts = --reruns=0 --tb=short --no-header --showlocals --doctest-modules
2323
doctest_optionflags = ELLIPSIS NORMALIZE_WHITESPACE
2424
testpaths =
25-
tmuxp
25+
src/tmuxp
2626
tests
2727
docs

0 commit comments

Comments
 (0)