summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kanevskiy <alexander.kanevskiy@intel.com>2013-08-12 15:13:02 +0300
committerAlexander Kanevskiy <alexander.kanevskiy@intel.com>2013-08-12 15:13:02 +0300
commitcef2aa149afc53031d55dc050e3155e4302396e2 (patch)
tree45b1080b93c2d4ae54bf9bd8fbeb69dde86852ef
parentdab016e20d68d348912c2c0ae507ef40370de911 (diff)
downloadgerritrest-cef2aa149afc53031d55dc050e3155e4302396e2.tar.gz
gerritrest-cef2aa149afc53031d55dc050e3155e4302396e2.tar.bz2
gerritrest-cef2aa149afc53031d55dc050e3155e4302396e2.zip
Minimal setup.py and README
-rw-r--r--README.rst28
-rw-r--r--setup.py38
2 files changed, 66 insertions, 0 deletions
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..260cda5
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,28 @@
+==========
+GerritREST
+==========
+
+GerritREST is a simple library to manipulate with Gerrit objects via REST API.
+
+Quick start
+-----------
+
+1. Define URL of your server
+
+ gerrit_url = "https://mygerrit.example.com/gerrit/"
+
+2. Get credentials from ~/.netrc for that URL
+
+ import netrc
+ user, _, pass = netrc.netrc().hosts[urlparse.urlparse(gerrit_url).netloc]
+
+3. Create GerritREST instance with those parameters
+
+ from gerritrest import GerritREST
+ gerrit=GerritREST(gerrit_url, user, pass)
+
+4. Get list of projects with descriptions and parent information from Gerrit
+
+ projects = gerrit.get_projects(description=True, parents=True)
+
+5. Use obtained information for something useful :)
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..e89ed2d
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+# -*- coding: UTF-8 -*-
+# vim: sw=4 ts=4 expandtab ai
+
+import os
+from setuptools import setup, find_packages
+
+README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
+
+# allow setup.py to be run from any path
+os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
+
+setup (
+ name = "gerritrest",
+ version = "0.1.0",
+ packages = ['gerritrest'],
+ # include_package_data=True,
+ license = "GPLv2",
+ description = "Access to Gerrit 2.6+ REST APIs",
+ long_description = README,
+ # url = "http://",
+ author = "Alexander Kanevskiy",
+ author_email = "alexander.kanevskiy@intel.com",
+ keywords = "python gerrit REST api",
+ platforms="Python 2.6 and later.",
+ classifiers=[
+ "Development Status :: 3 - Alpha",
+ "Environment :: Web Environment",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
+ "Operating System :: OS Independent",
+ "Programming Language :: Python :: 2.6",
+ "Programming Language :: Python :: 2.7",
+ 'Topic :: Internet :: WWW/HTTP',
+ "Topic :: Software Development :: Libraries :: Python Modules"
+ ]
+ )
+