Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Set up basic build script for windows (#7) #28

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

surepy
Copy link

@surepy surepy commented Oct 3, 2020

really basic build script.

you may or may not need to copypaste hook solution from pygame/pygame#1514 (comment) if running into audio file load issues.

this fixes #7

@j-tesla
Copy link
Owner

j-tesla commented Oct 3, 2020

Hey @surepy, how does this script work? Is it supposed to run the game or anything else? On my device, it is just building the dependencies. 😅

@surepy
Copy link
Author

surepy commented Oct 3, 2020

Hey @surepy, how does this script work? Is it supposed to run the game or anything else? On my device, it is just building the dependencies. 😅

after you run the script you should have a main.exe on dist/ folder which is a portable executable for this game that has been built. you can run that (in theory) any computer without installing python.

@j-tesla
Copy link
Owner

j-tesla commented Oct 3, 2020

Hey @surepy, how does this script work? Is it supposed to run the game or anything else? On my device, it is just building the dependencies. 😅

after you run the script you should have a main.exe on dist/ folder which is a portable executable for this game that has been built. you can run that (in theory) any computer without installing python.

@surepy I didn't find any dist folder. Is it just on my machine or anyone else facing the same issue? @95ych Can you please check on your machine?

@j-tesla j-tesla requested review from j-tesla and removed request for j-tesla October 3, 2020 07:15
@surepy
Copy link
Author

surepy commented Oct 3, 2020

Hey @surepy, how does this script work? Is it supposed to run the game or anything else? On my device, it is just building the dependencies. 😅

after you run the script you should have a main.exe on dist/ folder which is a portable executable for this game that has been built. you can run that (in theory) any computer without installing python.

@surepy I didn't find any dist folder. Is it just on my machine or anyone else facing the same issue? @95ych Can you please check on your machine?

can I have the output of Build.bat when you run it?

@j-tesla
Copy link
Owner

j-tesla commented Oct 3, 2020

The system cannot find the file specified.
The system cannot find the file specified.
==== checking dependencies
Requirement already satisfied: PyInstaller in c:\users\jayanth psy\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (4.0)
Requirement already satisfied: pygame in c:\users\jayanth psy\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (1.9.6)
Requirement already satisfied: pywin32 in c:\users\jayanth psy\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (228)
Requirement already satisfied: pipenv in c:\users\jayanth psy\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (2020.8.13)
Requirement already satisfied: pyinstaller-hooks-contrib>=2020.6 in c:\users\jayanth psy\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from PyInstaller) (2020.9)
Requirement already satisfied: pywin32-ctypes>=0.2.0; sys_platform == "win32" in c:\users\jayanth psy\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from PyInstaller) (0.2.0)
Requirement already satisfied: altgraph in c:\users\jayanth psy\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from PyInstaller) (0.17)
Requirement already satisfied: setuptools in c:\program files\windowsapps\pythonsoftwarefoundation.python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\lib\site-packages (from PyInstaller) (49.2.1)
Requirement already satisfied: pefile>=2017.8.1; sys_platform == "win32" in c:\users\jayanth psy\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from PyInstaller) (2019.4.18)
Requirement already satisfied: certifi in c:\users\jayanth psy\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from pipenv) (2020.6.20)
Requirement already satisfied: virtualenv in c:\users\jayanth psy\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from pipenv) (20.0.32)
Requirement already satisfied: pip>=18.0 in c:\program files\windowsapps\pythonsoftwarefoundation.python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\lib\site-packages (from pipenv) (20.2.1)
Requirement already satisfied: virtualenv-clone>=0.2.5 in c:\users\jayanth psy\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from pipenv) (0.5.4)
Requirement already satisfied: future in c:\users\jayanth psy\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from pefile>=2017.8.1; sys_platform == "win32"->PyInstaller) (0.18.2)
Requirement already satisfied: distlib<1,>=0.3.1 in c:\users\jayanth psy\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from virtualenv->pipenv) (0.3.1)
Requirement already satisfied: appdirs<2,>=1.4.3 in c:\users\jayanth psy\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from virtualenv->pipenv) (1.4.4)
Requirement already satisfied: filelock<4,>=3.0.0 in c:\users\jayanth psy\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from virtualenv->pipenv) (3.0.12)
Requirement already satisfied: six<2,>=1.9.0 in c:\users\jayanth psy\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from virtualenv->pipenv) (1.15.0)
WARNING: You are using pip version 20.2.1; however, version 20.2.3 is available.
You should consider upgrading via the 'C:\Users\JAYANTH PSY\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe -m pip install --upgrade pip' command.
'pipenv' is not recognized as an internal or external command,
operable program or batch file.
==== starting build
'pipenv' is not recognized as an internal or external command,
operable program or batch file.

@surepy This is what I got. This is not the first time I'm running it, so the dependencies are already satisfies.

@surepy
Copy link
Author

surepy commented Oct 3, 2020

(snip)

@surepy This is what I got. This is not the first time I'm running it, so the dependencies are already satisfies.

'pipenv' is not recognized as an internal or external command,
operable program or batch file.

right, python/pipenv is not in your PATH variable in this case.

either add python/pipenv to PATH variable or replace the "pipenv" with "python -m pipenv" in the script file.

this is what it's supposed to happen

  ================================ 0/0 - 00:00:00
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
==== starting build
66 INFO: PyInstaller: 4.0
66 INFO: Python: 3.8.6
68 INFO: Platform: Windows-10-10.0.18362-SP0
93 INFO: checking Analysis
94 INFO: Initializing module dependency graph...
102 INFO: Caching module graph hooks...
...
14977 INFO: Appending archive to EXE C:\Users\sleepy\git\space-shooter\dist\main.exe
15006 INFO: Building EXE from EXE-00.toc completed successfully.```

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use pyinstaller to bundle the game into a single executable
3 participants