Skip to content

Commit 62c82df

Browse files
authored
Move to src/ layout (#382)
2 parents 3528710 + ab1bb7d commit 62c82df

File tree

11 files changed

+10
-7
lines changed

11 files changed

+10
-7
lines changed

docs/conf.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
# Get the project root dir, which is the parent dir of this
77
cwd = Path.cwd()
88
project_root = cwd.parent
9+
src_root = project_root / "src"
910

10-
sys.path.insert(0, str(project_root))
11+
sys.path.insert(0, str(src_root))
1112
sys.path.insert(0, str(cwd / "_ext"))
1213

1314
# package data
1415
about = {}
15-
with open("../vcspull/__about__.py") as fp:
16+
with open(src_root / "vcspull" / "__about__.py") as fp:
1617
exec(fp.read(), about)
1718

1819
extensions = [
@@ -221,16 +222,18 @@ def linkcode_resolve(domain, info): # NOQA: C901
221222
fn = relpath(fn, start=dirname(vcspull.__file__))
222223

223224
if "dev" in about["__version__"]:
224-
return "{}/blob/master/{}/{}{}".format(
225+
return "{}/blob/master/{}/{}/{}{}".format(
225226
about["__github__"],
227+
"src",
226228
about["__package_name__"],
227229
fn,
228230
linespec,
229231
)
230232
else:
231-
return "{}/blob/v{}/{}/{}{}".format(
233+
return "{}/blob/v{}/{}/{}/{}{}".format(
232234
about["__github__"],
233235
about["__version__"],
236+
"src",
234237
about["__package_name__"],
235238
fn,
236239
linespec,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ classifiers = [
1919
"Topic :: System :: Shells",
2020
]
2121
packages = [
22-
{ include = "vcspull" },
22+
{ include = "*", from = "src" },
2323
]
2424
include = [
2525
{ path = "tests", 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 = .*/,.tox,*.egg,vcspull/__*__.py,
2+
exclude = .*/,.tox,*.egg,src/vcspull/__*__.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
@@ -19,6 +19,6 @@ line_length = 88
1919
[tool:pytest]
2020
addopts = --tb=short --no-header --showlocals
2121
testpaths =
22-
vcspull
22+
src/vcspull
2323
tests
2424
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.

0 commit comments

Comments
 (0)