Skip to content

Commit c83d93e

Browse files
committed
chore: update deploy_docs script
1 parent 47216e9 commit c83d93e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

scripts/deploy_docs.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
1+
import contextlib
2+
import sys
3+
from pathlib import Path
14
from subprocess import run
25

6+
if __name__ == "__main__" and __package__ is None or __package__ == "":
7+
file = Path(__file__).resolve()
8+
parent, top = file.parent, file.parents[1]
9+
10+
if str(top) not in sys.path:
11+
sys.path.append(str(top))
12+
13+
with contextlib.suppress(ValueError):
14+
sys.path.remove(str(parent))
15+
16+
__package__ = "scripts"
17+
18+
319
from scripts.tools import get_current_version_from_git
420

521

0 commit comments

Comments
 (0)