Skip to main content
https://travis-ci.org/yakobu/patch-issue.svg?branch=master https://coveralls.io/repos/github/yakobu/patch-issue/badge.svg?branch=master https://badge.fury.io/py/patch-issue.svg Packagist

Patch manager for easy tracking with integration in jira.

Concept

We’ve all put patches over patches in our code, for various reasons:

  • Hot fixing a currently released version

  • Temporary place-holder

  • Or just because we felt like it - so we wouldn’t have to design some complex structure.

This is where patch-issue comes into play. We wanted to have a way of notifying the programmer that the current code segment is a part of a patch - using Jira issue tracking system and some kind of a logger. Then, later on, patch-issue will notify the programmer (in runtime) that the issue is closed and the programmer can remove the patch easily.

Important Note

We do not encourge the usage of patches in a code segment. This tool main purpose is to help programmers track their patches, so they won’t forget the patch in their code (long term wise).

How to install?

Simply run:

$ pip install patch-issue

And try to import:

import patch_issue

Ok, So how do I start?

First, you need to make a connection to Jira in your code, and just for that there is an awesome library called - yeah you guessed right - jira - [jira pypi link](https://pypi.org/project/jira/).

Here is how to make a simple connection: connection.py

from jira import JIRA
jira_connection = JIRA(server="http://jira/", basic_auth=("username", "password"))

Now you can make a new patch class (patches.py):

import logging

from patch_issue import JiraPatchIssue

from connection import jira_connection  # from previously made connection


class FixDBConnection(JiraPatchIssue):
   ISSUE_KEY = "APP-1"  # a must have class attribute
   DESCRIPTION = "Fixes db connection using a mocked password."
   WAY_TO_SOLVE = "Configure the right password."

fix_connection = FixDBConnection(jira=jira_connection,
    logger=logging)  # there is also a default logger

Now you can use your patch freely in your code:

import .config
from .db import DB

from patches import fix_connection  # import your patch instance

##################################################################

@fix_connection.patch_function  # use patch as a function decorator
def new_connection():
    return DB.make_connection("user", "password")

new_connection()

##################################################################

usename = "someuser"
password = config.get_password()

with fix_connection.patch:  # use patch as a context manager
   password = "1234"

db = DB.make_connection(username, password)

Now, when your code reaches to the patches, a message will be logged in your logger! You will never miss your patches again!

Metadata

Release files for patch-issue 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for patch-issue 1.0.0
File Size Uploaded
patch_issue-1.0.0.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for patch-issue 1.0.0
File Interpreter ABI Platform
patch_issue-1.0.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 9.6 kB

Release files / patch_issue-1.0.0.tar.gz

Download URL patch_issue-1.0.0.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c454e94348dfee1bbb7d4ee179597ed6a37297c8bcbe57521d92cb38bb06aae7
BLAKE2b-256 checksum
How to use checksums
7614e928666e5fd124b0550608d791bf643f5ec1170b39a070b5bf8da2ff95fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.14

Release files / patch_issue-1.0.0-py2.py3-none-any.whl

Download URL patch_issue-1.0.0-py2.py3-none-any.whl
Size 5.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
a7831fe12ae7c0b0df6b6d2899a0722a1a13bca90f43de6e556c93827d155822
BLAKE2b-256 checksum
How to use checksums
e2189e59a46f2db0bee9975fa8f2f9b3f0e13e09151fd4f26bcdb278ffd1018d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.14

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.8.1

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.6.0

1 release file

0.4.0

1 release file

0.2.0

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page