Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Windows Install to PyInstaller #199

Merged
merged 29 commits into from
Oct 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a3eb7cd
Remove Briefcase options
danyeaw Aug 4, 2019
3f6bb06
Patch importlib_metadata to fix PackageNotFoundError
danyeaw Aug 4, 2019
53e3b63
Create initial PyInstaller configurations
danyeaw Aug 4, 2019
072a7ec
Add patch for PyInstaller issue 4263
danyeaw Aug 11, 2019
2642c88
Try to import using importlib_metadata
danyeaw Aug 11, 2019
137f057
Add new pyinstaller script
danyeaw Aug 24, 2019
69f4305
Update data files and hidden imports
danyeaw Aug 24, 2019
a91b748
Apply both patches
danyeaw Aug 24, 2019
27cb7a4
Cleanup pyinstaller config
danyeaw Aug 25, 2019
afc98fe
Fix license location and compress with upx
danyeaw Aug 27, 2019
40872a3
Create new build script and fix file locations
danyeaw Aug 27, 2019
b7b736b
Turn off UPX optimization
danyeaw Aug 30, 2019
fb60fd5
Update README and remove unneeded files
danyeaw Aug 30, 2019
1cbea8b
PyInstaller issue 4263 has been fixed upstream
danyeaw Aug 30, 2019
a54d4c8
Six no longer needed as hidden import
danyeaw Aug 30, 2019
e638d12
Remove _struct as a hidden import
danyeaw Aug 30, 2019
3ac58d1
importlib_metadata pyinstaller hook added upstream
danyeaw Aug 30, 2019
a3f68a8
Make gaphor source path relative
danyeaw Sep 4, 2019
cf82207
Fix formatting
danyeaw Sep 14, 2019
9fa1048
Cleanup comments and formatting
danyeaw Sep 14, 2019
15a5673
Add Windows exe version info
danyeaw Sep 29, 2019
86e6332
Merge branch 'master' into pyinstaller
danyeaw Oct 17, 2019
7d1a903
Fix mypy import errors due to removed services
danyeaw Oct 18, 2019
157bde2
Merge branch 'master' into pyinstaller
danyeaw Oct 19, 2019
185d1a2
Fix executable name and package name conflict in Linux
danyeaw Oct 19, 2019
59bcb30
Fix missing pyinstaller imports
danyeaw Oct 19, 2019
3cc090f
Remove changes to msvc9compiler
danyeaw Oct 22, 2019
04923f6
Enable archive, disable debug, and enable UPX compression
danyeaw Oct 22, 2019
0da03bf
Update executable filename
danyeaw Oct 22, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 1 addition & 23 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,7 @@ def run(self):
"Topic :: Software Development :: Documentation",
],
keywords="model modeling modelling uml diagram python tool",
packages=find_packages(
exclude=[
"utils*",
"docs",
"tests",
"windows",
"macOS",
"linux",
"iOS",
"android",
"django",
]
),
packages=find_packages(exclude=["utils*", "docs", "tests"]),
include_package_data=True,
install_requires=[
"pycairo >= 1.17.0",
Expand Down Expand Up @@ -137,16 +125,6 @@ def run(self):
},
tests_require=["pytest"],
options={
"app": {"formal_name": "Gaphor", "bundle": "org.gaphor"},
# Desktop/laptop deployments
"macos": {"app_requires": [], "icon": "package/gaphor"},
"linux": {"app_requires": []},
"windows": {"app_requires": []},
# Mobile deployments
"ios": {"app_requires": []},
"android": {"app_requires": []},
# Web deployments
"django": {"app_requires": []},
# Translations
"build_pot": {"all_linguas": ",".join(LINGUAS)},
"build_mo": {"all_linguas": ",".join(LINGUAS)},
Expand Down
35 changes: 7 additions & 28 deletions win-installer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,7 @@
We use msys2 for creating the Windows installer and development on Windows
because that is what PyGObject currently supports.

## Development
For developing on Windows you have two choices.

#### 1. Use an Existing Gaphor Installation Plus a Git Checkout:
- Clone the git repo with some git client
- Download and install the latest [installer
build](https://github.com/gaphor/gaphor/releases/download/latest/gaphor-latest-installer.exe)
- Go to setup.py in the git checkout and run C:\Program
Files\Gaphor\bin\python.exe setup.py run.

#### 2. Use a Full MSYS2 Environment
### Use a Full MSYS2 Environment
- Download msys2 64-bit from https://msys2.org
- Follow instructions on https://msys2.org
- Execute C:\msys64\mingw64.exe
Expand All @@ -22,24 +12,13 @@ Files\Gaphor\bin\python.exe setup.py run.
- Run cd gaphor/win_installer to end up where this README exists.
- Execute `./bootstrap.sh` to install all the needed dependencies.
- Now go to the source code `cd ../`
- To run Gaphor execute `python3 setup.py run`
- Execute `python -m venv .venv` to create a virtualenv
- Activate the virtualenv with `source .venv/bin/activate`
- Install poetry with `pip install poetry`
- Install the dependencies with `poetry install`
- Run gaphor by typing `gaphor

## Creating an Installer
Simply run `./build.sh` and both the installer and the portable
Simply run `./build-installer.sh` and both the installer and the portable
installer should appear in this directory.

You can also run the build using a specific git version:
1. Pass a git tag with: `./build.sh release-1.0.0`
1. Pass a git commit hash with: `./build.sh a5d3e53406fadd1fe089aa995b650949256d4981`
1. Pass nothing to build master

Note: `build.sh` clones from the local repository and not from GitHub so any
commits present locally will be cloned as well.

## Updating an Existing Installer
We directly follow msys2 upstream so building the installer two weeks later
might result in newer versions of dependencies being used. To reduce the risk of
stable release breakage you can use an existing installer and just install a
newer Gaphor version into it and then repack it:

`./rebuild.sh gaphor-1.0.0-installer.exe [git tag / commit]`