Skip to content

Commit d65d58e

Browse files
committed
ci: Add GitHub Actions workflow for build and release
1 parent 50235d1 commit d65d58e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

build_analytics.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
def run_command(command, shell=True, cwd=None):
2525
print(f"--- Running command: {' '.join(command) if isinstance(command, list) else command}")
26-
# Эта логика немного странная, но мы будем с ней работать, вызывая команду правильно
2726
use_shell = isinstance(command, str) if sys.platform != "win32" else shell
2827
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=use_shell, cwd=cwd, text=True, encoding='utf-8')
2928
for line in process.stdout:
@@ -56,14 +55,14 @@ def create_and_build(name, req_file):
5655
print(f"Installing dependencies for {name} from {req_file}...")
5756

5857
# VVVVVV --- ИСПРАВЛЕНИЕ ЗДЕСЬ --- VVVVVV
59-
# Формируем команду как единую строку, чтобы функция run_command
60-
# гарантированно использовала `shell=True`, что более надежно в CI/CD.
61-
cmd_as_string = f"\"{str(python_executable)}\" -m pip install -r \"{str(req_file)}\""
58+
# Убираем кавычки вокруг путей. В Linux-окружении без пробелов они не нужны и могут мешать.
59+
cmd_as_string = f"{str(python_executable)} -m pip install -r {str(req_file)}"
6260
run_command(cmd_as_string)
6361
# ^^^^^^ --- КОНЕЦ ИСПРАВЛЕНИЯ --- ^^^^^^
6462

6563
print(f"Running PyInstaller for {name}...")
6664

65+
# PyInstaller лучше вызывать списком, это более надежно
6766
pyinstaller_command = [
6867
str(python_executable), "-m", "PyInstaller",
6968
"--noconfirm", "--onefile",
@@ -99,7 +98,7 @@ def create_and_build(name, req_file):
9998
sys.exit(1)
10099

101100
VENV_DIR.mkdir(exist_ok=True)
102-
DIST_PATH.mkdir(parents=True, exist_ok=True) # <-- предыдущее исправление оставлено
101+
DIST_PATH.mkdir(parents=True, exist_ok=True)
103102

104103
for name, req_filename in BUILDS.items():
105104
create_and_build(name, REQUIREMENTS_DIR / req_filename)

0 commit comments

Comments
 (0)