Asynchronous library of Jenkins API based on aiohttp
Project description
Async Python client for Jenkins <https://jenkins.io>
_
Asynchronous python library of Jenkins API endpoints based on aiohttp. Initial version of aiojenkins. Public API is still unstable.
Status
|Build status| |Coverage status| |Version status| |Downloads status|
.. |Build Status| image:: https://github.com/pbelskiy/aiojenkins/workflows/Tests/badge.svg .. |Coverage status| image:: https://img.shields.io/coveralls/github/pbelskiy/aiojenkins?label=Coverage .. |Version status| image:: https://img.shields.io/pypi/pyversions/aiojenkins?label=Python .. |Downloads status| image:: https://img.shields.io/pypi/dm/aiojenkins?color=1&label=Downloads
Installation
::
pip install aiojenkins
Documentation
Read the Docs <https://aiojenkins.readthedocs.io/en/latest/>
_
Usage
Start new build:
.. code:: python
import asyncio
import aiojenkins
jenkins = aiojenkins.Jenkins('http://your_server/jenkins', 'login', 'password')
async def example():
await jenkins.builds.start('job_name', dict(parameter='test'))
loop = asyncio.get_event_loop()
try:
loop.run_until_complete(example())
finally:
loop.run_until_complete(jenkins.close())
loop.close()
Please look at tests directory for more examples. <https://github.com/pbelskiy/aiojenkins/tree/master/tests>
_
Testing
Currently tests aren't using any mocking. I am testing locally with dockerized LTS Jenkins ver. 2.222.3
Prerequisites: docker, pytest pytest-cov pytest-asyncio
::
docker run -d --name jenkins --restart always -p 8080:8080 jenkins/jenkins:lts
docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword
python3 -m pytest -v --cov=aiojenkins --cov-report=term --cov-report=html
Contributing
Feel free to PR
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for aiojenkins-0.6.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 181f15830cc9c0d916b9bff0e5eb6c4587b3f79273f6b24345daa7919c0c3a3c |
|
MD5 | 9d8f483e64cf44d4f0f4173ec144863d |
|
BLAKE2b-256 | baf621b889efbb78073b183d18bce1a865b9ec27dcf55b5a7eab1d43f5094792 |