We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bcac7a5 commit 0d3dd8fCopy full SHA for 0d3dd8f
1 file changed
scripts/publish.py
@@ -1,9 +1,23 @@
1
+import contextlib
2
import os
3
import subprocess
4
import sys
5
from pathlib import Path
6
from typing import Any
7
8
+if __name__ == "__main__" and __package__ is None or __package__ == "":
9
+ file = Path(__file__).resolve()
10
+ parent, top = file.parent, file.parents[1]
11
+
12
+ if str(top) not in sys.path:
13
+ sys.path.append(str(top))
14
15
+ with contextlib.suppress(ValueError):
16
+ sys.path.remove(str(parent))
17
18
+ __package__ = "scripts"
19
20
21
from scripts.tools import get_version
22
23
0 commit comments