Skip to content

Commit

Permalink
First release
Browse files Browse the repository at this point in the history
  • Loading branch information
nir0s committed Sep 10, 2015
1 parent ad48881 commit 8303ae1
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 64 deletions.
20 changes: 19 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
953d991 (HEAD, origin/master, origin/HEAD, master) added tests for source path and source url
ad48881 (HEAD, origin/master, origin/HEAD, master) more fixes
9fc7bc3 test fixes
f6119a7 more tests
e33e157 doc fiX
80c6a55 doc fiX
a5189fb doc fiX
e7fc5d2 Merge pull request #3 from cloudify-cosmo/make-module-generic
b7a5029 validator
6f616c7 Merge pull request #2 from cloudify-cosmo/make-module-generic
52056fd Merge branch 'master' into make-module-generic
a0ce9a6 yay!
025ee77 Merge pull request #1 from cloudify-cosmo/logging_format
80f755a added upgrade supportg
4c82e3c now supporting installation of the module from the tar file
e1a31af made generic and added support for requirement files
a2c0141 many more tests
953d991 added tests for source path and source url
e0003e9 Merge branch 'master' of github.com:cloudify-cosmo/cloudify-plugin-packager
0cf7402 testing
c05a008 Merge branch 'master' into logging_format
9a6fe82 fix flake8
7c420d1 strip() log lines from whitespaces and newlines
9638396 fix help text layout
3da1dd8 nothing
ed5ce71 error handling
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ This tool creates tar.gz based Python Wheel archives for single modules and allo

