File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 27
27
pip_requirements ' /opt/myapp/requirements.txt'
28
28
```
29
29
30
+ ## Installing a Package From a URI
31
+
32
+ While using ` python_package 'git+https://github.com/example/mypackage.git' ` will
33
+ sometimes work, this approach is not recommended. Unfortunately pip's support
34
+ for installing directly from URI sources is limited and cannot support the API
35
+ used for the ` python_package ` resource. You can run the install either directly
36
+ from the URI or through an intermediary ` git ` resource:
37
+
38
+ ``` ruby
39
+ # Will re-install on every converge unless you add a not_if/only_if.
40
+ python_execute ' -m pip install git+https://github.com/example/mypackage.git'
41
+
42
+ # Will only re-install when the git repository updates.
43
+ python_execute ' install mypackage' do
44
+ action :nothing
45
+ command ' -m pip install .'
46
+ cwd ' /opt/mypackage'
47
+ end
48
+ git ' /opt/mypackage' do
49
+ repository ' https://github.com/example/mypackage.git'
50
+ notifies :run , ' python_execute[install mypackage]' , :immediately
51
+ end
52
+ ```
53
+
30
54
## Supported Python Versions
31
55
32
56
This cookbook can install at least Python 2.7, Python 3, and PyPy on all
You can’t perform that action at this time.
0 commit comments