Read Latest Documentation - Browse GitHub Code Repository
If you have installed VSCode and Docker, just click and choose "Clone repo in container volume", it'll open a new container with building environments.
Building linux executable:
pyinstaller -F --windowed build-win.spec
Building Windows executable:
wine pyinstaller -F --windowed build-win.spec
Hosing in local
portray server
Push to github pages
portray on_github_pages
We use portary to generate docs, and you can add Pymdown Extensions to extend Markdown format. For example, you can add
"pymdownx.arithmatex"
intoextra_markdown_extensions
list which under the section[tool.portray]
ofpyproject.toml
to have the ability to parse LaTeX math equations.
test for a file:
pre-commit run --files ./DataTag_helper.py
test for all files:
pre-commit run --all-files
If you want to commit without pre-commit checks, just run
git commit -m "some messages" --no-verify
https://www.anaconda.com/products/individual
Navigating to the directory of this repo.
cd /workspace/DataTag_helper
Create conda env
conda create --name DataTag_helper python=3.6
conda activate DataTag_helper
If conda install has permission error, excute:
sudo chown 1000:1000 -R /opt/conda/
This will change the owner of conda folder.
If conda activation failed, just execute:
conda init bash
to init bash env
Install packages
conda install wxpython
conda install -c conda-forge gooey
pip install -r project_requirements.txt
pip install -r requirements.txt
must first install wxpython before Gooey to avoid strange error
Installation via pip fails needing pathlib2 · Issue #474 · chriskiehl/Gooey
python DataTag_helper.py
you should see the GUI window popup.
Gooey/Packaging-Gooey.md at master · chriskiehl/Gooey
Packing Gooey into a standalone executable is super straight forward thanks to PyInstaller. It is the only dependency you'll need and can be installed via the following.
pip install pyinstaller==3.5
From the command line, run
pyinstaller -F --windowed build-win.spec
-F
tells PyInstaller to create a single bundled output file--windowed
disables the terminal which would otherwise launch when you opened your app.
And that's it. Inside of the dist/
directory, you'll find a beautiful stand-alone executable that you can distribute to your users.
If you encounter an error:
FileNotFoundError: [Errno 2] No such file or directory: 'objcopy': 'objcopy'
you should install dependenies
sudo apt update sudo apt install -y binutils libc6
-
add wine apt repository
For Ubuntu - WineHQ Wiki:
sudo dpkg --add-architecture i386 wget -O - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add - sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'
Install unmet dependence:
faudio
(only needed for unbuntu18.04, because higher version already has libfaudio0 in repository)sudo add-apt-repository ppa:cybermax-dexter/sdl2-backport sudo apt update
For debian 10:
sudo dpkg --add-architecture i386 wget -qO - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add - sudo apt-add-repository https://dl.winehq.org/wine-builds/debian/ wget -O- -q https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_10/Release.key | sudo apt-key add - echo "deb http://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_10 ./" | sudo tee /etc/apt/sources.list.d/wine-obs.list
update:
sudo apt update
Notes:
check linux distribution:
cat /etc/*-release
see: https://www.cyberciti.biz/faq/find-linux-distribution-name-version-number/
If you encounter an error:
sudo: apt-add-repository: command not found
install
sudo apt -y install software-properties-common
-
Install latest wine
How to Install Wine Devel 4.8 in Ubuntu 19.04 / 18.04 | UbuntuHandbook
sudo apt install --install-recommends winehq-devel
-
install python in wine
python - compiling .py into windows AND mac executables on Ubuntu - Stack Overflow
wine --version winecfg wget https://www.python.org/ftp/python/3.6.8/python-3.6.8-amd64.exe wine python-3.6.8-amd64.exe
headless install:
install xvfb:
sudo apt-get install --fix-missing -y xvfb
cerate virtual frame buffer:
Xvfb :0 -screen 0 1024x768x16 &
execute python installer:
DISPLAY=:0.0 wine python-3.6.8-amd64.exe /quiet InstallAllUsers=1 PrependPath=1
-
install wxpython, gooey, pyinstaller and other requirements
wine pip install wxpython wine pip install gooey wine pip install -r project_requirements.txt wine pip install pyinstaller==3.5
-
activate upx compression (optional):
wget https://github.com/upx/upx/releases/download/v3.96/upx-3.96-win64.zip unzip -j "upx-3.96-win64.zip" "upx-3.96-win64/upx.exe" -d "./"
note: upx may cause dll corruption, you may want to disable UPX, see:
- Onefile builds not working on Windows 10, Error loading Python dll · Issue #3600 · pyinstaller/pyinstaller
- python - Error when creating executable file with pyinstaller - Stack Overflow
- python - DLL load failure with Python3 (32bit)+PyInstaller+UPX (32bit) under Windows 10 (64bit) - Stack Overflow
- Dependency Walker (depends.exe) Home Page
wine pyinstaller -F --windowed build-win.spec
debug mode
Using PyInstaller — PyInstaller 3.6 documentation
wine pyinstaller -F --windowed build-win.spec -d bootloader
wine ./dist/DataTag_helper.exe
Run test
pytest
Run test with print messages
pytest -s
Run single test function
pytest -s tests/test_DataTag_helper.py::test_json_to_excel_1
How to test with cli? see: Build and Test a Command Line Interface with Poetry, Python's argparse, and pytest - DEV Community 👩💻👨💻
-
Gooey/all_widgets_subparser.py at 66f154decb8cd7d140a702277d8c262c4d8194cc · chriskiehl/Gooey
-
python - How to define a mutually exclusive group of two positional arguments? - Stack Overflow
FileChooser, DirChooser, FileSaver, MultiFileChooser, DateChooser, TimeChooser