ipybuild¶
Version: 0.0.A10 - Apr 18, 2018
created on: | Wed Feb 14 19:44:03 2018 |
---|---|
author: | PE LLC peswin@mindspring.com |
copyright: | 2018, Howard Dunn. Apache 2.0 v2 licensed. |
space separated - use relative or absolute paths non-quoted args
params:
configPath: | [opt][str] - user .config path location or ‘’ to use default_config.config |
---|---|
mainName: | [str] - Python/IronPython “.py” file to compile as library .dll or .exe |
outDir: | [opt][str] - output directory path - default “release/” |
jsonarg: | [opt][str] - path to assembly and embedding flags .json file |
Bool or makeEXE=: | |
True - make exe [bool][opt] - default False to make dll file |
|
args: |
|
kwargs filepath - like listexe=myprojectpyfilelist.txt [opt]
listexe or exe:
- all .py required to run the main.py file as an exe
listdll or dll:
- pre-compiled .dlls or .py module files to add or embed in main
listzip or zip:
- file path structure and file archive into output directory
options: at end of params
- -h,/? help
- -v verbose output
- see help (-h -v) and documentation for more
- Example: ``python ipybuild.py c:/souredir/my.config appname c:/release
- listexe=c:/dev/include.txt``
-
ipybuild.
helpVerbose
()¶ Writes or reads a python compile specific config file used in buildmake.py. Command-line args are parsed by pseudo-ORDER.
First three args any order unless none then last.args:
configPath: [opt][str] - user .config path location or ‘’ to use default_config.config
mainName: [str] - python/ironpython “.py” file to compile as library .dll or .exe
if you leave mainName out final compile is suspended until re-run with mainName
outDir: [opt][str] - output directory path - default “release/”
jsonarg: - [opt][str] - path to assembly and embedding flags .json file
- defaults to “defaults/”asembly_config.json” and requires the file path subdirectory “defaults/”.
Bool or makeEXE=: True - make exe [bool][opt] - default False to make dll file
After first three/four args above.
args: single file paths [str] to add in compile - MUST contain key word (‘exe’, ‘dll’, or ‘zip’) - like mypydll.py or zip.txt
kwargs filepath - like listexe=myprojectpyfilelist.txt [opt]
listexe or exe: - all .py required to run the main.py file as an exe
listdll or dll: - pre-compiled .dlls or .py module files to add or embed in main
listzip or zip: - file path structure and file archive into output directory
options
-h,/? help
max output switch: args include -v ex. -h -v
-v verbose output
- Example: ``python ipybuild.py c:/souredir/my.config appname c:/release
- listexe=c:/dev/include.txt``
- cmd example:
python ipybuild.py '' examples\makehello.py example\makehello _assembly.json 'True' 'listdll=examples\listdll.txt
names/outdir omitted are auto-named with the following preference; assembly.json path >> main name path >> config name path
help - extra: -h, /h, /? plus -v
setup: [opt]: manually setup “appname”.json file: defaults to assembly.json
- assembly json
- User assembly info compiled into exe
- User assembly info (i.e. version) - Not Implemented for dll files
assembly.json file content (default): ..code-block: json:
{ "company": "Your Identifier" "product_version": "0.0.0.1" "standalone": false / set true for exe standalone "file_version": "0.0.0.1" "embed": false / set true to add dlls to exe "libembed": false / set true to add StdLib.dll to exe "copyright": "Copyright Notice" "product_name": "Application exe name" }
args:
- configPath [opt] - “” or user config path ex. myapp.config
- |[default] - UserDefaulted/default_config.config
- mainName - input main entry Name or dll Name ex. hello.py
- |can build config but can’t compile until provided
- bool or makeEXE [opt] = [True,False] - [default] False ex. True or makeExe=True
- |Set/provide True arg for executable (exe)
jsonp [opt] - path to assembly.json file
outDir [opt]- output dir relative or absolute path
no comma separation unless inside tuple or list, no spaces k=v
- configPath:
- if args configuration path exists reads, otherwise writes then: creates “app_config.config used for main name “app”.py.
- use two quotes, no space ‘’ for a default config file
- extended args: abs/rel paths
[opt]: listexe - path/ listexe.txt: exe inlcude module.py files [opt]: listdll - path/ listdll.txt: dll inlcude files [opt]: listzip - path/ listzip.txt: zip package files
ipybuild maps input based on ‘dll’, ‘exe’, or ‘zip’ as part of the arg.
create include file lists create with an editor: (listexe, listdll, listzip):
Do not mix: bad - listdll.zip, listdll=exedll.txt good use - listzip.txt - listdll=my.py,your.py - listdll=my.dll
Can be one file or file list, comma or newline separated. Generate a list by a windows
dir /b >> mylistdll.txt
or bashll >> mylistexe.txt
command piped to file then edit to build/load exactly what you want and where it is located.kwargs: [opt]: any or all as key,value pair result: Reads/writes a user config file “mainName”_config.config
Builds an exe or dll file based on options makeEXE
- Example: ``python ipybuild.py c:/souredir/my.config appname c:/release
- listexe=c:/dev/include.txt``
Same as:
python ipybuild.py c:/souredir/my.config appname c:/release c:/dev/include.txt
Same as: ``python ipybuild.py {‘configPath/my.config’:’c:/souredir’‘mainName’:’appname’ ‘outDir’:’c:/source’ ‘listexe’:’c:/dev/include.txt’}``update previous run with new param: python ipybuild.py c:/souredir/my.config, ‘’, c:/debug see: examples/ and examples/release - user must manually set the IronPython path note: Make sure your .py runs (ipy.exe) from release directory then all
references should match the compiled ver. You don’t have to keep the .py files in release, just use them to check.
If unittest was run *before ipybuild you MUST restart the python interpreter to get logging in ipybuild runs.*
file write logs can only be manually deleted after python interpreter is closed
Carefully read the output and File log to see find what is executing
-
ipybuild.
Build
(args)¶ - User normal call - provide filepaths and bool True to make exe
- args, kwargs have list or str of resources to add.
- For lists of resource files: Associated py files in listexe.txt , .py or .dll libraries in listdll.txt files files to zip in
listzip.txt.
- For single resources:
- just add the filepath; listexe=module.py.
Params: configPath, mainName, outDir, jsonp, makeEXE, *args, **kwargs Returns: None Output: Status and build files
-
ipybuild.
ScriptBuild
(configPath=None, mainName=None, outDir=None, jsonp=None, makeEXE=False, *args, **kwargs)¶ User normal call - see Build
Params: configPath=None, mainName=None, outDir=None, jsonp=None, makeEXE=False, *args, **kwargs Returns: None Output: Status and build files
-
ipybuild.
logReport
()¶ - Output filtered log files showing:
- files confirmed to exists during run
- files written during run
Log error: Unit testing run before ipybuild kills ipybuild logging