Skip to content

Commit 8303ae1

Browse files
committed
First release
1 parent ad48881 commit 8303ae1

File tree

4 files changed

+82
-64
lines changed

4 files changed

+82
-64
lines changed

CHANGELOG

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
1-
953d991 (HEAD, origin/master, origin/HEAD, master) added tests for source path and source url
1+
ad48881 (HEAD, origin/master, origin/HEAD, master) more fixes
2+
9fc7bc3 test fixes
3+
f6119a7 more tests
4+
e33e157 doc fiX
5+
80c6a55 doc fiX
6+
a5189fb doc fiX
7+
e7fc5d2 Merge pull request #3 from cloudify-cosmo/make-module-generic
8+
b7a5029 validator
9+
6f616c7 Merge pull request #2 from cloudify-cosmo/make-module-generic
10+
52056fd Merge branch 'master' into make-module-generic
11+
a0ce9a6 yay!
12+
025ee77 Merge pull request #1 from cloudify-cosmo/logging_format
13+
80f755a added upgrade supportg
14+
4c82e3c now supporting installation of the module from the tar file
15+
e1a31af made generic and added support for requirement files
16+
a2c0141 many more tests
17+
953d991 added tests for source path and source url
218
e0003e9 Merge branch 'master' of github.com:cloudify-cosmo/cloudify-plugin-packager
319
0cf7402 testing
20+
c05a008 Merge branch 'master' into logging_format
421
9a6fe82 fix flake8
22+
7c420d1 strip() log lines from whitespaces and newlines
523
9638396 fix help text layout
624
3da1dd8 nothing
725
ed5ce71 error handling

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ This tool creates tar.gz based Python Wheel archives for single modules and allo
66

77
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.
88

9+
## Installation
10+
11+
```shell
12+
pip install wheelr
13+
```
14+
915
## Usage
1016

1117
### Create Packages

README.rst

Lines changed: 50 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,58 @@
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

79
Cloudify 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

1114
Usage
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

6763
When 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

7167
Source: Else
7268
~~~~~~~~~~~~
@@ -80,17 +76,17 @@ path to the root of where your setup.py file resides.
8076
Metadata 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
8480
this:
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

117111
The tar.gz archive is named according to the Wheel naming convention
@@ -122,13 +116,13 @@ aside from two fields:
122116
Example: ``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

TODO.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
- plugin_packager/logger.py:60: # TODO: (IMPRV) only perform file related actions if file handler is
2-
- plugin_packager/logger.py:61: # TODO: (IMPRV) defined.
3-
- plugin_packager/packager.py:146: # TODO: maybe we don't want to be that explicit and allow using >=
4-
- plugin_packager/packager.py:147: # TODO: or just a module name...
5-
- plugin_packager/packager.py:230: # TODO: Let the user provide supported Python versions.
6-
- plugin_packager/packager.py:231: # TODO: Let the user provide supported Architectures.
7-
- plugin_packager/utils.py:36: # TODO: implement using sh
1+
- wheelr/logger.py:60: # TODO: (IMPRV) only perform file related actions if file handler is
2+
- wheelr/logger.py:61: # TODO: (IMPRV) defined.
3+
- wheelr/wheelr.py:220: # TODO: maybe we don't want to be that explicit and allow using >=
4+
- wheelr/wheelr.py:221: # TODO: or just a module name...
5+
- wheelr/wheelr.py:288: # TODO: Let the user provide supported Python versions.
6+
- wheelr/wheelr.py:289: # TODO: Let the user provide supported Architectures.
7+
- wheelr/utils.py:46: # TODO: implement using sh

0 commit comments

Comments
 (0)