pre release tidy-ups and version bump
authorSalim Fadhley <sal@stodge.org>
Thu, 10 Jul 2014 23:07:20 +0000 (00:07 +0100)
committerSalim Fadhley <sal@stodge.org>
Thu, 10 Jul 2014 23:07:20 +0000 (00:07 +0100)
.gitignore
README.rst
jenkinsapi/build.py
jenkinsapi_tests/systests/test_queue.py
setup.py

index ea9598643010575fafe83d2ddff356d04b23a958..38191413a530bab98344720014777fd5325c3c19 100644 (file)
@@ -16,5 +16,6 @@ coverage*/
 bin/
 include/
 lib/
-nose-1.3.0-py2.7.egg/
+*.egg
+
 
index da545e0b202321160b5baeeea672fe08ff5126ed..16f339803a19971c28d395e30f20e87dd5c3befa 100644 (file)
@@ -10,6 +10,9 @@ jenkinsapi
 .. image:: https://pypip.in/d/jenkinsapi/badge.png
         :target: https://crate.io/packages/jenkinsapi/
 
+.. image:: https://github.com/salimfadhley/jenkinsapi.git
+        :target: https://landscape.io/github/salimfadhley/jenkinsapi
+
 About this library
 -------------------
 
index a0a2d7a1a467695bc7562ffc17cfe99786206c5d..122616f3018b6bc07cb0eb4cbc9989b289e326de 100644 (file)
@@ -77,7 +77,7 @@ class Build(JenkinsBase):
         return getattr(self, '_get_%s_rev_branch' % vcs, lambda: None)()
 
     def _get_svn_rev(self):
-        warnings.warn("This untested function may soon be removed from Jenkinsapi.")
+        warnings.warn("This untested function may soon be removed from Jenkinsapi (get_svn_rev).")
         maxRevision = 0
         for repoPathSet in self._data["changeSet"]["revisions"]:
             maxRevision = max(repoPathSet["revision"], maxRevision)
@@ -92,7 +92,7 @@ class Build(JenkinsBase):
         return _actions[0]["lastBuiltRevision"]["SHA1"]
 
     def _get_hg_rev(self):
-        warnings.warn("This untested function may soon be removed from Jenkinsapi.")
+        warnings.warn("This untested function may soon be removed from Jenkinsapi (_get_hg_rev).")
         return [x['mercurialNodeName'] for x in self._data['actions'] if 'mercurialNodeName' in x][0]
 
     def _get_svn_rev_branch(self):
@@ -169,7 +169,6 @@ class Build(JenkinsBase):
         Get the master job name if it exist, None otherwise
         :return: String or None
         """
-        warnings.warn("This untested function may soon be removed from Jenkinsapi.")
         try:
             return self.get_actions()['parameters'][0]['value']
         except KeyError:
@@ -180,7 +179,7 @@ class Build(JenkinsBase):
         Get the master job object if it exist, None otherwise
         :return: Job or None
         """
-        warnings.warn("This untested function may soon be removed from Jenkinsapi.")
+        warnings.warn("This untested function may soon be removed from Jenkinsapi (get_master_job).")
         if self.get_master_job_name():
             return self.get_jenkins_obj().get_job(self.get_master_job_name())
         else:
@@ -191,7 +190,7 @@ class Build(JenkinsBase):
         Get the master build number if it exist, None otherwise
         :return: int or None
         """
-        warnings.warn("This untested function may soon be removed from Jenkinsapi.")
+        warnings.warn("This untested function may soon be removed from Jenkinsapi (get_master_build_number).")
         try:
             return int(self.get_actions()['parameters'][1]['value'])
         except KeyError:
@@ -202,7 +201,7 @@ class Build(JenkinsBase):
         Get the master build if it exist, None otherwise
         :return Build or None
         """
-        warnings.warn("This untested function may soon be removed from Jenkinsapi.")
+        warnings.warn("This untested function may soon be removed from Jenkinsapi (get_master_build).")
         master_job = self.get_master_job()
         if master_job:
             return master_job.get_build(self.get_master_build_number())
