Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to src/ layout #304

Merged
merged 2 commits into from
Sep 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 / "unihan_db" / "__about__.py") as fp:
with open(src_root / "unihan_db" / "__about__.py") as fp:
exec(fp.read(), about)


Expand Down Expand Up @@ -208,16 +209,18 @@ def linkcode_resolve(domain, info): # NOQA: C901
fn = relpath(fn, start=dirname(unihan_db.__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 @@ -33,7 +33,7 @@ keywords = [

readme = "README.md"
packages = [
{ include = "unihan_db" },
{ include = "*", from = "src" },
]
include = [
{ path = "tests", format = "sdist" },
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ line_length = 88
addopts = --reruns=0 --tb=short --no-header --showlocals --doctest-modules
doctest_optionflags = ELLIPSIS NORMALIZE_WHITESPACE
testpaths =
unihan_db
src/unihan_db
tests
docs
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.