-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simpify cross-platform; update workflows
- Loading branch information
1 parent
6e1e1ef
commit 7c1c3c0
Showing
5 changed files
with
39 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
""" | ||
Calling `pyi-makespec` regenerates the base spec file, but we need to extend the recursion limit. | ||
This script is run automatically as a part of `npm run build:flask:spec` after the `pyi-makespec` call. | ||
""" | ||
|
||
|
||
def test(): | ||
from pathlib import Path | ||
|
||
with open(file=Path(__file__).parent / "nwb-guide.spec", mode="r") as io: | ||
lines = io.readlines() | ||
|
||
lines.insert(1, "import sys\n") | ||
lines.insert(2, "sys.setrecursionlimit(sys.getrecursionlimit() * 5)\n") | ||
lines.insert(3, "\n") | ||
|
||
# Originally this was a separate `npm` command per platform to account for CLI syntax differences between ; and : | ||
# The spec file is, however, the same across platforms | ||
data_line_index = lines.index("datas = []\n") | ||
lines[data_line_index] = "datas = [('./paths.config.json', '.'), ('./package.json', '.')]\n" | ||
|
||
with open(file=Path(__file__).parent / "nwb-guide.spec", mode="w") as io: | ||
io.writelines(lines) | ||
|
||
print("Sucessfully injected recursion depth extension and json paths!") | ||
|
||
|
||
if __name__ == "__main__": | ||
test() |