Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
Bump version to v0.6.3 (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeon0 authored Jan 14, 2022
1 parent d10f509 commit 170d24f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 28 deletions.
37 changes: 11 additions & 26 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from src.version import __version__
import argparse
import getpass
import uuid
import random

from cryptography.fernet import Fernet
import string


parser = argparse.ArgumentParser(description="Build Botty")
Expand All @@ -26,9 +26,9 @@
action='store_true',
help="Will generate a random name for the botty exe")
parser.add_argument(
"-n", "--use_nuitka",
"-k", "--use_key",
action='store_true',
help="Will use nuitka to build instead of pyinstaller")
help="Will build with encryption key")
args = parser.parse_args()


Expand All @@ -43,17 +43,6 @@ def clean_up():
os.remove("health_manager.spec")
if os.path.exists("shopper.spec"):
os.remove("shopper.spec")
# nuitka
if os.path.exists("main.dist"):
shutil.rmtree("main.dist")
if os.path.exists("main.build"):
shutil.rmtree("main.build")
if os.path.exists("main.onefile"):
shutil.rmtree("main.onefile")
if os.path.exists("main.onefile-build"):
shutil.rmtree("main.onefile-build")
if os.path.exists("main.exe"):
os.remove("main.exe")

if __name__ == "__main__":
new_version_code = None
Expand Down Expand Up @@ -82,15 +71,13 @@ def clean_up():
shutil.rmtree(path)
shutil.rmtree(botty_dir)

if args.use_nuitka:
print("USE N")
installer_cmd = f"python -m nuitka --mingw64 --python-flag=-OO --remove-output --follow-imports --standalone --onefile --assume-yes-for-downloads --plugin-enable=numpy src/main.py"
for exe in ["main.py", "shopper.py"]:
key_cmd = " "
if args.use_key:
key = Fernet.generate_key().decode("utf-8")
key_cmd = " --key " + key
installer_cmd = f"pyinstaller --onefile --distpath {botty_dir}{key_cmd} --exclude-module graphviz --paths .\\src --paths {args.conda_path}\\envs\\botty\\lib\\site-packages src\\{exe}"
os.system(installer_cmd)
os.system(f"mkdir {botty_dir}")
else:
for exe in ["main.py", "shopper.py"]:
installer_cmd = f"pyinstaller --onefile --distpath {botty_dir} --exclude-module graphviz --paths .\\src --paths {args.conda_path}\\envs\\botty\\lib\\site-packages src\\{exe}"
os.system(installer_cmd)

os.system(f"cd {botty_dir} && mkdir config && cd ..")

Expand All @@ -102,13 +89,11 @@ def clean_up():
shutil.copy("config/shop.ini", f"{botty_dir}/config/")
shutil.copy("README.md", f"{botty_dir}/")
shutil.copytree("assets", f"{botty_dir}/assets")
if os.path.exists("main.exe"):
shutil.copy("main.exe", f"{botty_dir}/")
clean_up()

if args.random_name:
print("Generate random names")
new_name = uuid.uuid4().hex[:random.randint(6, 32)]
new_name = ''.join(random.choices(string.ascii_letters, k=random.randint(6, 14)))
os.rename(f'{botty_dir}/main.exe', f'{botty_dir}/{new_name}.exe')

if new_version_code is not None:
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ dependencies:
- pywin32
- pip
- pip:
- nuitka
- pyinstaller
- opencv-python
- transitions
Expand All @@ -21,5 +20,6 @@ dependencies:
- pytest-pythonpath
- graphviz
- psutil
- cryptography
- pillow
- discord.py
2 changes: 1 addition & 1 deletion src/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.6.2-dev'
__version__ = '0.6.3'

0 comments on commit 170d24f

Please sign in to comment.