Skip to content

Updated installer hooks to use finn instead of napari #172

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

Open
wants to merge 138 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
08a0a38
pixi project
Mar 10, 2025
3a31400
trying to generate a self-contained executable that uses the proper p…
Mar 11, 2025
396905b
moved launcher outside scripts, otherwise it's ignored
Mar 11, 2025
57d06f4
trying constructor
Mar 11, 2025
d8a490d
moved launcher to motile_tracker package
Mar 11, 2025
eff93ff
install current package
Mar 11, 2025
59151aa
post install scripts
Mar 12, 2025
15570e8
removed pixi-pack for now; update post install for win
Mar 12, 2025
4354bb7
do not keep packages; activate env in post install script
Mar 12, 2025
5a416e3
use full path
Mar 12, 2025
c0cd2e6
no activate found on win
Mar 12, 2025
e8b1bb9
added conda to specs
Mar 12, 2025
ffe41ef
Readme
Mar 12, 2025
16abce6
enclose package within dquotes
Mar 12, 2025
53d382a
removed specs
Mar 12, 2025
8af1607
allow spaces in path
Mar 12, 2025
4ca1127
use unix instead of non win
Mar 12, 2025
b9788f7
use correct version
Mar 12, 2025
ce8d870
update version
Mar 12, 2025
2aa34a3
write post install marker
cgoina Mar 12, 2025
2ed85b4
setup the version file for scmtools
Mar 12, 2025
5bc205e
something that installs on windows
cgoina Mar 12, 2025
e8ed8dd
create startup script
cgoina Mar 13, 2025
32aa486
set startup script for osx and linux
Mar 13, 2025
52ac203
use conda env file
cgoina Mar 13, 2025
55ffc2b
create pkg in dist sub-folder
cgoina Mar 13, 2025
113209b
pin scip to 9.0
cgoina Mar 13, 2025
8ced7ee
pin ilpy to 0.4.1
Mar 14, 2025
4414420
changes to make it work on windows
cgoina Mar 14, 2025
4f7ee6e
notes about using pixi
Mar 14, 2025
51dd793
pixi project
Mar 10, 2025
1b48fa4
trying to generate a self-contained executable that uses the proper p…
Mar 11, 2025
16b78f2
moved launcher outside scripts, otherwise it's ignored
Mar 11, 2025
3383abc
trying constructor
Mar 11, 2025
04f1f29
moved launcher to motile_tracker package
Mar 11, 2025
ba15173
install current package
Mar 11, 2025
a11b978
post install scripts
Mar 12, 2025
ab66371
removed pixi-pack for now; update post install for win
Mar 12, 2025
a1c827a
do not keep packages; activate env in post install script
Mar 12, 2025
fc0196b
use full path
Mar 12, 2025
15ef729
no activate found on win
Mar 12, 2025
26a9512
added conda to specs
Mar 12, 2025
ced1edb
Readme
Mar 12, 2025
71a054f
enclose package within dquotes
Mar 12, 2025
23c2a8d
removed specs
Mar 12, 2025
4724921
allow spaces in path
Mar 12, 2025
0233ce9
use unix instead of non win
Mar 12, 2025
6bff68b
use correct version
Mar 12, 2025
a3538f9
update version
Mar 12, 2025
87193e2
write post install marker
cgoina Mar 12, 2025
cd18362
setup the version file for scmtools
Mar 12, 2025
c1b9c7d
something that installs on windows
cgoina Mar 12, 2025
141dbc7
create startup script
cgoina Mar 13, 2025
0cb5fda
set startup script for osx and linux
Mar 13, 2025
058b346
use conda env file
cgoina Mar 13, 2025
00242c1
create pkg in dist sub-folder
cgoina Mar 13, 2025
7389cdd
pin scip to 9.0
cgoina Mar 13, 2025
5d8bafd
pin ilpy to 0.4.1
Mar 14, 2025
a1080d5
changes to make it work on windows
cgoina Mar 14, 2025
3829191
added test task
Mar 18, 2025
d7e510c
Merge branch 'installer' of github.com:funkelab/motile_tracker into i…
Mar 18, 2025
a6457ca
napari opens with the plugin
Mar 20, 2025
5aec141
got the fonts to work by adding an entry point
Mar 21, 2025
1d691fb
removed runtime hook
Mar 21, 2025
6dd58c0
no longer open multiple viewers
Mar 21, 2025
d6229bb
remove commented code
Mar 21, 2025
3440027
removed unnecessary settings from project file
Mar 21, 2025
2a67c22
removed manifest and some dependencies from pixi.toml
Mar 21, 2025
6d82509
use the dict for start task
Mar 21, 2025
a8d1d90
use only conda packages
cgoina Mar 21, 2025
b479a53
update dependencies to run the app on windows
cgoina Mar 24, 2025
bcf3f58
removed gurobi as explicit dependency from pixi.toml
cgoina Mar 24, 2025
6b7d7c9
redirect tqdm to a logger
cgoina Mar 24, 2025
0fef829
command line args
Mar 24, 2025
018d26a
help flag
Mar 24, 2025
447356a
fixed help flag
Mar 24, 2025
65aec0c
removed explicit help flag
cgoina Mar 24, 2025
938992b
rearranged functions
cgoina Mar 24, 2025
ff97665
add egl to hidden imports
cgoina Mar 24, 2025
a5c802b
:Merge branch 'installer' of github.com:funkelab/motile_tracker into …
cgoina Mar 24, 2025
8bee06f
prepare to package different targets
Mar 24, 2025
f83c70f
fixed windows target
cgoina Mar 24, 2025
d488458
renamed the app on Mac - create DMG
Mar 24, 2025
aeaf96b
package-app with depends-on create-app doesn't work yet
Mar 24, 2025
f661a5e
add license
Mar 24, 2025
43c2a86
fixed outputs
Mar 24, 2025
792494c
invoke wininstaller
Mar 24, 2025
be3e10f
fixed wininstaller
cgoina Mar 24, 2025
ea517ab
anoter iss fix
cgoina Mar 24, 2025
cd2ac3e
notes to set build tools env
cgoina Mar 24, 2025
9a5c919
comment
cgoina Mar 24, 2025
b1a706d
linux package cmd
cgoina Mar 24, 2025
d6883b6
set license
cgoina Mar 24, 2025
ca6ef5d
script to finilize linux install
Mar 24, 2025
597c62c
renamed script; fixed permissions
Mar 24, 2025
36f92d9
update conda env
Mar 24, 2025
3535afd
removed constructor
Mar 24, 2025
8f4035d
add package-app dependency on create-app for windows and linux
cgoina Mar 25, 2025
5642fad
Merge branch 'installer' of github.com:funkelab/motile_tracker into i…
cgoina Mar 25, 2025
feda5a4
recreate lock after removing constructor
cgoina Mar 25, 2025
34a7195
publish workflow
Mar 25, 2025
028e48c
add task dependency
Mar 25, 2025
d279bcb
pixi does not seem to propagate common attributes to the platform dep…
Mar 25, 2025
ec89aa8
publish workflow
Mar 25, 2025
8a0e844
step to create app
Mar 25, 2025
e7a5dfa
Merge branch 'deploy' of github.com:funkelab/motile_tracker into deploy
Mar 25, 2025
27f5fa9
trigger publish action when pushing publish.yml
Mar 25, 2025
e693000
trigger publish on deploy branch
Mar 25, 2025
1e95d53
changed working dir
Mar 25, 2025
be3e4cc
disable caching
Mar 25, 2025
a4ccc69
trying to fix pixi install action
Mar 25, 2025
6cbce65
removed \u2705 char from print statement
Mar 25, 2025
d5a6741
download install app
Mar 25, 2025
86823dc
wrong task
Mar 25, 2025
3045c77
attempt to publish artifacts
Mar 25, 2025
c21241c
fixed upload app
Mar 25, 2025
3f5bfc5
condition create-app-bundle on a tag
Mar 25, 2025
3b18912
use prepare matrix
Mar 25, 2025
48d7c73
use matrix from json
Mar 25, 2025
44d3fa9
fixed prepare matrix stage name
Mar 25, 2025
eec8e17
conditional upload
Mar 25, 2025
d319845
only deploy if push was on main branch
Mar 25, 2025
03a2278
fixed the wildcard
Mar 25, 2025
0668932
whitespace removed
Mar 25, 2025
846fcb9
use wildcard
Mar 25, 2025
2c8b7e4
use collect_all for freetype
Mar 25, 2025
6f85008
make the app windowed app only for Mac
Mar 26, 2025
b7d4eb0
set the prerelease and the draft flag based on the tag name
Mar 26, 2025
01caf30
removed patched tqdm init - when windowed option is false it is not n…
cgoina Mar 26, 2025
c51d80c
update logo
Mar 26, 2025
f11d6c3
added task for creating the pypi package
Mar 31, 2025
1f42974
combined deploy and publish into a single workflow
Mar 31, 2025
35f9f66
renamed workflow
Mar 31, 2025
e151cd6
Merge branch 'main' into installer
Apr 14, 2025
bd0909b
fixed finn hook
Apr 14, 2025
76fd7de
updated finn hook
Apr 14, 2025
b80c862
removed print statement
Apr 14, 2025
57f497e
updated ilpy
Apr 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
groups:
dependencies:
patterns:
- "*"
142 changes: 130 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,146 @@ name: Deploy

