Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 537346 - dev-python/jenkinsapi - A Python API for accessing resources on a Jenkins continuous-integration server
Summary: dev-python/jenkinsapi - A Python API for accessing resources on a Jenkins con...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Default Assignee for New Packages
URL: https://pypi.python.org/pypi/jenkinsapi
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-22 12:33 UTC by Tomáš Mózes
Modified: 2015-01-28 08:29 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
jenkinsapi-0.2.26.ebuild (jenkinsapi-0.2.26.ebuild,613 bytes, text/plain)
2015-01-23 10:29 UTC, Tomáš Mózes
Details
jenkinsapi-0.2.26.ebuild (jenkinsapi-0.2.26.ebuild,810 bytes, text/plain)
2015-01-27 09:24 UTC, Tomáš Mózes
Details
jenkinsapi-0.2.26.ebuild (jenkinsapi-0.2.26.ebuild,1.00 KB, text/plain)
2015-01-27 14:42 UTC, Tomáš Mózes
Details
jenkinsapi-0.2.26.ebuild (jenkinsapi-0.2.26.ebuild,1.00 KB, text/plain)
2015-01-27 14:42 UTC, Tomáš Mózes
Details
use_local_jenkins_war.patch (use_local_jenkins_war.patch,564 bytes, patch)
2015-01-27 14:43 UTC, Tomáš Mózes
Details | Diff
jenkinsapi-test.log (jenkinsapi-test.log,275.99 KB, text/x-log)
2015-01-27 14:57 UTC, Tomáš Mózes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomáš Mózes 2015-01-22 12:33:36 UTC
Jenkins (and It's predecessor Hudson) are useful projects for automating common development tasks (e.g. unit-testing, production batches) - but they are somewhat Java-centric. Thankfully the designers have provided an excellent and complete REST interface. This library wraps up that interface as more conventional python objects in order to make many Jenkins oriented tasks easier to automate.

This library can help you:
    Query the test-results of a completed build
    Get objects representing the latest builds of a job
    Search for artefacts by simple criteria
    Block until jobs are complete
    Install artefacts to custom-specified directory structures
    username/password auth support for jenkins instances with auth turned on
    Ability to search for builds by subversion revision
    Ability to add/remove/query Jenkins slaves
    Ability to add/remove/modify Jenkins views
Comment 1 Ian Delaney (RETIRED) gentoo-dev 2015-01-23 03:44:14 UTC
Well I could add this inside a half hour if I set my mind to it and all went smoothly.  However, generally requests like this come with an ebuild submitted here with the bug. In this case nothing.
What are your expectations here?  Team or herd python has more or less a closed shop policy on adding new ebuilds to team or herd python.  Already too many packages and such.  It can though be added via other means.  Ball in your court as to selecting one of those paths.
Comment 2 Tomáš Mózes 2015-01-23 10:29:19 UTC
Created attachment 394698 [details]
jenkinsapi-0.2.26.ebuild
Comment 3 Ian Delaney (RETIRED) gentoo-dev 2015-01-24 06:57:55 UTC
good basic ebuild.

1 PYTHON_COMPAT=( python{2_7,3_3} )
add 3_4 and pypy.  You only need have py3.4 emerged.  Team python has been adding py3.4 support solidly since it was released. Addition of pypy is optional seeing its user base is quite a mystery. I have thrown it in

2. ALL deps are in dev-python/.  ALL deps inherit a new eclass, therefore ALL deps need have [${PYTHON_USEDEP}] added in the form of a suffix.
e.g. dev-python/nose[${PYTHON_USEDEP}]

3. While there are cases where a dep can be listed without [${PYTHON_USEDEP}], they are rare and don't apply here.

4. See work/jenkinsapi-0.2.26/jenkinsapi.egg-info/requires.txt and 
work/jenkinsapi-0.2.26/setup.py.  In both you will find version borders set.
So we end up with

4. DEPEND="dev-python/pytz
	dev-python/requests
becomes
RDEPEND=">=dev-python/pytz-2014.4[${PYTHON_USEDEP}]
        >=dev-python/requests-2.3.0[${PYTHON_USEDEP}]

5. Note in setup.py.
from setuptools import setup.

This means setuptools is required in DEPEND, so we need

DEPEND=dev-python/setuptools[${PYTHON_USEDEP}]

6. the test IUSE flag belongs under DEPEND and the tests require all packages of RDEPEND.

7. dev-python/mock is a special case. I shall just hold off with that for now since there is more than enough here already.

python_test() {
        esetup.py test
}
is fully correct ONCE the required deps are emerged.

~/improvise/dev-python/jenkinsapi $ ebuild jenkinsapi-0.2.26.ebuild clean test

yields

Ran 0 tests in 2.796s \ OK
Ran 0 tests in 0.141s \ OK
Ran 0 tests in 0.127s \ OK
Ran 0 tests in 0.906s \ OK

over the 4 impls.

So, good start. See if you can attach a revised ebuild that matches or equates to the one I have.
This would be added with you as proxy maintainer, with or without
<herd>proxy-maintainers</herd>    listed in metadata.xml.
It's a fairly basic package -> ebuild and there are dozens of its ilk under dev-python from which you can model the ebuild.

No rush. Await reply
Comment 4 Tomáš Mózes 2015-01-27 09:24:41 UTC
Created attachment 394984 [details]
jenkinsapi-0.2.26.ebuild

Explicit deps, Python 3.4 + pypy support.
Comment 5 Tomáš Mózes 2015-01-27 09:43:15 UTC
- from $URL: 
the project have been tested and working on Python 2.6, 2.7 and 3.3

Do we still add Python 3.4 / PyPy?

- dev-python/requests lowest version in portage is 2.3.0, do we still need to add dep on that specific version?
Comment 6 Ian Delaney (RETIRED) gentoo-dev 2015-01-27 11:51:01 UTC
(In reply to Tomas Mozes from comment #5)
> - from $URL: 
> the project have been tested and working on Python 2.6, 2.7 and 3.3
> 
> Do we still add Python 3.4 / PyPy?
> 
yes. I have tested with both and as long as they work you add.

> - dev-python/requests lowest version in portage is 2.3.0, do we still need
> to add dep on that specific version?

yes

PYTHON_COMPAT correct.
KEYWORDS="~amd64"  just add x86, allowed for running amd64 since amd64 multilib covers x86 by its nature

DEPEND="${RDEPEND}
kind of wrong.  Point is you'll find this in most packages however it's technically wrong.  It doesn't 'break' an ebuild but it's become so commonly accepted it's mostly just blindly accepted.
Here's the litmus test. Unmerge requests and pytz and then run
/path/to/dev-python/jenkinsapi/ $ ebuild jenkinsapi-0.2.26.ebuild clean compile
yields

warning: build_py: byte-compiling is disabled, skipping.

>>> Source compiled.

So this proves they are NOT required for DEPEND. However, they are required to run the tests. You will therefore find most of my ebuilds have

test? ( ${RDEPEND}
Comment 7 Tomáš Mózes 2015-01-27 14:42:11 UTC
Created attachment 395008 [details]
jenkinsapi-0.2.26.ebuild

Move RDEPS to tests, grab from github to include tests
Comment 8 Tomáš Mózes 2015-01-27 14:42:43 UTC
Created attachment 395010 [details]
jenkinsapi-0.2.26.ebuild

Obsolete old versions
Comment 9 Tomáš Mózes 2015-01-27 14:43:14 UTC
Created attachment 395012 [details, diff]
use_local_jenkins_war.patch
Comment 10 Tomáš Mózes 2015-01-27 14:57:45 UTC
Created attachment 395014 [details]
jenkinsapi-test.log

Now it runs the tests against a Jenkins instance:
Ran 185 tests in 274.197s
Ran 185 tests in 264.206s
Ran 185 tests in 259.996s
Ran 185 tests in 260.409s
Comment 11 Ian Delaney (RETIRED) gentoo-dev 2015-01-28 02:48:32 UTC
I have run tested and confirmed.  This is very good. I'll add it later.
Comment 12 Ian Delaney (RETIRED) gentoo-dev 2015-01-28 08:29:15 UTC
  28 Jan 2015; Ian Delaney <idella4@gentoo.org> +files/local_jenkins_war.patch,
  +jenkinsapi-0.2.26.ebuild, +metadata.xml:
  new ebuild, written by maintainer, entered under proxy-maintainers herd, fully
  tested and shored up to see test phase working fully, closes bug #537346