Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python equivalent of a ruby Gem file

So I have a ruby sinatra program that runs on a server and I have a Gem file to ensure all its dependancies are installed. However it calls a python script which has its own python module dependancies. Thus when it deploy to server all the ruby gems dependancies are fine but not they python dependancies.

Is there a python equivalent of a Gem file? Or is there a way for me to install the python modules via the Gem file?

buildr has been suggested to me but that seems to be for a java based program.

Any help would be much appreciated.

like image 299
Richard Avatar asked Oct 09 '13 18:10

Richard


People also ask

What is a Ruby Gem file?

A Gemfile is a file that is created to describe the gem dependencies required to run a Ruby program. A Gemfile should always be placed in the root of the project directory.

How do you create a gem file?

A gemfile is automatically created when you start a new rails application. type rails new appName and then it will be generated automatically. It will also be populated with some gems.

Does RubyGems come with Ruby?

Ruby comes with RubyGems by default since version 1.9, previous Ruby versions require RubyGems to be installed by hand.

How do I get RubyGems?

Open up the 'Software Center' app from your launcher and type in `RubyGems` without quotes into the application search box at the top right, and press [enter]. RubyGems then can be installed by just clicking on the button labeled 'Install', thats it.


1 Answers

Installing packages (gem install)

pip install mypackage

Dependencies and bulk-install(gemfile)

Use pip's requirements.txt files. It's a txt document of the required packages with any version contraints. Example:

django==1.5
fabric>1.2
South==0.7.3

You would then install those dependencies with:

$ pip install -r requirements.txt

You can then execute those files after install. Example:

$ pip install gunicorn
$ gunicorn -h

Package gems for install. For that, there is pip bundle and pip zip/unzip

That's the only way I know to bundle and deploy dependencies with python. Hope that helps.

like image 105
Echoic Avatar answered Sep 21 '22 22:09

Echoic