-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
43 lines (36 loc) · 1.12 KB
/
setup.py
File metadata and controls
43 lines (36 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import os
import subprocess
import sys
from setuptools import setup
from setuptools.command.install import install
class CustomInstall(install):
def run(self):
# Run the normal install process
install.run(self)
# Step 1: Install dependencies from requirements.txt
req_file = "requirements.txt"
if os.path.exists(req_file):
print(f"\nInstalling dependencies from {req_file}...\n")
subprocess.check_call(
[sys.executable, "-m", "pip", "install", "-r", req_file]
)
else:
print(f"\n{req_file} not found — skipping dependency installation.\n")
# Step 2: Install the Playwright Firefox browser
print("\nInstalling Playwright Firefox browser...\n")
subprocess.check_call(
[sys.executable, "-m", "playwright", "install", "firefox"]
)
setup(
name="my_app",
version="0.1.0",
packages=[
"voikko",
"services",
"word_tracking",
], # Excplicitly list packages, required
install_requires=[],
cmdclass={
"install": CustomInstall,
},
)