Cloudify Plugins are packaged as sets of Python [Wheels](https://packaging.python.org/en/latest/distributing.html#wheels) in tar.gz files and so we needed a tool to create such archives. Hence, Wheelr.

## Installation

```shell
pip install wheelr
```

## Usage

### Create Packages
Expand Down
106 changes: 50 additions & 56 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,62 +1,58 @@
Cloudify Plugin Packager
========================
Wheelr
======

This tool creates Cloudify plugin packages (Currently, only tested on
Linux).
This tool creates tar.gz based Python Wheel archives for single modules
and allows to install them.

(NOTE: Currently, only tested on Linux).

Cloudify Plugins are packaged as sets of Python
`Wheels <https://packaging.python.org/en/latest/distributing.html#wheels>`__
in tar.gz files.
in tar.gz files and so we needed a tool to create such archives. Hence,
Wheelr.

Usage
-----

Create Packages
~~~~~~~~~~~~~~~

.. code:: shell
cfy-pp create --help
wheelr create --help
Usage: cfy-pp create [OPTIONS]
Examples
^^^^^^^^

Creates a plugin package (tar.gz)
.. code:: shell
Example sources:
- http://github.com/cloudify-cosmo/cloudify-script-plugin/archive/master.tar.gz
- ~/repos/cloudify-script-plugin
- cloudify-script-plugin==1.2.1
# create an archive by retrieving the source from PyPI and keep the downloaded wheels (kept under <cwd>/plugin)
wheelr create -s cloudify-script-plugin==1.2 --keep-wheels -v
# create an archive package by retrieving the source from a URL and creates wheels from requirement files found within the archive.
wheelr create -s http://github.com/cloudify-cosmo/cloudify-script-plugin/archive/1.2.tar.gz -r .
# 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)
wheelr create -s ~/modules/cloudify-script-plugin/ -o /tmp/
- If source is URL, download and extract it and get module name and version
from setup.py.
- If source is a local path, get module name and version from
setup.py.
- If source is module_name==module_version, use them as name and
version.
The output package of the three commands should be something like
``cloudify_script_plugin-1.2-py27-none-any.tar.gz`` if running under
Python 2.7.x.

Options:
-s, --source TEXT Source URL, Path or Module name. [required]
--pre Whether to pack a prerelease of the plugin.
-r, --requirements-file TEXT Whether to also pack wheels from a
requirements file.
-f, --force Force overwriting existing output file.
--keep-wheels Force overwriting existing output file.
-o, --output-directory TEXT Output directory for the tar file.
-v, --verbose
--help Show this message and exit.
Install Packages
~~~~~~~~~~~~~~~~

.. code:: shell
wheelr install --help
Examples
--------
^^^^^^^^

.. code:: shell
# create a plugin package by retrieving the source from PyPI and keep the downloaded wheels (kept under <cwd>/plugin)
cfy-pp create -s cloudify-script-plugin==1.2 --keep-wheels
# create a plugin package by retrieving the source from a URL.
cfy-pp create -s http://github.com/cloudify-cosmo/cloudify-script-plugin/archive/1.2.tar.gz
# 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)
cfy-pp create -s ~/repos/cloudify-script-plugin/ -o /tmp/
The output package of all three commands should be
``cloudify_script_plugin-1.2-py27-none-any.tar.gz`` if running under
Python 2.7.x.
# install a packaged module from a local package tar file and upgrade if already installed
wheelr install -s ~/tars/cloudify_script_plugin-1.2-py27-none-any.tar.gz --upgrade
# install a packaged module from a url into an existing virtualenv
wheelr install -s http://me.com/cloudify_script_plugin-1.2-py27-none-any.tar.gz --virtualenv my_venv -v
Naming and Versioning
---------------------
Expand All @@ -65,8 +61,8 @@ Source: PyPI
~~~~~~~~~~~~

When providing a PyPI source, it must be supplied as
PLUGIN\_NAME==PLUGIN\_VERSION. The packager then applies the correct
name and version to the package according to the two parameters.
MODULE\_NAME==MODULE\_VERSION. Wheelr then applies the correct name and
version to the archive according to the two parameters.

Source: Else
~~~~~~~~~~~~
Expand All @@ -80,17 +76,17 @@ path to the root of where your setup.py file resides.
Metadata File and Wheels
------------------------

A Metadata file is generated for the plugin and looks somewhat like
A Metadata file is generated for the archive and looks somewhat like
this:

::

{
"archive_name": "cloudify_script_plugin-1.2-py27-none-any.tar.gz",
"platform": "any",
"plugin_name": "cloudify-script-plugin",
"plugin_source": "cloudify-script-plugin==1.2",
"plugin_version": "1.2",
"supported_platform": "any",
"module_name": "cloudify-script-plugin",
"module_source": "cloudify-script-plugin==1.2",
"module_version": "1.2",
"wheels": [
"proxy_tools-0.1.0-py2-none-any.whl",
"bottle-0.12.7-py2-none-any.whl",
Expand All @@ -103,15 +99,13 @@ this:
]
}

The metadata file is used by our plugin installer to identify which
plugin to install under certain conditions. PROVIDE MORE INFORMATION
HERE ABOUT THE PLUGIN INSTALLER (AS A LINK, PROBABLY!)

- The wheels to be installed as a part of the plugin reside in the
tar.gz file under 'wheels/\*.whl'.
- The Metadata file resides in the tar.gz file under 'plugin.json'
- The wheels to be installed reside in the tar.gz file under
'wheels/\*.whl'.
- The Metadata file resides in the tar.gz file under 'module.json'.
- The installer uses the metadata file to check that the platform fits
the machine the module is being installed on.

Package naming convention and Platform
Archive naming convention and Platform
--------------------------------------

The tar.gz archive is named according to the Wheel naming convention
Expand All @@ -122,13 +116,13 @@ aside from two fields:
Example: ``cloudify_fabric_plugin-1.2.1-py27-none-linux_x86_64.tar.gz``

- ``{python tag}``: The Python version is set by the Python running the
packaging process. That means that while a plugin can run on both
packaging process. That means that while a module might run on both
py27 and py33 (for example), since the packaging process took place
using Python 2.7, only py27 will be appended to the name. Note that
we will be providing a way for the user to provide the supported
Python versions explicitly.
- ``{platform tag}``: The platform (e.g. ``linux_x86_64``, ``win32``)
is set for a specific wheel. To know which platform the plugin can be
is set for a specific wheel. To know which platform the module can be
installed on, all wheels are checked. If a specific wheel has a
platform property other than ``any``, that platform will be used as
the platform of the package. Of course, we assume that there can't be
Expand Down
14 changes: 7 additions & 7 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- plugin_packager/logger.py:60: # TODO: (IMPRV) only perform file related actions if file handler is
- plugin_packager/logger.py:61: # TODO: (IMPRV) defined.
- plugin_packager/packager.py:146: # TODO: maybe we don't want to be that explicit and allow using >=
- plugin_packager/packager.py:147: # TODO: or just a module name...
- plugin_packager/packager.py:230: # TODO: Let the user provide supported Python versions.
- plugin_packager/packager.py:231: # TODO: Let the user provide supported Architectures.
- plugin_packager/utils.py:36: # TODO: implement using sh
- wheelr/logger.py:60: # TODO: (IMPRV) only perform file related actions if file handler is
- wheelr/logger.py:61: # TODO: (IMPRV) defined.
- wheelr/wheelr.py:220: # TODO: maybe we don't want to be that explicit and allow using >=
- wheelr/wheelr.py:221: # TODO: or just a module name...
- wheelr/wheelr.py:288: # TODO: Let the user provide supported Python versions.
- wheelr/wheelr.py:289: # TODO: Let the user provide supported Architectures.
- wheelr/utils.py:46: # TODO: implement using sh

0 comments on commit 8303ae1

Please sign in to comment.