I know about virtualenv and pip. But these are a bit different from bundler/carton.
For instance:
- pip writes the absolute path to shebang or activate script
- pip doesn't have the
exec
sub command (bundle exec bar
) - virtualenv copies the Python interpreter to a local directory
Does every Python developer use virtualenv/pip? Are there other package management tools for Python?
I'd say Shovel is worth a look. It was developed specifically to the the Pythonish version of Rake. There's not a ton of commit activity on the project, but seems stable and useful.
There is a clone pbundler.
The version that is currently in pip simply reads the
requirements.txt
file you already have, but is much out of date. It's also not totally equivalent: it insists on making avirtualenv
. Bundler, I notice, only installs what packages are missing, and gives you the option of giving your sudo password to install into your system dirs or of restarting, which doesn't seem to be a feature of pbundler.However, the version on git is an almost complete rewrite to be much closer to Bundler's behaviour... including having a "Cheesefile" and now not supporting requirements.txt. This is unfortunate, since requirements.txt is the de facto standard in pythonland, and there's even Offical BDFL-stamped work to standardize it. When that comes into force, you can be sure that something like pbundler will become the de facto standard. Alas, nothing quite stable yet that I know of (but I would love to be proven wrong).
From what i've read about bundler — pip without virtualenv should work just fine for you. You can think of it as something between regular gem command and bundler. Common things that you can do with pip:
Installing packages (gem install)
Dependencies and bulk-install (gemfile)
Probably the easiest way is to use pip's requirements.txt files. Basically it's just a plain list of required packages with possible version constraints. It might look something like:
Later when you'd want to install those dependencies you would do:
A simple way to see all your current packages in requirements-file syntax is to do:
You can read more about it here.
Execution (bundler exec)
All python packages that come with executable files are usually directly available after install (unless you have custom setup or it's a special package). For example:
Package gems for install from cache (bundler package)
There is
pip bundle
andpip zip/unzip
. But i'm not sure if many people use it.p.s. If you do care about environment isolation you can also use virtualenv together with pip (they are close friends and work perfectly together). By default pip installs packages system-wide which might require admin rights.
I wrote one — https://github.com/Deepwalker/pundler . On PIP its
pundle
, name was already taken.It uses
requirements(_\w+)?.txt
files as your desired dependencies and createsfrozen(_\w+)?.txt
files with frozen versions.About
(_\w+)?
thing — this is envs. You can create requirements_test.txt and then usePUNDLEENV=test
to use this deps in your run with requirements.txt ones alongside.And about virtualenv – you need not one, its what pundle takes from bundler in first head.
You can use pipenv, which has similar interface with bundler.
Pipenv creates virtualenv automatically and installs dependencies from
Pipfile
orPipfile.lock
.You can run command with virtualenv scope like
bundle exec
.No, no all the developers use virtualenv and/or pip, but many developers use/prefer these tools
And now, for package development tools and diferent environments that is your real question. Exist any other tools like Buildout (http://www.buildout.org/en/latest/) for the same purpose, isolate your environment Python build system for every project that you manage. For some time I use this, but not now.
Independent environments per project, in Python are a little different that the same situation in Ruby. In my case i use pyenv (https://github.com/yyuu/pyenv) that is something like rbenv but, for Python. diferent versions of python and virtualenvs per project, and, in this isolated environments, i can use pip or easy-install (if is needed).