apache/spark — pull request #464 by prabinb (2014-04-21 11:25:33+00:00)
Title: [SPARK-1267]Adding a pip installer setup file for PySpark. 

Following changes are made in this pull request,
1) A pip installer python/setup.py file is added.
2) A new file is added, pyspark/pyspark_version.py for maintaining PySpark version. This needs to be updated, whenever a new version of PySpark is released.
3) Changed pyspark/__init__.py to cross validate SPARK_HOME variable and pyspark & spark version mismatch.

This PySpark build distribution has to be registered and uploaded to PyPi (python package index) for all the releases of PySpark. (somebody needs to maintain it)
python setup.py register
python setup.py sdist upload
More details on registering and uploading a package can be found here, https://docs.python.org/2/distutils/packageindex.html

Once the package is uploaded, users will be able to install PySpark by running,
pip install pyspark

Following validations are added to the import, (all suggestions to improve it are welcome)
1) For using this package, the user should set SPARK_HOME environment variable to it's spark installation directory, else the import fails.
2) The spark version in SPARK_HOME/pom.xml file (...spark version...) should match the pyspark version (python/pyspark/pyspark_version.py), else the import fails.