Skip to content

Commit 996f5c0

Browse files
committed
Formatting and variable name improvements
1 parent 6ce06c7 commit 996f5c0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

datafiles/Data/Python/package.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
import zipfile
66
from pathlib import Path
77

8+
89
PYTHON_VERSION = "3.8.10"
910

11+
1012
DO_NOT_ADD = [
1113
"__pycache__",
1214
"_distutils_hack",
@@ -24,6 +26,7 @@
2426

2527
ENV_PATH = Path(".venv")
2628
LIB_PATH = Path(ENV_PATH, "Lib", "site-packages")
29+
2730
OUT_PATH = Path("Lib", "site-packages")
2831
ZIP_PATH = Path("Lib", "site-packages.zip")
2932
REL_PATH = Path("Data", "Python", OUT_PATH)
@@ -55,7 +58,7 @@ def main():
5558
"subfolder in the Open Note Block Studio root directory."
5659
)
5760

58-
if not os.path.exists(".venv"):
61+
if not os.path.exists(ENV_PATH):
5962
raise FileNotFoundError(
6063
"The .venv directory was not found. Have you ran"
6164
"poetry install before running this script?"
@@ -71,7 +74,7 @@ def main():
7174

7275
# Package dependencies
7376
package_count = 0
74-
with zipfile.PyZipFile(ZIP_PATH, mode="w") as zip_module:
77+
with zipfile.PyZipFile(ZIP_PATH, mode="w") as zip_file:
7578
for path in os.listdir(LIB_PATH):
7679
lib_name = os.path.basename(path)
7780
lib_path = Path(LIB_PATH, lib_name)
@@ -87,8 +90,9 @@ def main():
8790
str(lib_path), ddir=path_prefix, force=True, quiet=2, legacy=True
8891
)
8992

93+
# Write to ZIP
9094
try:
91-
zip_module.writepy(lib_path, filterfunc=pack_filter)
95+
zip_file.writepy(lib_path, filterfunc=pack_filter)
9296
except RuntimeError: # only directories or .py files accepted
9397
continue
9498
else:

0 commit comments

Comments
 (0)