on:
push:
tags: ["*"]
branches: [deploy] # Change this to run only for push events to main branch
tags: ["v*"] # Push events to matching v*, i.e. v1.0, v20.15.10
pull_request: {}
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
prepare-matrix:
# See this SO answer for details on conditional matrices
# https://stackoverflow.com/a/65434401/3407590
name: Prepare matrix
runs-on: ubuntu-latest
if: contains(github.ref, 'tags')
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Build a binary wheel and a source tarball
python-version: "3.11"
- name: Prepare matrix
id: set-matrix
shell: python
# The Python versions chosen below will determine which
# Python versions the installers will bundle. The general
# principle is to follow the SPEC-0 recommendation:
# https://scientific-python.org/specs/spec-0000/
run: |
python -m pip install -U pip
python -m pip install -U setuptools setuptools_scm build
python -m build --sdist --wheel --outdir dist/
- name: Publish to PyPI
import os
import json
elements = [
{
"os": "ubuntu-latest",
"target-platform": "linux-64",
},
{
"os": "macos-14",
"target-platform": "osx-arm64",
},
{
"os": "windows-latest",
"target-platform": "win-64",
},
]
platforms_str = "${{ inputs.installer_platforms || 'linux-64,win-64,osx-arm64' }}"
platforms = {p.strip() for p in platforms_str.split(",")}
matrix = {"include": []}
for element in elements:
if element["target-platform"] in platforms:
matrix["include"].append(element)
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
f.write(f"matrix={json.dumps(matrix)}\n")

