Skip to content

Commit

Permalink
Fix builder and requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
F33RNI committed Apr 7, 2023
1 parent 4a5b8b5 commit a71aa79
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ dist/
settings.json
Pulsely.spec
SonicEval.spec
/venv/
32 changes: 20 additions & 12 deletions Builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@

import SonicEval

# Remove all files before building?
CLEAN = True

# Name of main file and output directory
MAIN_FILE = 'SonicEval'

# Text to add to the spec file
Expand All @@ -45,15 +49,16 @@
if __name__ == '__main__':
pyi_command = []

# Remove dist folder is exists
if 'dist' in os.listdir('./'):
shutil.rmtree('dist', ignore_errors=True)
print('dist folder deleted')
if CLEAN:
# Remove dist folder is exists
if 'dist' in os.listdir('./'):
shutil.rmtree('dist', ignore_errors=True)
print('dist folder deleted')

# Remove build folder is exists
if 'build' in os.listdir('./'):
shutil.rmtree('build', ignore_errors=True)
print('build folder deleted')
# Remove build folder is exists
if 'build' in os.listdir('./'):
shutil.rmtree('build', ignore_errors=True)
print('build folder deleted')

# Add all .py files to pyi_command
for file in os.listdir('./'):
Expand Down Expand Up @@ -102,7 +107,9 @@
spec_file_output.close()

# Create new pyi command
pyi_command = ['pyinstaller', MAIN_FILE + '.spec', '--clean']
pyi_command = ['pyinstaller', MAIN_FILE + '.spec']
if CLEAN:
pyi_command.append('--clean')

# Execute pyi
subprocess.run(pyi_command, text=True)
Expand All @@ -111,9 +118,10 @@
if 'dist' in os.listdir('.') and MAIN_FILE in os.listdir('./dist'):

# Remove build folder is exists
if 'build' in os.listdir('./'):
shutil.rmtree('build', ignore_errors=True)
print('build folder deleted')
if CLEAN:
if 'build' in os.listdir('./'):
shutil.rmtree('build', ignore_errors=True)
print('build folder deleted')

# Wait some time
print('Waiting 1 second...')
Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
psutil>=5.9.1
PyQt5>=5.15.7
numpy>=1.23.2
pyqtgraph>=0.12.4
pyqtgraph==0.12.4
PyAudio>=0.2.12
ftfy>=6.1.1
scipy>=1.9.3
matplotlib>=3.5.3
matplotlib==3.5.3
pyinstaller>=5.9.0

0 comments on commit a71aa79

Please sign in to comment.