PyOxidizer sample.
Prerequisite: Setup with Getting Started — PyOxidizer 0.1 documentation
-
pyoxi
Generated by
pyoxidizer init pyoxi. It includes the most important configuration filepyoxidizer.toml -
pyproj
Python project.
mymain.pyis entry point andmodel.progressis called bymymain.py.Here is the execution command example:
python mymain.py -m "something"It will print
"something"and<model.progress.ProgressRate object at 0x10ef7c780>or like that.
Working directory is pyoxi.
- Build:
pyoxidizer build - Run:
build/build/apps/pyapp/debug/pyapp -m "something"
You can find executable in here: Release First Executable · tkhm/pyoxidizer-trial
-
Import
numpylib will be failed with the following error:Traceback (most recent call last): File "mymain", line 5, in <module> File "numpy", line 126, in <module> File "numpy.__config__", line 10, in <module> NameError: name '__file__' is not defined SystemErrorYou can reproduce it with adding
numpy==1.16.3inrequirements.txt+ addingfrom numpy import polyfitandpolyfit([1], [1], 1)[0]inmymain.pyor somewhere. -
Rebuild will not execute
If you just change your python code,
pyoxidizer buildwill not build again. I guess you need to updatepyoxidizer.toml's timestamp.You can do that with
touch pyoxidizer.toml.