-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_instructions.txt
175 lines (138 loc) · 7.53 KB
/
build_instructions.txt
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# ==================
# === MacOS/Unix ===
# ==================
# --- Download and install pyenv to get a clean install of Python (optional) ----------------------------------
# Step 1: Install with Homebrew
brew install pyenv
# Step 2: Configure PATH with Shims
# Add the following block to this file: ~/.bash_profile (if no file exists at that location then create it)
# Give pyenv control of my Python version (Note: this command is very similar to export PATH="/Users/jaydoherty/.pyenv/shims:$PATH")
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
# Step 3: # Install Python 3.6.8
pyenv install 3.6.8
pyenv global 3.6.8
# Step 4: Check Everything Worked
pyenv versions
pyenv version
which python
# -------------------------------------------------------------------------------------------------------------
# --- Setting up a Python virtual environment (for the first time) --------------------------------------------
cd REPOSITORY_FOLDER (one level above "source/")
python -m venv env
source env/bin/activate
which pip
pip install -r pip_requirements.txt
# -------------------------------------------------------------------------------------------------------------
# --- Building python distributable with Pyinstaller ----------------------------------------------------------
cd REPOSITORY_FOLDER (one level above "source/")
source env/bin/activate
cd source
pyinstaller VersametricsPyinstalled.spec
deactivate
# To stage newly built distributable for Electron
rm -r build/
rm -r ../electron/dist/
mv dist/ ../electron/
cd ../electron
# -------------------------------------------------------------------------------------------------------------
# --- Download and install Node.js and "npm" package manager --------------------------------------------------
Download from the official Node.js website (https://nodejs.org/en/download/)
(Note: npm should be included with this installation by default, make sure to get it! Unless you prefer yarn)
# -------------------------------------------------------------------------------------------------------------
# --- Installing local "node_modules" environment (for the first time) ----------------------------------------
cd REPOSITORY_FOLDER (one level above "source/")
cd electron
npm install
---------------------------------------------------------------------------------------------------------------
# --- Running local Electron App ------------------------------------------------------------------------------
cd REPOSITORY_FOLDER (one level above "source/")
cd electron
npm start
---------------------------------------------------------------------------------------------------------------
# --- Packaging local Electron App (into a clickable ".app" file) ---------------------------------------------
cd REPOSITORY_FOLDER (one level above "source/")
cd electron
npm run package
---------------------------------------------------------------------------------------------------------------
# --- Making & Packaging local Electron App (into a shareable ".zip" file) ------------------------------------
cd REPOSITORY_FOLDER (one level above "source/")
cd electron
npm run make
---------------------------------------------------------------------------------------------------------------
# ===============
# === Windows ===
# ===============
# --- Download and install pyenv to get a clean install of Python (optional) ----------------------------------
# Step 1: Download with Git
# for cmd.exe (my prefered terminal):
git clone https://github.com/pyenv-win/pyenv-win.git "%USERPROFILE%\.pyenv"
# for Windows PowerShell:
git clone https://github.com/pyenv-win/pyenv-win.git "$HOME/.pyenv"
# Step 2: Disable aliases that get in the way
Go to Start Menu > "Manage App Execution Aliases" and disable the "App Installer" aliases for Python
# Step 3: Configure PATH with Shims
# Option 1: Set the following User-level environment variables, using Windows PowerShell
[System.Environment]::SetEnvironmentVariable('PYENV', $HOME + "\.pyenv\pyenv-win\", "User")
[System.Environment]::SetEnvironmentVariable('PYENV_HOME', $HOME + "\.pyenv\pyenv-win\", "User")
[System.Environment]::SetEnvironmentVariable('Path', $HOME + "\.pyenv\pyenv-win\bin;" + $HOME + "\.pyenv\pyenv-win\shims;" + $env:Path,"User")
# Option 2: Set those environmental variables with the Windows GUI (this is more confusing to explain, but is my preference)
Go to Control Panel > "System and Security" > "System" > "Advanced system settings" > "Environment Variables"
Here's an example (specific to Jay's machine):
Click "New..." > "Variable Name" PYENV > "Variable value" C:\Users\Jay\.pyenv\pyenv-win\
Click "New..." > "Variable Name" PYENV_HOME > "Variable value" C:\Users\Jay\.pyenv\pyenv-win\
Click "Path" > Click "Edit" > Click "New" C:\Users\Jay\.pyenv\pyenv-win\bin > Click "New" C:\Users\Jay\.pyenv\pyenv-win\shims
# Step 4: Check Install Worked
pyenv --version
# Step 5: Install Python 3.6.8
pyenv install 3.6.8
pyenv global 3.6.8
# Step 6: Check Everything Worked
pyenv versions
pyenv version
where python
# -------------------------------------------------------------------------------------------------------------
# --- Setting up a Python virtual environment (for the first time) --------------------------------------------
cd REPOSITORY_FOLDER (one level above "source/")
python -m venv env
env\Scripts\activate.bat
where pip
pip install -r pip_requirements.txt
# -------------------------------------------------------------------------------------------------------------
# --- Building python distributable with Pyinstaller ----------------------------------------------------------
cd REPOSITORY_FOLDER (one level above "source/")
env\Scripts\activate.bat
cd source
pyinstaller VersametricsPyinstalled.spec
deactivate
# To stage newly built distributable for Electron
xcopy /E /H /I /Y "dist" "../electron/dist/"
rmdir /S /Q "dist"
rmdir /S /Q "build"
cd "../electron"
# -------------------------------------------------------------------------------------------------------------
# --- Download and install Node.js and "npm" package manager --------------------------------------------------
Download from the official Node.js website (https://nodejs.org/en/download/)
(Note: npm should be included with this installation by default, make sure to get it! Unless you prefer yarn)
# -------------------------------------------------------------------------------------------------------------
# --- Installing local "node_modules" environment (for the first time) ----------------------------------------
cd REPOSITORY_FOLDER (one level above "source/")
cd electron
npm install
---------------------------------------------------------------------------------------------------------------
# --- Running local Electron App ------------------------------------------------------------------------------
cd REPOSITORY_FOLDER (one level above "source/")
cd electron
npm start
---------------------------------------------------------------------------------------------------------------
# --- Packaging Electron App (into a clickable ".exe" file) ---------------------------------------------------
cd REPOSITORY_FOLDER (one level above "source/")
cd electron
npm run package
---------------------------------------------------------------------------------------------------------------
# --- Making & Packaging Electron App (into a shareable "-Setup.exe" file) ------------------------------------
cd REPOSITORY_FOLDER (one level above "source/")
cd electron
npm run make
---------------------------------------------------------------------------------------------------------------