Skip to content

Commit

Permalink
chore: Built new exes
Browse files Browse the repository at this point in the history
  • Loading branch information
Cobertos committed May 17, 2020
1 parent 4e9c740 commit 784554b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ venv32/
venv64/
.pytest_cache/
.cache/
extractor.spec
extractor.spec
tmp-requirements.txt
21 changes: 12 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,24 @@
Here's how to run all the development stuff.

## Setup Development Environment
* `pyenv global 3.6.8-amd64`
* `pyenv global 3.7.6-amd64`
* `pipenv install --dev`

## Building

Building is a little convoluted because we build a x64 and an x86 binary...
Building is a little convoluted because we build a x64 and an x86 binary, because we don't have it in the Pipfile because it didn't play nicely with CI the last time I tried, and `pipenv` doesn't play nicely with bitness.

* `pyenv global 3.6.8-amd64`
* Originally wasn't able to get this to run on Python 3.7 when it was new, but 3.6 is guarenteed to build the `.exe`
* `pyenv exec python -m venv venv64`
* `venv64\scripts\activate.bat` or `venv64/scripts/activate` for Linux
* `pip install -r requirements-dev.txt` (Installs `pyinstaller` and `pytest`)
If this project accumulates and Pipfile dependencies that `pyinstaller` needs to know about, we either have to stop using `pipenv` or find a new way to manage this...

EDIT: `pipenv` is apparently dead? No new releases? So... don't use it to build with for now...

* `pyenv global 3.7.6-amd64`
* `pipenv run pip freeze > tmp-requirements.txt`
* `pip install -r tmp-requirements.txt`
* `pip install pyinstaller`
* pyinstaller is a slower dependency so might not work with the latest Python
* `python build_exe.py`
* `venv64\scripts\deactivate.bat` (or you'll use the wrong python when you make another `venv`)
* Do the same with `pyenv and 3.6.8` and make a folder called `venv32` instead
* Do the same with `pyenv global 3.7.6` (without `-amd64` suffix) to build the x86 .exe

## Testing
* `pipenv run pytest -v` in the root directory
Expand Down
3 changes: 2 additions & 1 deletion build_exe.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
is64bit = sys.maxsize > 2**32

#Run pyinstaller
#shell=True with pyenv... gets mad otherwise
subprocess.run(["pyinstaller", "unitypackage_extractor/extractor.py",
"--exclude-module", "ssl",
"--exclude-module", "socket"])
"--exclude-module", "socket"], shell=True)

#Zip it all up
shutil.make_archive(f"unitypackage_extractor_{'64' if is64bit else '32'}", "zip", "dist/extractor")
Binary file modified unitypackage_extractor_32.zip
Binary file not shown.
Binary file modified unitypackage_extractor_64.zip
Binary file not shown.

0 comments on commit 784554b

Please sign in to comment.