pypatch


Namepypatch JSON
Version 1.0.2 PyPI version JSON
download
home_pagehttp://sitkatech.com
SummaryUtility to apply unified diff patches to installed python modules.
upload_time2024-10-08 14:12:01
maintainerNone
docs_urlNone
authorSitka Technology Group
requires_pythonNone
licenseMIT
keywords build tool patch unified diff
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            PyPatch
=======

Automatically apply patches to third-party libraries as part of your build.

Now and again, a specific fix is needed for a python package that isn't available from the vendor/community.
This project was created to allow a way for us to patch specific python modules during the build process.

PyPatch is a command wrapper based around Anatoly Techtonik's patch.py utility. PyPatch allows you to patch python
libraries using a unified diff file. Specifically, PyPatch is meant to be used in automatic build processes where you
have a 3rd party library that needs to be patched when being deployed. Instead of maintaining your own separate version
of the library, you can just issue your patch during the build process.

*****
Usage
*****

    ``pypatch apply [libarary.package] custom_diff.patch``

As a part of the work flow:
    ``c:\project\pip install django``

    ``c:\project\pip install pypatch``

    ``c:\project\pypatch apply django.contrib.auth c:\project\patches\my_auth_fix.patch``

************
How it works
************
PyPatch applies patches to files relative to the root directory of the named package. So it does have to be installed into the target environment.

For example, if the django package was installed to "C:\Python27\Lib\site-packages\django" and you needed to patch the auth contrib package (django.contrib.auth), your command might look like

    ``pypatch apply django.contrib.auth c:\project\patches\my_auth_fix.patch"``

and the files named in my_auth_fix.patch would use relative pathing from the package directory:
    
    ``--- models.py    2013-05-06 15:12:14.212220100 -0700``

    ``+++ models.py    2013-05-06 14:36:20.535220100 -0700``

If you used

    ```pypatch apply django.contrib c:\project\patches\my_auth_fix.patch```

instead, your diff patch would read

    ``--- auth/models.py	2013-05-06 15:12:14.212220100 -0700``

    ``+++ auth/models.py	2013-05-06 14:36:20.535220100 -0700``

*****
Build
*****
To build the distributable python package, run 'sdist' from the Project Root Directory.
Recommended: setting the output directory to our Libraries folder

    ``sdist --dist-dir="C:\outputdir"``

This will build the zipped python package that can be installed via pip or easy_install

*****
Other
*****

Information on the Unified Diff format can be found at     https://www.gnu.org/software/diffutils/manual/html_node/Unified-Format.html#Unified-Format

The MIT License (MIT)

Copyright (c) 2013 sitkatech

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

            

Raw data

            {
    "_id": null,
    "home_page": "http://sitkatech.com",
    "name": "pypatch",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "build tool patch unified diff",
    "author": "Sitka Technology Group",
    "author_email": "info@sitkatech.com",
    "download_url": "https://files.pythonhosted.org/packages/7e/1c/6379e3feb25bd1cc70320ffa2f6410f799a8348b0e385d04b3bbdc19246f/pypatch-1.0.2.tar.gz",
    "platform": null,
    "description": "PyPatch\n=======\n\nAutomatically apply patches to third-party libraries as part of your build.\n\nNow and again, a specific fix is needed for a python package that isn't available from the vendor/community.\nThis project was created to allow a way for us to patch specific python modules during the build process.\n\nPyPatch is a command wrapper based around Anatoly Techtonik's patch.py utility. PyPatch allows you to patch python\nlibraries using a unified diff file. Specifically, PyPatch is meant to be used in automatic build processes where you\nhave a 3rd party library that needs to be patched when being deployed. Instead of maintaining your own separate version\nof the library, you can just issue your patch during the build process.\n\n*****\nUsage\n*****\n\n    ``pypatch apply [libarary.package] custom_diff.patch``\n\nAs a part of the work flow:\n    ``c:\\project\\pip install django``\n\n    ``c:\\project\\pip install pypatch``\n\n    ``c:\\project\\pypatch apply django.contrib.auth c:\\project\\patches\\my_auth_fix.patch``\n\n************\nHow it works\n************\nPyPatch applies patches to files relative to the root directory of the named package. So it does have to be installed into the target environment.\n\nFor example, if the django package was installed to \"C:\\Python27\\Lib\\site-packages\\django\" and you needed to patch the auth contrib package (django.contrib.auth), your command might look like\n\n    ``pypatch apply django.contrib.auth c:\\project\\patches\\my_auth_fix.patch\"``\n\nand the files named in my_auth_fix.patch would use relative pathing from the package directory:\n    \n    ``--- models.py    2013-05-06 15:12:14.212220100 -0700``\n\n    ``+++ models.py    2013-05-06 14:36:20.535220100 -0700``\n\nIf you used\n\n    ```pypatch apply django.contrib c:\\project\\patches\\my_auth_fix.patch```\n\ninstead, your diff patch would read\n\n    ``--- auth/models.py\t2013-05-06 15:12:14.212220100 -0700``\n\n    ``+++ auth/models.py\t2013-05-06 14:36:20.535220100 -0700``\n\n*****\nBuild\n*****\nTo build the distributable python package, run 'sdist' from the Project Root Directory.\nRecommended: setting the output directory to our Libraries folder\n\n    ``sdist --dist-dir=\"C:\\outputdir\"``\n\nThis will build the zipped python package that can be installed via pip or easy_install\n\n*****\nOther\n*****\n\nInformation on the Unified Diff format can be found at     https://www.gnu.org/software/diffutils/manual/html_node/Unified-Format.html#Unified-Format\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 sitkatech\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Utility to apply unified diff patches to installed python modules.",
    "version": "1.0.2",
    "project_urls": {
        "Homepage": "http://sitkatech.com"
    },
    "split_keywords": [
        "build",
        "tool",
        "patch",
        "unified",
        "diff"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7e1c6379e3feb25bd1cc70320ffa2f6410f799a8348b0e385d04b3bbdc19246f",
                "md5": "b68aaa3d84882a5f43c8cb8ec971ca52",
                "sha256": "13e8c40a6e6ae9dbd84bba73f1e15a13c078f153e771f7c8c43429ce5062dc93"
            },
            "downloads": -1,
            "filename": "pypatch-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "b68aaa3d84882a5f43c8cb8ec971ca52",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 16499,
            "upload_time": "2024-10-08T14:12:01",
            "upload_time_iso_8601": "2024-10-08T14:12:01.352360Z",
            "url": "https://files.pythonhosted.org/packages/7e/1c/6379e3feb25bd1cc70320ffa2f6410f799a8348b0e385d04b3bbdc19246f/pypatch-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-08 14:12:01",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pypatch"
}
        
Elapsed time: 0.33943s