Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f6eaa68

Browse files
committed
Fix README format
1 parent 45e88e4 commit f6eaa68

File tree

1 file changed

+91
-101
lines changed

1 file changed

+91
-101
lines changed

README.md

Lines changed: 91 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,163 +1,152 @@
1-
Description
2-
===========
3-
1+
python Cookbook
2+
===============
43
Installs and configures Python. Also includes LWRPs for managing python packages with `pip` and `virtualenv` isolated Python environments.
54

6-
Requirements
7-
============
8-
9-
Platform
10-
--------
11-
12-
* Debian, Ubuntu
13-
* CentOS, Red Hat, Fedora
145

15-
Cookbooks
16-
---------
6+
Requirements
7+
------------
8+
### Platforms
9+
- Debian, Ubuntu
10+
- CentOS, Red Hat, Fedora
1711

18-
* build-essential
19-
* yum
12+
### Cookbooks
13+
- build-essential
14+
- yum
2015

2116
NOTE: The `yum` cookbook is a dependency of the cookbook, and will be used to install [EPEL](http://fedoraproject.org/wiki/EPEL) on RedHet/CentOS 5.x systems to provide the Python 2.6 packages.
2217

23-
Attributes
24-
==========
2518

19+
Attributes
20+
----------
2621
See `attributes/default.rb` for default values.
2722

28-
* `node["python"]["install_method"]` - method to install python with, default `package`.
23+
- `node["python"]["install_method"]` - method to install python with, default `package`.
2924

3025
The file also contains the following attributes:
3126

32-
* platform specific locations and settings.
33-
* source installation settings
27+
- platform specific locations and settings
28+
- source installation settings
3429

35-
Resource/Provider
36-
=================
3730

31+
Resource/Provider
32+
-----------------
3833
This cookbook includes LWRPs for managing:
3934

40-
* pip packages
41-
* virtualenv isolated Python environments
42-
43-
`python_pip`
44-
------------
35+
- pip packages
36+
- virtualenv isolated Python environments
4537

38+
### `python_pip`
4639
Install packages using the new hotness in Python package management...[`pip`](http://pypi.python.org/pypi/pip). Yo dawg...easy_install is so 2009, you better ask your local Pythonista if you don't know! The usage semantics are like that of any normal package provider.
4740

48-
# Actions
49-
41+
#### Actions
5042
- :install: Install a pip package - if version is provided, install that specific version (default)
5143
- :upgrade: Upgrade a pip package - if version is provided, upgrade to that specific version
5244
- :remove: Remove a pip package
5345
- :user: User to run pip as, for using with virtualenv
5446
- :group: Group to run pip as, for using with virtualenv
5547
- :purge: Purge a pip package (this usually entails removing configuration files as well as the package itself). With pip packages this behaves the same as `:remove`
5648

57-
# Attribute Parameters
58-
49+
#### Attribute Parameters
5950
- package_name: name attribute. The name of the pip package to install
6051
- version: the version of the package to install/upgrade. If no version is given latest is assumed.
6152
- virtualenv: virtualenv environment to install pip package into
6253
- options: Add additional options to the underlying pip package command
6354
- timeout: timeout in seconds for the command to execute. Useful for pip packages that may take a long time to install. Default 900 seconds.
6455

65-
# Example
66-
67-
# install latest gunicorn into system path
68-
python_pip "gunicorn"
69-
70-
# target a virtualenv
71-
python_pip "gunicorn" do
72-
virtualenv "/home/ubunut/my_ve"
73-
end
74-
75-
# install Django 1.1.4
76-
python_pip "django" do
77-
version "1.1.4"
78-
end
79-
80-
# use this provider with the core package resource
81-
package "django" do
82-
provider Chef::Provider::PythonPip
83-
end
84-
85-
`python_virtualenv`
86-
-------------------
87-
56+
#### Examples
57+
```ruby
58+
# install latest gunicorn into system path
59+
python_pip "gunicorn"
60+
61+
# target a virtualenv
62+
python_pip "gunicorn" do
63+
virtualenv "/home/ubunut/my_ve"
64+
end
65+
```
66+
67+
```ruby
68+
# install Django 1.1.4
69+
python_pip "django" do
70+
version "1.1.4"
71+
end
72+
```
73+
74+
```ruby
75+
# use this provider with the core package resource
76+
package "django" do
77+
provider Chef::Provider::PythonPip
78+
end
79+
```
80+
81+
### `python_virtualenv`
8882
[`virtualenv`](http://pypi.python.org/pypi/virtualenv) is a great tool that creates isolated python environments. Think of it as RVM without all those hipsters and tight jeans.
8983

90-
# Actions
91-
84+
#### Actions
9285
- :create: creates a new virtualenv
9386
- :delete: deletes an existing virtualenv
9487

95-
# Attribute Parameters
96-
88+
#### Attribute Parameters
9789
- path: name attribute. The path where the virtualenv will be created
9890
- interpreter: The Python interpreter to use. default is null (i.e. use whatever python the virtualenv command is using).
9991
- owner: The owner for the virtualenv
10092
- group: The group owner of the file (string or id)
10193
- options : Command line options (string)
10294

103-
# Example
104-
105-
# create a 2.6 virtualenv owned by ubuntu user
106-
python_virtualenv "/home/ubuntu/my_cool_ve" do
107-
owner "ubuntu"
108-
group "ubuntu"
109-
action :create
110-
end
111-
112-
# create a Python 2.4 virtualenv
113-
python_virtualenv "/home/ubuntu/my_old_ve" do
114-
interpreter "python2.4"
115-
owner "ubuntu"
116-
group "ubuntu"
117-
action :create
118-
end
119-
120-
# create a Python 2.6 virtualenv with access to the global packages owned by ubuntu user
121-
python_virtualenv "/home/ubuntu/my_old_ve" do
122-
owner "ubuntu"
123-
group "ubuntu"
124-
options "--system-site-packages"
125-
action :create
126-
end
95+
#### Examples
96+
```ruby
97+
# create a 2.6 virtualenv owned by ubuntu user
98+
python_virtualenv "/home/ubuntu/my_cool_ve" do
99+
owner "ubuntu"
100+
group "ubuntu"
101+
action :create
102+
end
103+
```
104+
105+
```ruby
106+
# create a Python 2.4 virtualenv
107+
python_virtualenv "/home/ubuntu/my_old_ve" do
108+
interpreter "python2.4"
109+
owner "ubuntu"
110+
group "ubuntu"
111+
action :create
112+
end
113+
```
114+
115+
```ruby
116+
# create a Python 2.6 virtualenv with access to the global packages owned by ubuntu user
117+
python_virtualenv "/home/ubuntu/my_old_ve" do
118+
owner "ubuntu"
119+
group "ubuntu"
120+
options "--system-site-packages"
121+
action :create
122+
end
123+
```
127124

128-
Usage
129-
=====
130-
131-
default
132-
-------
133125

126+
Usage
127+
-----
128+
### default
134129
Include default recipe in a run list, to get `python`, `pip` and `virtualenv`. Installs python by package or source depending on the platform.
135130

136-
package
137-
-------
138-
131+
### package
139132
Installs Python from packages.
140133

141-
source
142-
------
143-
134+
### source
144135
Installs Python from source.
145136

146-
pip
147-
---
148-
137+
### pip
149138
Installs `pip` from source.
150139

151-
virtualenv
152-
----------
140+
### virtualenv
153141

154142
Installs virtualenv using the `python_pip` resource.
155143

156-
License and Author
157-
==================
158144

159-
Author:: Seth Chisamore (<[email protected]>)
145+
License & Authors
146+
-----------------
147+
- Author:: Seth Chisamore (<[email protected]>)
160148

149+
```text
161150
Copyright:: 2011, Opscode, Inc
162151
163152
Licensed under the Apache License, Version 2.0 (the "License");
@@ -171,3 +160,4 @@ distributed under the License is distributed on an "AS IS" BASIS,
171160
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
172161
See the License for the specific language governing permissions and
173162
limitations under the License.
163+
```

0 commit comments

Comments
 (0)