1- Cloudify Plugin Packager
2- ========================
1+ Wheelr
2+ ======
33
4- This tool creates Cloudify plugin packages (Currently, only tested on
5- Linux).
4+ This tool creates tar.gz based Python Wheel archives for single modules
5+ and allows to install them.
6+
7+ (NOTE: Currently, only tested on Linux).
68
79Cloudify Plugins are packaged as sets of Python
810`Wheels <https://packaging.python.org/en/latest/distributing.html#wheels >`__
9- in tar.gz files.
11+ in tar.gz files and so we needed a tool to create such archives. Hence,
12+ Wheelr.
1013
1114Usage
1215-----
1316
17+ Create Packages
18+ ~~~~~~~~~~~~~~~
19+
1420.. code :: shell
1521
16- cfy-pp create --help
22+ wheelr create --help
1723
18- Usage: cfy-pp create [OPTIONS]
24+ Examples
25+ ^^^^^^^^
1926
20- Creates a plugin package (tar.gz)
27+ .. code :: shell
2128
22- Example sources:
23- - http://github.com/cloudify-cosmo/cloudify-script-plugin/archive/master.tar.gz
24- - ~ /repos/cloudify-script-plugin
25- - cloudify-script-plugin==1.2.1
29+ # create an archive by retrieving the source from PyPI and keep the downloaded wheels (kept under <cwd>/plugin)
30+ wheelr create -s cloudify-script-plugin==1.2 --keep-wheels -v
31+ # create an archive package by retrieving the source from a URL and creates wheels from requirement files found within the archive.
32+ wheelr create -s http://github.com/cloudify-cosmo/cloudify-script-plugin/archive/1.2.tar.gz -r .
33+ # create an archive package by retrieving the source from a local path and output the tar.gz file to /tmp/<MODULE>.tar.gz (defaults to <cwd>/<MODULE>.tar.gz)
34+ wheelr create -s ~ /modules/cloudify-script-plugin/ -o /tmp/
2635
27- - If source is URL, download and extract it and get module name and version
28- from setup.py.
29- - If source is a local path, get module name and version from
30- setup.py.
31- - If source is module_name==module_version, use them as name and
32- version.
36+ The output package of the three commands should be something like
37+ ``cloudify_script_plugin-1.2-py27-none-any.tar.gz `` if running under
38+ Python 2.7.x.
3339
34- Options:
35- -s, --source TEXT Source URL, Path or Module name. [required]
36- --pre Whether to pack a prerelease of the plugin.
37- -r, --requirements-file TEXT Whether to also pack wheels from a
38- requirements file.
39- -f, --force Force overwriting existing output file.
40- --keep-wheels Force overwriting existing output file.
41- -o, --output-directory TEXT Output directory for the tar file.
42- -v, --verbose
43- --help Show this message and exit.
40+ Install Packages
41+ ~~~~~~~~~~~~~~~~
42+
43+ .. code :: shell
44+
45+ wheelr install --help
4446
4547 Examples
46- --------
48+ ^^^^^^^^
4749
4850.. code :: shell
4951
50- # create a plugin package by retrieving the source from PyPI and keep the downloaded wheels (kept under <cwd>/plugin)
51- cfy-pp create -s cloudify-script-plugin==1.2 --keep-wheels
52- # create a plugin package by retrieving the source from a URL.
53- cfy-pp create -s http://github.com/cloudify-cosmo/cloudify-script-plugin/archive/1.2.tar.gz
54- # create a plugin package by retrieving the source from a local path and output the tar.gz file to /tmp/<PLUGIN>.tar.gz (defaults to <cwd>/<PLUGIN>.tar.gz)
55- cfy-pp create -s ~ /repos/cloudify-script-plugin/ -o /tmp/
56-
57- The output package of all three commands should be
58- ``cloudify_script_plugin-1.2-py27-none-any.tar.gz `` if running under
59- Python 2.7.x.
52+ # install a packaged module from a local package tar file and upgrade if already installed
53+ wheelr install -s ~ /tars/cloudify_script_plugin-1.2-py27-none-any.tar.gz --upgrade
54+ # install a packaged module from a url into an existing virtualenv
55+ wheelr install -s http://me.com/cloudify_script_plugin-1.2-py27-none-any.tar.gz --virtualenv my_venv -v
6056
6157 Naming and Versioning
6258---------------------
@@ -65,8 +61,8 @@ Source: PyPI
6561~~~~~~~~~~~~
6662
6763When providing a PyPI source, it must be supplied as
68- PLUGIN \_ NAME==PLUGIN \_ VERSION. The packager then applies the correct
69- name and version to the package according to the two parameters.
64+ MODULE \_ NAME==MODULE \_ VERSION. Wheelr then applies the correct name and
65+ version to the archive according to the two parameters.
7066
7167Source: Else
7268~~~~~~~~~~~~
@@ -80,17 +76,17 @@ path to the root of where your setup.py file resides.
8076Metadata File and Wheels
8177------------------------
8278
83- A Metadata file is generated for the plugin and looks somewhat like
79+ A Metadata file is generated for the archive and looks somewhat like
8480this:
8581
8682::
8783
8884 {
8985 "archive_name": "cloudify_script_plugin-1.2-py27-none-any.tar.gz",
90- "platform ": "any",
91- "plugin_name ": "cloudify-script-plugin",
92- "plugin_source ": "cloudify-script-plugin==1.2",
93- "plugin_version ": "1.2",
86+ "supported_platform ": "any",
87+ "module_name ": "cloudify-script-plugin",
88+ "module_source ": "cloudify-script-plugin==1.2",
89+ "module_version ": "1.2",
9490 "wheels": [
9591 "proxy_tools-0.1.0-py2-none-any.whl",
9692 "bottle-0.12.7-py2-none-any.whl",
@@ -103,15 +99,13 @@ this:
10399 ]
104100 }
105101
106- The metadata file is used by our plugin installer to identify which
107- plugin to install under certain conditions. PROVIDE MORE INFORMATION
108- HERE ABOUT THE PLUGIN INSTALLER (AS A LINK, PROBABLY!)
109-
110- - The wheels to be installed as a part of the plugin reside in the
111- tar.gz file under 'wheels/\* .whl'.
112- - The Metadata file resides in the tar.gz file under 'plugin.json'
102+ - The wheels to be installed reside in the tar.gz file under
103+ 'wheels/\* .whl'.
104+ - The Metadata file resides in the tar.gz file under 'module.json'.
105+ - The installer uses the metadata file to check that the platform fits
106+ the machine the module is being installed on.
113107
114- Package naming convention and Platform
108+ Archive naming convention and Platform
115109--------------------------------------
116110
117111The tar.gz archive is named according to the Wheel naming convention
@@ -122,13 +116,13 @@ aside from two fields:
122116Example: ``cloudify_fabric_plugin-1.2.1-py27-none-linux_x86_64.tar.gz ``
123117
124118- ``{python tag} ``: The Python version is set by the Python running the
125- packaging process. That means that while a plugin can run on both
119+ packaging process. That means that while a module might run on both
126120 py27 and py33 (for example), since the packaging process took place
127121 using Python 2.7, only py27 will be appended to the name. Note that
128122 we will be providing a way for the user to provide the supported
129123 Python versions explicitly.
130124- ``{platform tag} ``: The platform (e.g. ``linux_x86_64 ``, ``win32 ``)
131- is set for a specific wheel. To know which platform the plugin can be
125+ is set for a specific wheel. To know which platform the module can be
132126 installed on, all wheels are checked. If a specific wheel has a
133127 platform property other than ``any ``, that platform will be used as
134128 the platform of the package. Of course, we assume that there can't be
0 commit comments