create-app-bundle:
name: Create ${{ matrix.target-platform }} app bundle
runs-on: ${{ matrix.os }}
needs: prepare-matrix
if: startsWith(github.ref, 'refs/tags/') # Only run for tags
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.prepare-matrix.outputs.matrix) }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
path: motile-tracker

- name: Install pixi
uses: prefix-dev/[email protected]
with:
pixi-version: v0.43.2
cache: false
run-install: false
manifest-path: motile-tracker/pixi.toml

- name: Install build tools (Windows only)
if: runner.os == 'Windows'
run: |
$installer = "vs_BuildTools.exe"

Invoke-WebRequest -Uri "https://aka.ms/vs/17/release/vs_BuildTools.exe" -OutFile $installer

Start-Process -Wait -FilePath .\$installer -ArgumentList `
"--quiet", `
"--wait", `
"--norestart", `
"--nocache", `
"--add Microsoft.VisualStudio.Workload.VCTools", `
"--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64", `
"--add Microsoft.VisualStudio.Component.Windows10SDK.19041", `
"--includeRecommended"
shell: pwsh

- name: Install app dependencies
working-directory: motile-tracker
run: pixi run setup

- name: Build the PyPi package (Linux only)
working-directory: motile-tracker
if: runner.os == 'Linux'
run: pixi run build

- name: Publish to PyPi (Linux only)
uses: pypa/gh-action-pypi-publish@release/v1
if: runner.os == 'Linux'
with:
packages-dir: motile-tracker/dist
password: ${{ secrets.PYPI_API_TOKEN }}
- uses: softprops/action-gh-release@v2

