This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

I used to write small bash scripts that created the virtualenv and executed the \(python setup.py\) and \(nosetests\) commands using one of several Python versions I keep installed on my build machines. But bash scripts aren’t supported on Windows, so I want to write this script in Python instead.

\(cish\) is a set of utility functions to write bash-like python scripts that deal with several installed python interpreters.

Let’s get going!

import cish
cish.rm("build")
cish.default.pip("install", "nose")
cish.default.python("setup.py", "build")
cish.default.nosetests()

This will delete the \(build\) directory if it exists with all content, install \(nose\), and build and test the package.

\(default\) is an ‘environment’ which consists of a python interpreter, library path, and utilities such as \(pip\). \(default\) is the environent of the interpreter executing the script itself.

We can also use a different interpreter:

import cish
env = cish.from_interpreter("path/to/python")
env.python("setup.py", "build")
env.nosetests()

The installation location of the python interpreters is often dependent on the test machine. We can place a simple JSON file in one of several locations, for example in \(/etc/cish.json\), to specifiy their location:

{
    "2.6.9": "/opt/python2.6.9/bin/python",
    "2.7.8": "/opt/python2.7.8/bin/python"
}

We can then choose the interpeter in our script using, say, an environment variable set by jenkins:

import cish, os
env = cish.from_config()[os.environ["PYTHON_VERSION"]]
env.python("setup.py", "build")

\(virtualenv\) is very easy too:

import cish
venv = cish.default.virtualenv("optional/location")
venv.pip("install", "package_to_install_inside_virtualenv")

Bug Reports and other contributions

This project is hosted here cish github page.

Alternatives

You might want to look at sh a cool library to run executables without dealing with \(subprocess\) directly. It has a far wider scope than \(cish\) but lacks the abstraction we offer for different python installations and OS specific file extensions and installation locations.

Release History

Release History

0.2.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
cish-0.2.1.zip (15.3 kB) Copy SHA256 Checksum SHA256 Source Jan 31, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting