Package: pdistx
Python Distribution ToolsInstallationNote:the Python Distribution Tools require Python 3.9 or newer to run. But of course, the tools can translate code for older Python versions.Recommended: Usepipx# find your Python 3.9 binary and use that one for the following commandspython--version
python3--version
python3.9--version# install pipx to be able to run pypi packages directlypython-mpipinstallpipx# run pdistxpipxrunpdistxvendor--help
pipxrunpdistxvariant--help
pipxrunpdistxpack--help# in case pipx is not in the path, you can run it as modulepython-mpipxrunpdistxvendor--help
python-mpipxrunpdistxvariant--help
python-mpipxrunpdistxpack--helpAlternative: Installpdistxand use it directly# find your Python 3.9 binary and use that one for the following commandspython--version
python3--version
python3.9--version# install pdistxpython-mpipinstallpdistx# run pdistxpvendor--help
pvariant--help
ppack--help# in case pdistx is not in the path, you can run it as modulepython-mpvendor--help
python-mpvariant--help
python-mppack--helpPython Vendoring ToolVendor libraries in a subpackage, which can be placed anywhere in a project.$ pvendor --help
$ pdistx vendor --help

usage: pvendor [-h] [-r requirements] [-s source] [-p pip] [-k keep] [-z zip] target

positional arguments:
  target           target folder (will be cleared, except for the ones to be kept)

optional arguments:
  -h, --help       show this help message and exit
  -r requirements  install packages from requirements.txt
  -s source        copy modules from source folder
  -p pip           pip command (defaults to pip)
  -k keep          files or folders to be kept in the target folder (defaults to requirements.txt and .gitignore)
  -z zip           zip file path (target becomes relative path within zip file)Python Variant ExporterExport a specific variant from a codebase.$ pvariant --help
$ pdistx variant --help

usage: pvariant [-h] [-d name[:type]=value] [-f filter] [-z zip] source target

positional arguments:
  source                source path
  target                target path (will be cleared)

optional arguments:
  -h, --help            show this help message and exit
  -d name[:type]=value  define variables to be replaced, e.g. -d __VARIANT__=PRO -d __LICENSE_CHECK__:bool=True
  -f filter             defines files and folders to be filtered out (glob pattern)
  -z zip                zip file path (target becomes relative path within zip file)Python Packer ToolPack a Python package into a single Python file.$ ppack --help
$ pdistx pack --help

usage: ppack [-h] [-r] [-m] [-f filter] [-z zip] source target

positional arguments:
  source      source package path
  target      target python (will be cleared)

optional arguments:
  -h, --help  show this help message and exit
  -r          create a resources folder with all non-python files (it will be named <target>_resources and be cleared)
  -m          use __main__.py of the package as bootstrap code (default is to use the root __init__.py of the package)
  -f filter   defines files and folders to be filtered out (glob pattern)
  -z zip      zip file path (target becomes relative path within zip file)ExamplesBlender Addon# vendor packagespvendorexamples/blender_addon/vendor# generate PRO as zippvariant\-d__VARIANT__=PRO\-f'**/free.bip'\-z$HOME/Desktop/blender_addon.zip\examples/blender_addon\blender_addon# generate FREE as folderpvariant\-d__VARIANT__=FREE\-f'**/pro.bip'\examples/blender_addon\$HOME/.config/blender/2.93/scripts/addons/blender_addon# pack addon as single fileppack\-r\-f'vendor/requirements.txt'-f'vendor/.gitignore'\examples/blender_addon\$HOME/.config/blender/2.93/scripts/addons/blender_addon.pyQT App# vendor packagespvendorexamples/qt_app/vendor# pack app as single fileppack\-r\-f'vendor/requirements.txt'-f'vendor/.gitignore'\-m\examples/qt_app\$HOME/Desktop/qt_app.py