- name: Download installer app (Linux only)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y makeself

- name: Download installer app (macOS only)
if: runner.os == 'macOS'
run: |
brew install create-dmg

- name: Download installer app (Windows only)
if: runner.os == 'Windows'
run: |
choco install -y innosetup

- name: Package native app
working-directory: motile-tracker
run: pixi run create-installer

- name: Upload app
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
motile-tracker/dist/MotileTrackerInstaller.*
generate_release_notes: true
token: ${{ secrets.GITHUB_TOKEN }}
draft: ${{ contains(github.ref_name, '-dev') }}
prerelease: ${{ contains(github.ref_name, '-rc') }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ __pycache__/
# C extensions
*.so

# Backup files
*~

# Distribution / packaging
.Python
env/
Expand Down
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ conda before installing the plugin with pip.
conda install -c conda-forge -c funkelab -c gurobi ilpy
pip install motile-tracker

The conda environment can also be created from the provided conda_config.yml:

conda env create -f conda_config.yml
conda activate motile-tracker

Alternatively one can use [pixi](https://pixi.sh/).

## Running Motile Tracker

To run the application:
Expand All @@ -39,6 +46,27 @@ or

motile_tracker

If [pixi](https://pixi.sh/) is available, you can run motile-tracker using:

pixi run start

## Package the application into an executable and create the installer

To create the executab run

pixi run create-app

This command will create an application (.app) on OSX, an EXE on Windows and an
ELF executable on Linux.

On Windows in order to be able to package the application the ilpy library must be
properly installed and compiled. This will require [download](https://aka.ms/vs/17/release/vs_BuildTools.exe) and install [Visual Studio Build Tools](https://visualstudio.microsoft.com/downloads/). This comes with a script to set all required environment variables located typically at `"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"` so before you setup the app you need to run this bat file. For powershell run `scripts\scripts/set-vs-buildTools-env.ps1 <fullpathto vcvars64>`.

Further to create an installer for the app you will need:
* InnoSetup on Windows (`scoop install inno-setup` or `winget install "Inno Setup"`)
* create-dmg on OSX (`brew install create-dmg`)
* makeself on Linux (`apt install makeself`)

## Issues

If you encounter any problems, please
Expand Down
7 changes: 6 additions & 1 deletion conda_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ channels:
- funkelab
- gurobi
dependencies:
- ilpy
- python=3.11.*
- ilpy=0.4.1
- scip=9.1.*
- pip
- pip:
- motile-tracker
12 changes: 12 additions & 0 deletions construct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: motile-tracker
version: 3.1.3
extra_files:
- install-scripts/README.md: README.md
environment_file: conda_config.yml
keep_pkgs: false
installer_type: all
check_path_spaces: false
register_envs: false
post_install: ./install-scripts/postinstall.sh # [unix]
post_install: ./install-scripts/postinstall.bat # [win]
license_file: LICENSE
8 changes: 8 additions & 0 deletions install-scripts/finalize-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

INSTALL_DIR=$PWD

chmod go+rx ${INSTALL_DIR}

echo "MotileTracker installed to ${INSTALL_DIR}"
echo "Run it using: ${INSTALL_DIR}/MotileTracker"
26 changes: 26 additions & 0 deletions install-scripts/wininstaller.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#define AppName "MotileTracker"
#define AppVersion GetFileVersion('dist\MotileTracker\MotileTracker.exe')
#define AppURL "https://funkelab.github.io/motile_tracker"

[Setup]
AppName={#AppName}
AppVersion="1.0"
AppPublisherURL={#AppURL}
DefaultDirName={commonpf}\{#AppName}
LicenseFile="..\LICENSE"
OutputDir="..\dist\"
OutputBaseFilename={#AppName}Installer
Compression=lzma
SolidCompression=yes

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "..\dist\{#AppName}\{#AppName}.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\dist\{#AppName}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

[Icons]
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppName}.exe"
Name: "{group}\{cm:UninstallProgram,{#AppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#AppName}"; Filename: "{app}\{#AppName}.exe"; Tasks: desktopicon
Loading
Loading