File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed
Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 66
77- Include included HTML headers in the ToC by default by enabling markdown2's ` mixed=True ` option of the ` header-ids ` extra
88 (#806 , @mrossinek )
9+ - Make ` pdoc . ` work to document the module in the current directory.
10+ ([ #813 ] ( https://github.com/mitmproxy/pdoc/pull/813 ) , @mhils )
911
1012## 2025-04-21: pdoc 15.0.3
1113
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ def parse_spec(spec: Path | str) -> str:
112112 raise ModuleNotFoundError
113113 except pdoc .docstrings .AnyException :
114114 # Module does not exist, use local file.
115- spec = pspec
115+ spec = pspec . resolve ()
116116 else :
117117 # Module does exist. We now check if the local file/directory is the same (e.g. after pip install -e),
118118 # and emit a warning if that's not the case.
Original file line number Diff line number Diff line change @@ -100,6 +100,10 @@ def test_parse_spec(monkeypatch):
100100 assert str (here / "testdata" ) in sys .path
101101 sys .path = p
102102
103+ monkeypatch .chdir (here / "testdata" / "demopackage" / "subpackage" )
104+ assert parse_spec ("." ) == "demopackage.subpackage"
105+ assert parse_spec (".." ) == "demopackage"
106+
103107
104108def test_parse_spec_mod_and_dir (tmp_path , monkeypatch ):
105109 """Test that we display a warning when both a module and a local directory exist with the provided name."""
You can’t perform that action at this time.
0 commit comments