Skip to content

Commit

Permalink
ci: Update configs for src/ layout
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Sep 11, 2022
1 parent f9e7914 commit 67bc6b1
Show file tree
Hide file tree
Showing 3 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 @@ -11,13 +11,14 @@
# Get the project root dir, which is the parent dir of this
cwd = Path(__file__).parent
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: t.Dict[str, str] = {}
with open(project_root / "g" / "__about__.py") as fp:
with open(src_root / "g" / "__about__.py") as fp:
exec(fp.read(), about)

extensions = [
Expand Down Expand Up @@ -210,16 +211,18 @@ def linkcode_resolve(
fn = relpath(fn, start=dirname(g.__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 @@ -21,7 +21,7 @@ classifiers = [
"Topic :: System :: Shells",
]
packages = [
{ include = "g" },
{ 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,g/__*__.py,
exclude = .*/,.tox,*.egg,src/g/__*__.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 @@ -20,6 +20,6 @@ line_length = 88
addopts = --tb=short --no-header --showlocals --doctest-modules
doctest_optionflags = ELLIPSIS NORMALIZE_WHITESPACE
testpaths =
g
src/g
tests
docs

0 comments on commit 67bc6b1

Please sign in to comment.