Skip to content

Commit

Permalink
Move to src/ layout (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
tony authored Sep 11, 2022
2 parents 3528710 + ab1bb7d commit 62c82df
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
# Get the project root dir, which is the parent dir of this
cwd = Path.cwd()
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 = {}
with open("../vcspull/__about__.py") as fp:
with open(src_root / "vcspull" / "__about__.py") as fp:
exec(fp.read(), about)

extensions = [
Expand Down Expand Up @@ -221,16 +222,18 @@ def linkcode_resolve(domain, info): # NOQA: C901
fn = relpath(fn, start=dirname(vcspull.__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,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ classifiers = [
"Topic :: System :: Shells",
]
packages = [
{ include = "vcspull" },
{ include = "*", from = "src" },
]
include = [
{ path = "tests", format = "sdist" },
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
exclude = .*/,.tox,*.egg,vcspull/__*__.py,
exclude = .*/,.tox,*.egg,src/vcspull/__*__.py,
select = E,W,F,N
max-line-length = 88
# Stuff we ignore thanks to black: https://github.com/ambv/black/issues/429
Expand All @@ -19,6 +19,6 @@ line_length = 88
[tool:pytest]
addopts = --tb=short --no-header --showlocals
testpaths =
vcspull
src/vcspull
tests
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.

0 comments on commit 62c82df

Please sign in to comment.