Skip to content

Commit

Permalink
Merge pull request #34 from MannLabs/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
swillems authored Nov 25, 2020
2 parents bbd8951 + 2116b2f commit f9e1cdd
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 26 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Sander Willems
Copyright (c) 2020 Max Planck Institute of Biochemistry, Mann department

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
16 changes: 8 additions & 8 deletions alphatims/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])


def parse_args_with_default_help(self, ctx, args):
if not args:
args = ["-h"]
return self.original_parse_args(ctx, args)


click.Command.original_parse_args = click.Command.parse_args
click.Command.parse_args = parse_args_with_default_help
# def parse_args_with_default_help(self, ctx, args):
# if not args:
# args = ["-h"]
# return self.original_parse_args(ctx, args)
#
#
# click.Command.original_parse_args = click.Command.parse_args
# click.Command.parse_args = parse_args_with_default_help


@contextlib.contextmanager
Expand Down
Binary file added misc/alpha_logo.ico
Binary file not shown.
56 changes: 41 additions & 15 deletions misc/alphatims.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import os
import sys
from PyInstaller.building.build_main import Analysis, PYZ, EXE, COLLECT, BUNDLE, TOC


##################### User definitions
hidden_imports = [
i[1] for i in pkgutil.iter_modules() if i[2]
]
exe_name = 'alphatims'
script_name = 'alphatims_pyinstaller.py'
location = os.getcwd()
add_datashader_glyphs = True
icon = 'alpha_logo.ico'
#####################


def collect_pkg_data(package, include_py_files=False, subdir=None):
Expand Down Expand Up @@ -43,9 +45,14 @@ pkg_data = [
collect_pkg_data(package_name, False) for package_name in hidden_imports
]

if add_datashader_glyphs:
pkg_data.append(
collect_pkg_data("datashader.glyphs", True)
)

block_cipher = None

location = os.getcwd()

a = Analysis(
[script_name],
Expand All @@ -66,26 +73,45 @@ pyz = PYZ(
a.zipped_data,
cipher=block_cipher
)
# exe = EXE(
# pyz,
# a.scripts,
# [],
# exclude_binaries=True,
# name=exe_name,
# debug=False,
# bootloader_ignore_signals=False,
# strip=False,
# upx=True,
# console=True
# )
# coll = COLLECT(
# exe,
# a.binaries,
# a.zipfiles,
# a.datas,
# *pkg_data,
# strip=False,
# upx=True,
# upx_exclude=[],
# name=exe_name
# )

exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name=exe_name,
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True
)
coll = COLLECT(
exe,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
*pkg_data,
[],
name=exe_name,
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
name=exe_name
runtime_tmpdir=None,
console=True,
icon=icon
)
50 changes: 50 additions & 0 deletions misc/alphatims_innoinstaller.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "alphatims"
#define MyAppVersion "0.0.201125"
#define MyAppPublisher "Max Planck Institute of Biochemistry, Mann department"
#define MyAppURL "https://github.com/MannLabs/alphatims"
#define MyAppExeName "alphatims.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{6D4B5768-5751-4E84-9096-C06B3DAA9979}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DisableProgramGroupPage=yes
LicenseFile=..\LICENSE.txt
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
OutputDir=dist
OutputBaseFilename=alphatims_installer
SetupIconFile=alpha_logo.ico
Compression=lzma
SolidCompression=yes
WizardStyle=modern

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

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

[Files]
Source: "dist\alphatims\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "dist\alphatims\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
6 changes: 4 additions & 2 deletions misc/create_installer.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
call conda create -n alphatimsinstaller python=3.8 -y
call conda activate alphatimsinstaller
REM call conda install git -y
call pip install 'git+https://github.com/MannLabs/alphatims.git#egg=alphatims[gui,cli]' --use-feature=2020-resolver
REM call pip install 'git+https://github.com/MannLabs/alphatims.git#egg=alphatims[gui,cli]' --use-feature=2020-resolver
call pip install ../.[gui,cli] --use-feature=2020-resolver
call pip install pyinstaller
call cd alphatims/misc
call pyinstaller alphatims.spec -y
REM call "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" alphatims_innoinstaller.iss
call iscc alphatims_innoinstaller.iss
call conda deactivate

0 comments on commit f9e1cdd

Please sign in to comment.