8000 Move to `src/` layout (#407) · vcs-python/libvcs@4cc9ab2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4cc9ab2

Browse files
authored
Move to src/ layout (#407)
Fixes #406 See also: pypa/packaging.python.org#320
2 parents dc635fe + d0de168 commit 4cc9ab2

30 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
doc_path = Path(__file__).parent
1212
project_root = doc_path.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(doc_path / "_ext"))
1617

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

2223
extensions = [
@@ -223,16 +224,18 @@ def linkcode_resolve(
223224
fn = relpath(fn, start=dirname(libvcs.__file__))
224225

225226
if "dev" in about["__version__"]:
226-
return "{}/blob/master/{}/{}{}".format(
227+
return "{}/blob/master/{}/{}/{}{}".format(
227228
about["__github__"],
229+
"src",
228230
about["__package_name__"],
229231
fn,
230232
linespec,
231233
)
232234
else:
233-
return "{}/blob/v{}/{}/{}{}".format(
235+
return "{}/blob/v{}/{}/{}/{}{}".format(
234236
about["__github__"],
235237
about["__version__"],
238+
"src",
236239
about["__package_name__"],
237240
fn,
238241
linespec,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ classifiers = [
4545
homepage = "http://github.com/vcs-python/libvcs/"
4646
readme = "README.md"
4747
packages = [
48-
{ include = "libvcs" },
48+
{ include = "*", from = "src" },
4949
]
5050
include = [
5151
{ 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,libvcs/__*__.py,
2+
exclude = .*/,.tox,*.egg,src/libvcs/__*__.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
@@ -20,6 +20,6 @@ line_length = 88
2020
addopts = --tb=short --no-header --showlocals --doctest-modules
2121
doctest_optionflags = ELLIPSIS NORMALIZE_WHITESPACE
2222
testpaths =
23-
libvcs
23+
src/libvcs
2424
tests
2525
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)
0