LibraryBuilder: Difference between revisions

From SweepMe! Wiki
Jump to navigation Jump to search
No edit summary
(copy new text from external libraries and dependencies page)
Line 1: Line 1:
The LibraryBuilder is a tool which helps you to collect all missing python packages that are missing in the main program.
The LibraryBuilder is a tool to simplify the packaging of additional python modules to be used with SweepMe! components.
Thus, you can import them in your Device Class.


An example is given in the Device Class called [https://sweep-me.net/deviceclass.php?id=11 ImportModules]. Install it from the webpage, use the DeviceClassManager or check your DeviceClasses folder if it is already there.
This tool ensures that
* all necessary files for the python module are included
* indirect dependencies of the module are included
* duplicate packages that are already contained within SweepMe! are removed


Steps to get it working:
== Requirements ==


# Open build_library.py and set the path where to find your SweepMe! installation. The script can now check, which packages already exist.
Install Python 3.6 (i.e. same version as used by SweepMe!) with:
# Open required_modules.py and type in "import <your-module>". Nothing else is needed. Import all packages you need for your application
* all packages installed you need for your Device Class
# Run build_library.py - Please make sure that you use the same python version than used for SweepMe!
* pyinstaller 3.3.1 [https://pypi.org/project/PyInstaller/3.3.1/] (newer versions will not work)
# The output will be found in a newly created folder called 'libs'. Please make sure that you have all licenses in order to use or to distribute these files. We recommend to add a folder including all licenses files.
 
# Copy the folder 'libs' into your Device Class folder
== Extracting the missing packages  ==
# Check the Device Class 'ImportModules' to see how to import packages from the folder 'libs'
 
# Goto LibraryBuilder folder
# Open build_library.py and change '''sweepme_path''' to your installation path of SweepMe!
# Open required_modules.py and import all packages which are missing in SweepMe!
# Run build_library.py
# Copy the folder libs_required_modules to your DC and rename as desired
# Do not forget to add licence files for each package that has been added

Revision as of 20:49, 17 February 2020

The LibraryBuilder is a tool to simplify the packaging of additional python modules to be used with SweepMe! components.

This tool ensures that

  • all necessary files for the python module are included
  • indirect dependencies of the module are included
  • duplicate packages that are already contained within SweepMe! are removed

Requirements

Install Python 3.6 (i.e. same version as used by SweepMe!) with:

  • all packages installed you need for your Device Class
  • pyinstaller 3.3.1 [1] (newer versions will not work)

Extracting the missing packages

  1. Goto LibraryBuilder folder
  2. Open build_library.py and change sweepme_path to your installation path of SweepMe!
  3. Open required_modules.py and import all packages which are missing in SweepMe!
  4. Run build_library.py
  5. Copy the folder libs_required_modules to your DC and rename as desired
  6. Do not forget to add licence files for each package that has been added