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.py
is entry point andmodel.progress
is 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
numpy
lib 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 SystemError
You can reproduce it with adding
numpy==1.16.3
inrequirements.txt
+ addingfrom numpy import polyfit
andpolyfit([1], [1], 1)[0]
inmymain.py
or somewhere. -
Rebuild will not execute
If you just change your python code,
pyoxidizer build
will not build again. I guess you need to updatepyoxidizer.toml
's timestamp.You can do that with
touch pyoxidizer.toml
.