Skip to content

Commit 4bdb29d

Browse files
authored
refactor: Move to src/ layout (#814)
2 parents a7ef304 + b39b14e commit 4bdb29d

25 files changed

+10
-7
lines changed

β€Ždocs/conf.py

Lines changed: 7 additions & 4 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
Β (0)