You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following up on issues #105 (comment), #106 and #90, I'd like to start collecting information on how to (best) do packaging for all platforms PythonTurtle runs on. When we know how to perform packaging manually it will be an easy task to automate it all.
In other words, we need
a list of target package types (e.g. MSI for Windows, macOS AppImage, Debian DEB, RPM, Snap), and
a complete list of concrete, detailed steps (read: shell commands) of how each package type is built, from source code living in source control only.
NOTE: If writing this up in this issue proves uncomfortable we may want to use the project Wiki to help us move along.
According to a recent talk at PyCon Otto we should switch to PyInstaller, which allows building stand-alone executables for Windows, macOS and GNU/Linux alike.
We should also not forget about building the PythonTurtle Python package and push it to PyPI when releasing.
I'd also suggest to trigger releases by pushing a Git tag (with the version number) to the GitHub repository. The installers may then be downloadable via the release page. I hope that's all possible in a seamless way.
I have neither a Windows and Mac. Hence, I need to do the cumbersome finding-out how building is done on AppVeyor. Also, we need a macOS with Python 3 installed (and cross your fingers that the documentation is only outdated and we can also build with Python 3).
I'll probably best start with automating building a Python package (and upload it to PyPI automatically). IIUC, a setup.py is needed for building with (some features of) PyInstaller, anyway.
We'll have one possible way of installing PythonTurtle already this way.
Do you want to add me as a maintainer to the PyPI project? Would make it easier for me to automate things when I can use my own credentials. My username is "bittner", unsurprisingly.
We could add install_requires=['wxPython'] to setup(), but this would fail unless the prerequisites (mentioned in the README) were already installed. We may be able to catch the - very technical error - and print a helpful hint in case the installation fails.
As an alternative, we may trust users to perform the installation steps in the README and let PythonTurtle print a friendly reminder when the wx module can't be imported (ModuleNotFoundError in the application module).
Doing either in a user-friendly "auto-detect prerequisites" way using platform.release() and/or os.name would be possible but also quite cumbersome. I suggest, we simply print a text message and refer to the installation section of the README with a URL.
I wonder whether a VM with ReactOS would work for generating a Windows installer.
I'm not sure how we would use a VM on a service in the cloud that would build the PythonTurtle package in an automated fashion. Can you elaborate? (Do you intend for local use on a developer machine only?)
Could ReactOS work for generating a Windows installer using PyInstaller?
Could we set it up to work automatically, on the cloud?
Let's say that the answer to the first question is yes, and there isn't a SaaS provider that gives that service. Then say we can set up a Docker image that runs VirtualBox with a ReactOS guest. Maybe we can find a SaaS provider that'll run that Docker image for us?
The next great thing after getting EXE for Windows and bundles for macOS working could be building an AppImage for Linux. This is something similar to a .dmg file on a Mac. It would be a single solution for all GNU/Linux distros! 🎉 😃
AppImage also has (somewhat) an AppStore, dubbed AppImageHub. And the comparison makes you understand that it's really a cool thing. 👍
Having another thought at this. You say "I have neither a Windows computer nor I plan to buy one". If your objection to do the items you listed is because you've done enough on this ticket, or that you prefer not to spend your time doing Windows-related things, then yes, that's a fair objection.
If the issue is that you don't want to spend money on a Windows license, then maybe that's solvable. One idea would be to use ReactOS, and seeing whether that runs Visual Studio Project. If ReactOS isn't an option, then maybe I could get a Windows license/machine to you. Let me know if that's helpful.
Do you know a person that is enthusiastic about programming on Windows? Windows is a messy environment for Python. I don't want to contribute to a false image of "Python + Windows" fit well together, that's all.
See #108 (comment) for alternative solutions to build an MSI installer (WiX, WiX.Py). We may be successful that way in combination with GitHub Actions. Does someone want to give that a shot?
With python3 setup.py clean bundle you can build all binary bundles (PyInstaller is used).
The binaries build successful for all platforms (including .exe for Windows), for what I recall.
Windows users seem to expect a Windows installer; this could be a MSI or WiX.Py installer (both aren't yet prepared).
GitHub Actions should automatically push binaries to our GitHub Releases whenever we push a Git tag to master; we may want to use something like actions/create-release to make this less laborious for us.
We received a super-nice answer by @judej on the Microsoft Developer Community request for help that I had posted! 😂
Bottom line: No MSI volunteer for us, but there are two more interesting projects, one that builds an installer and the other that builds a Python ZIP App:
pynsist – a tool to build Windows installers for your Python applications. [...] bundle Python itself, so you can distribute your application to people who don’t have Python installed
shiv – for building fully self-contained Python zipapps as outlined in PEP 441, but with all their dependencies included!
That could be two nice alternatives worth evaluating. Thanks Jude! 💯 🎖️
PyOxidizer sounds like an experiment to me: A Python application running on "a Rust VM", an OS-native layer created using Rust. I'm not sure what benefit this provides. Doesn't the PyInstaller setup we run do it all fine? 🥉
shiv is a totally new approach (new in our "portfolio" of release artifacts), which might be interesting to provide to our audience. I find the idea thrilling (even though I'd be ready to bet few people might use it). 🥈
pynsist sounds like the Microsoft Windows installer we're looking for. This might provide the user experience Windows folks seem to expect: 1️⃣ Download installer, 2️⃣ run it to install and add a start menu entry, 3️⃣ start application from start menu. 🥇
Activity
bittner commentedon Sep 23, 2018
We currently seem to use py2exe and py2app for Windows and macOS.
According to a recent talk at PyCon Otto we should switch to PyInstaller, which allows building stand-alone executables for Windows, macOS and GNU/Linux alike.
cool-RR commentedon Sep 24, 2018
I agree we should definitely use PyInstaller instead of py2exe and py2app.
And I agree that we need a reliable and automatic build process.
bittner commentedon Sep 25, 2018
We should also not forget about building the PythonTurtle Python package and push it to PyPI when releasing.
I'd also suggest to trigger releases by pushing a Git tag (with the version number) to the GitHub repository. The installers may then be downloadable via the release page. I hope that's all possible in a seamless way.
cool-RR commentedon Sep 25, 2018
I agree, though that kind of automation is a bit of a high goal, if we even get to the point where we could do a release, I'd be ecstatic.
bittner commentedon Sep 25, 2018
Then prepare your space suit! 😄
bittner commentedon Sep 27, 2018
As suspected, PyInstaller will require to run on the infrastructure it should build the installer for (e.g. on Windows for a Windows installer, on a Mac for a macOS installer).
I have neither a Windows and Mac. Hence, I need to do the cumbersome finding-out how building is done on AppVeyor. Also, we need a macOS with Python 3 installed (and cross your fingers that the documentation is only outdated and we can also build with Python 3).
I'll probably best start with automating building a Python package (and upload it to PyPI automatically).
IIUC, asetup.pyis needed for building with (some features of) PyInstaller, anyway.We'll have one possible way of installing PythonTurtle already this way.
bittner commentedon Sep 28, 2018
Do you want to add me as a maintainer to the PyPI project? Would make it easier for me to automate things when I can use my own credentials. My username is "bittner", unsurprisingly.
cool-RR commentedon Sep 29, 2018
I added you as a maintainer on PyPI.
Regarding PyInstaller, I wonder whether a VM with ReactOS would work for generating a Windows installer.
bittner commentedon Sep 29, 2018
To make
pip install PythonTurtleinstall the program and all needed dependencies proves to be difficult:Conclusions:
install_requires=['wxPython']tosetup(), but this would fail unless the prerequisites (mentioned in the README) were already installed. We may be able to catch the - very technical error - and print a helpful hint in case the installation fails.wxmodule can't be imported (ModuleNotFoundErrorin the application module).Doing either in a user-friendly "auto-detect prerequisites" way using
platform.release()and/oros.namewould be possible but also quite cumbersome. I suggest, we simply print a text message and refer to the installation section of the README with a URL.bittner commentedon Sep 29, 2018
I'm not sure how we would use a VM on a service in the cloud that would build the PythonTurtle package in an automated fashion. Can you elaborate? (Do you intend for local use on a developer machine only?)
cool-RR commentedon Sep 30, 2018
You're right, I didn't think this through.
I guess there are 2 questions:
Could ReactOS work for generating a Windows installer using PyInstaller?
Could we set it up to work automatically, on the cloud?
Let's say that the answer to the first question is yes, and there isn't a SaaS provider that gives that service. Then say we can set up a Docker image that runs VirtualBox with a ReactOS guest. Maybe we can find a SaaS provider that'll run that Docker image for us?
bittner commentedon Oct 2, 2018
pypa/packaging.python.org#267 contains quite a few interesting links to packaging Python applications.
bittner commentedon Oct 3, 2018
As soon as uploading the Linux bundle to GitHub is settled (via PR #123) we'll jump on the CI train for macOS, yeah! 😋
bittner commentedon Oct 4, 2018
The next great thing after getting EXE for Windows and bundles for macOS working could be building an AppImage for Linux. This is something similar to a .dmg file on a Mac. It would be a single solution for all GNU/Linux distros! 🎉 😃
AppImage also has (somewhat) an AppStore, dubbed AppImageHub. And the comparison makes you understand that it's really a cool thing. 👍
cool-RR commentedon Oct 4, 2018
Sounds good to me!
5 remaining items
cool-RR commentedon Mar 5, 2020
Having another thought at this. You say "I have neither a Windows computer nor I plan to buy one". If your objection to do the items you listed is because you've done enough on this ticket, or that you prefer not to spend your time doing Windows-related things, then yes, that's a fair objection.
If the issue is that you don't want to spend money on a Windows license, then maybe that's solvable. One idea would be to use ReactOS, and seeing whether that runs Visual Studio Project. If ReactOS isn't an option, then maybe I could get a Windows license/machine to you. Let me know if that's helpful.
bittner commentedon Mar 5, 2020
Do you know a person that is enthusiastic about programming on Windows? Windows is a messy environment for Python. I don't want to contribute to a false image of "Python + Windows" fit well together, that's all.
bittner commentedon Aug 30, 2020
See #108 (comment) for alternative solutions to build an MSI installer (WiX, WiX.Py). We may be successful that way in combination with GitHub Actions. Does someone want to give that a shot?
cool-RR commentedon Aug 30, 2020
I don't, so I guess we'll wait until a possible volunteer arrives.
cclauss commentedon Sep 21, 2020
A task list...
bittner commentedon Sep 21, 2020
A few hints to help you make progress:
python3 setup.py clean bundleyou can build all binary bundles (PyInstaller is used).master; we may want to use something like actions/create-release to make this less laborious for us.WIP: Create GitHub Action Build_apps.yml
WIP: Create GitHub Action Build_apps.yml
Install wxPython and make the ELF executable
bittner commentedon Oct 14, 2020
We received a super-nice answer by @judej on the Microsoft Developer Community request for help that I had posted! 😂
Bottom line: No MSI volunteer for us, but there are two more interesting projects, one that builds an installer and the other that builds a Python ZIP App:
That could be two nice alternatives worth evaluating. Thanks Jude! 💯 🎖️
cool-RR commentedon Oct 15, 2020
Cool. I also recently heard about PyOxidizer. I'm still not 100% sure I understood the project (discussion) but it's possible it does what we want.
cclauss commentedon Oct 15, 2020
I will take a shot at doing this with
shivover the weekend. Please tryPyOxidizerand then we can compare notes.cool-RR commentedon Oct 15, 2020
Sorry, I started a new job a few days ago and I won't have time to do anything :(
bittner commentedon Oct 15, 2020
PyOxidizersounds like an experiment to me: A Python application running on "a Rust VM", an OS-native layer created using Rust. I'm not sure what benefit this provides. Doesn't thePyInstallersetup we run do it all fine? 🥉shivis a totally new approach (new in our "portfolio" of release artifacts), which might be interesting to provide to our audience. I find the idea thrilling (even though I'd be ready to bet few people might use it). 🥈pynsistsounds like the Microsoft Windows installer we're looking for. This might provide the user experience Windows folks seem to expect: 1️⃣ Download installer, 2️⃣ run it to install and add a start menu entry, 3️⃣ start application from start menu. 🥇cclauss commentedon Oct 15, 2020
Downside of pynsist is Windows only. I will try to advance Shiv (from LinkedIn) on Mac and Linux.