@@ -214,7 +213,7 @@ class Build(JenkinsBase):
         Get the downstream jobs for this build
         :return List of jobs or None
         """
-        warnings.warn("This untested function may soon be removed from Jenkinsapi.")
+        warnings.warn("This untested function may soon be removed from Jenkinsapi (get_downstream_jobs).")
         downstream_jobs = []
         try:
             for job_name in self.get_downstream_job_names():
@@ -228,18 +227,6 @@ class Build(JenkinsBase):
         Get the downstream job names for this build
         :return List of string or None
         """
-# <<<<<<< HEAD
-#         downstream_jobs_names = self.job.get_downstream_job_names()
-#         fingerprint_data = self.get_data("%s?depth=2&tree=fingerprint[usage[name]]" \
-#                                            % self.python_api_url(self.baseurl))
-#         try:
-#             fingerprints = fingerprint_data['fingerprint'][0]
-#             return [
-#                 f['name']
-#                 for f in fingerprints['usage']
-#                 if f['name'] in downstream_jobs_names
-#             ]
-# =======
         downstream_job_names = self.job.get_downstream_job_names()
         downstream_names = []
         try:
@@ -249,7 +236,6 @@ class Build(JenkinsBase):
                     if job_usage['name'] in downstream_job_names:
                         downstream_names.append(job_usage['name'])
             return downstream_names
-# >>>>>>> unstable
         except (IndexError, KeyError):
             return []
 
@@ -258,18 +244,6 @@ class Build(JenkinsBase):
         Get the downstream builds for this build
         :return List of Build or None
         """
-# <<<<<<< HEAD
-#         downstream_jobs_names = set(self.job.get_downstream_job_names())
-#         msg = "%s?depth=2&tree=fingerprint[usage[name,ranges[ranges[end,start]]]]"
-#         fingerprint_data = self.get_data(msg % self.python_api_url(self.baseurl))
-#         try:
-#             fingerprints = fingerprint_data['fingerprint'][0]
-#             return [
-#                 self.get_jenkins_obj().get_job(f['name']).get_build(f['ranges']['ranges'][0]['start'])
-#                 for f in fingerprints['usage']
-#                 if f['name'] in downstream_jobs_names
-#             ]
-# =======
         downstream_job_names = self.get_downstream_job_names()
         downstream_builds = []
         try:
@@ -283,7 +257,6 @@ class Build(JenkinsBase):
                                                   job_range['end']):
                                 downstream_builds.append(job.get_build(build_id))
             return downstream_builds
-# >>>>>>> unstable
         except (IndexError, KeyError):
             return []
 
index c51c6a2aa8566b7ca6cabe1c78d6eec23553c9e4..de95684274dc024d438c4a048135efbbef3f97c1 100644 (file)
@@ -62,6 +62,7 @@ class TestQueue(BaseSystemTest):
             time.sleep(1)
 
         j.get_first_build().stop()
+        time.sleep(1)
         self.assertFalse(j.is_queued_or_running())
 
 
index 37cc46054b81977f11146da76e982aeee921c327..dfe19a630949a453a969afdcad911773c9828116 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@ from setuptools import setup
 import os
 
 PROJECT_ROOT, _ = os.path.split(__file__)
-REVISION = '0.2.18'
+REVISION = '0.2.20'
 PROJECT_NAME = 'JenkinsAPI'
 PROJECT_AUTHORS = "Salim Fadhley, Aleksey Maksimov"
 # Please see readme.rst for a complete list of contributors
@@ -12,7 +12,7 @@ SHORT_DESCRIPTION = 'A Python API for accessing resources on a Jenkins continuou
 
 try:
     DESCRIPTION = open(os.path.join(PROJECT_ROOT, "README.rst")).read()
-except IOError:
+except IOError, _:
     DESCRIPTION = SHORT_DESCRIPTION
 
 GLOBAL_ENTRY_POINTS = {
@@ -29,7 +29,7 @@ setup(
     include_package_data=False,
     install_requires=['requests>=1.2.3', 'pytz>=2013b'],
     test_suite='nose.collector',
-    tests_require=['mock', 'nose', 'coverage', 'unittest2'],
+    tests_require=['mock', 'nose', 'coverage'],
     entry_points=GLOBAL_ENTRY_POINTS,
     url=PROJECT_URL,
     description=SHORT_DESCRIPTION,