Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- py2any.py Distribution Reference --
- The guidata.disthelpers module provides helper functions for Python package distribution on Microsoft Windows platforms with py2exe or on all platforms thanks to cx_Freeze.
- class guidata.disthelpers.Distribution
- Distribution object
- Help creating an executable using py2exe or cx_Freeze
- add_executable(script, target_name, icon=None)
- Add executable to the cx_Freeze distribution Not supported for py2exe
- add_matplotlib()
- Include module Matplotlib to the distribution
- add_module_data_dir(module_name, data_dir_name, extensions, copy_to_root=True, verbose=False, exclude_dirs=[])
- Collect data files in data_dir_name for module module_name and add them to data_files extensions: list of file extensions, e.g. (‘.png’, ‘.svg’)
- add_module_data_files(module_name, data_dir_names, extensions, copy_to_root=True, verbose=False, exclude_dirs=[])¶
- Collect data files for module module_name and add them to data_files data_dir_names: list of dirnames, e.g. (‘images’, ) extensions: list of file extensions, e.g. (‘.png’, ‘.svg’)
- add_module_dir(module_name, verbose=False, exclude_dirs=[])
- Collect all module files for module module_name and add them to data_files
- add_modules(*module_names)
- Include module module_name
- add_pyqt()
- Include module PyQt4 or PyQt5 to the distribution
- add_pyside()
- Include module PySide to the distribution
- add_qt_bindings()
- Include Qt bindings, i.e. PyQt4 or PySide
- add_text_data_file(filename, contents)
- Create temporary data file filename with contents and add it to data_files
- build(library, cleanup=True, create_archive=None)
- Build executable with given library.
- library:
- ‘py2exe’: deploy using the py2exe library
- ‘cx_Freeze’: deploy using the cx_Freeze library
- cleanup: remove ‘build/dist’ directories before building distribution
- create_archive (requires the executable zip):
- None or False: do nothing
- ‘add’: add target directory to a ZIP archive
- ‘move’: move target directory to a ZIP archive
- build_cx_freeze(cleanup=True, create_archive=None)
- Build executable with cx_Freeze
- cleanup: remove ‘build/dist’ directories before building distribution
- create_archive (requires the executable zip):
- None or False: do nothing
- ‘add’: add target directory to a ZIP archive
- ‘move’: move target directory to a ZIP archive
- build_py2exe(cleanup=True, compressed=2, optimize=2, company_name=None, copyright=None, create_archive=None)
- Build executable with py2exe
- cleanup: remove ‘build/dist’ directories before building distribution
- create_archive (requires the executable zip):
- None or False: do nothing
- ‘add’: add target directory to a ZIP archive
- ‘move’: move target directory to a ZIP archive
- setup(name, version, description, script, target_name=None, target_dir=None, icon=None, data_files=None, includes=None, excludes=None, bin_includes=None, bin_excludes=None, bin_path_includes=None, bin_path_excludes=None, msvc=None)
- Setup distribution object
- Notes:
- bin_path_excludes is specific to cx_Freeze (ignored if it’s None)
- if msvc is None, it’s set to True by default on Windows platforms, False on non-Windows platforms
- target_dir
- Return target directory (default: ‘dist’)
- guidata.disthelpers.create_msvc_data_files(architecture=None, python_version=None, verbose=False)
- Including Microsoft Visual C++ DLLs
- guidata.disthelpers.get_changeset(path, rev=None)
- Return Mercurial repository path revision number
- guidata.disthelpers.get_dll_architecture(path)
- Return DLL architecture (32 or 64bit) using Microsoft dumpbin.exe
- guidata.disthelpers.get_msvc_dlls(msvc_version, architecture=None, check_architecture=False)
- Get the list of Microsoft Visual C++ DLLs associated to architecture and Python version, create the manifest file.
- architecture: integer (32 or 64) – if None, take the Python build arch python_version: X.Y
- guidata.disthelpers.get_msvc_version(python_version)
- Return Microsoft Visual C++ version used to build this Python version
- guidata.disthelpers.prepend_module_to_path(module_path)
- Prepend to sys.path module located in module_path Return string with module infos: name, revision, changeset
- Use this function: 1) In your application to import local frozen copies of internal libraries 2) In your py2exe distributed package to add a text file containing the returned string
- guidata.disthelpers.prepend_modules_to_path(module_base_path)
- Prepend to sys.path all modules located in module_base_path
- guidata.disthelpers.remove_dir(dirname)
- Remove directory dirname and all its contents Print details about the operation (progress, success/failure)
- guidata.disthelpers.strip_version(version)
- Return version number with digits only (Windows does not support strings in version numbers)
- guidata.disthelpers.to_include_files(data_files)
- Convert data_files list to include_files list
- data_files:
- this is the py2exe data files format
- list of tuples (dest_dirname, (src_fname1, src_fname2, ...))
- include_files:
- this is the cx_Freeze data files format
- list of tuples ((src_fname1, dst_fname1),
- (src_fname2, dst_fname2), ...))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement