paul-mclendahand


Namepaul-mclendahand JSON
Version 3.2.0 PyPI version JSON
download
home_pageNone
SummaryTool for combining GitHub pull requests.
upload_time2024-10-30 00:19:34
maintainerNone
docs_urlNone
authorWill Kahn-Greene
requires_python>=3.9
licenseMPLv2
keywords github pr
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ================
paul-mclendahand
================

Tool for combining GitHub pull requests.

:Code:          https://github.com/willkg/paul-mclendahand
:Issues:        https://github.com/willkg/paul-mclendahand/issues
:License:       MPL v2
:Documentation: this README


Install
=======

(Recommended) With `uv <https://docs.astral.sh/uv/>`__::

    uv tool install paul-mclendahand

With pip from PyPI::

    pip install paul-mclendahand
    
    
Quick start
===========

Configure pmac
--------------

pmac needs to know the GitHub user and GitHub project.

You can set configuration in the ``pyproject.toml`` file::

   [tool.paul-mclendahand]
   github_user = "user"
   github_project = "project"
   main_branch = "git-main-branch-name"

Or you can set configuration in the ``setup.cfg`` file::

   [tool:paul-mclendahand]
   github_user=user
   github_project=project
   main_branch=git-main-branch-name

You can override the configuration variables with environment variables::

   PMAC_GITHUB_USER=user
   PMAC_GITHUB_PROJECT=project
   PMAC_MAIN_BRANCH=git-main-branch-name

**Optional**

You can also use a GitHub personal access token. You set it in the
``PMAC_GITHUB_API_TOKEN`` environment variable.

For example::

    PMAC_GITHUB_API_TOKEN=abcdef0000000000000000000000000000000000 pmac listprs

.. Note::

   If you find pmac stops working because it's getting rate-limited by GitHub,
   you should use a personal access token.


Configure git
-------------

When cherry-picking commits, ``pmac`` sometimes causes Git to push you
to resolve the same issue multiple times. For this reason, we encourage
you to set ``rerere.enabled`` to ``true``.

Globally::

    $ git config --global rerere.enabled true

Local to the git repository you're in::

    $ git config rerere.enabled true

git will keep track of resolutions and re-apply them.


Using pmac
----------

After you've configured git, then you can use ``pmac`` like this:

1. Create a new branch::

       git checkout <MAIN-BRANCH>
       git checkout -b update-prs

2. List open PRs::

       pmac listprs

3. Combine some pull requests into it::

       pmac add 5100 5101 5102

   Use the same pull requests numbers as on GitHub.

   Internally, ``pmac`` uses ``git am`` to apply commits from pull requests. If
   you hit a ``git am`` conflict, ``pmac`` will tell you. You can edit the file
   in another terminal to manually resolve the conflict. Then do::

       git add FILE
       git commit
       git am --continue

   After that, you can continue with ``pmac``.

4. When you're done, push the branch to GitHub and create a pull request.

   ``pmac`` can help with the PR description::

       pmac prmsg


pmac
----

.. [[[cog
    from paul_mclendahand.cmd_pmac import pmac_cli
    from click.testing import CliRunner
    result = CliRunner().invoke(pmac_cli, ["--help"])
    cog.out("\n")
    cog.out("::\n\n")
    for line in result.output.splitlines():
        if line.strip():
            cog.out(f"   {line}\n")
        else:
            cog.out("\n")
    cog.out("\n")
   ]]]

::

   Usage: pmac [OPTIONS] COMMAND [ARGS]...

     GitHub pull request combiner tool.

     pmac uses a "[tool:paul-mclendahand]" section in setup.cfg to set
     configuration variables. You can override these using PMAC_VARNAME environment
     variables.

     Additionally, if you want to use a GitHub personal access token, you need to
     provide the "PMAC_GITHUB_API_TOKEN" variable in the environment set to the
     token.

     For issues, see: https://github.com/willkg/paul-mclendahand/issues

   Options:
     --version  Show the version and exit.
     --help     Show this message and exit.

   Commands:
     add      Combine specified PRs into this branch.
     listprs  List available PRs for the project.
     prmsg    Print out summary of commits suitable for a PR msg.

.. [[[end]]]


pmac listprs
------------

.. [[[cog
    from paul_mclendahand.cmd_pmac import pmac_cli
    from click.testing import CliRunner
    result = CliRunner().invoke(pmac_cli, ["listprs", "--help"])
    cog.out("\n")
    cog.out("::\n\n")
    for line in result.output.splitlines():
        if line.strip():
            cog.out(f"   {line}\n")
        else:
            cog.out("\n")
    cog.out("\n")
   ]]]

::

   Usage: pmac listprs [OPTIONS]

     List available PRs for the project.

   Options:
     --labels / --no-labels  List labels
     --format [table|tab]
     --help                  Show this message and exit.

.. [[[end]]]


pmac add
--------

.. [[[cog
    from paul_mclendahand.cmd_pmac import pmac_cli
    from click.testing import CliRunner
    result = CliRunner().invoke(pmac_cli, ["add", "--help"])
    cog.out("\n")
    cog.out("::\n\n")
    for line in result.output.splitlines():
        if line.strip():
            cog.out(f"   {line}\n")
        else:
            cog.out("\n")
    cog.out("\n")
   ]]]

::

   Usage: pmac add [OPTIONS] PR...

     Combine specified PRs into this branch.

   Options:
     --help  Show this message and exit.

.. [[[end]]]


pmac prmsg
----------

.. [[[cog
    from paul_mclendahand.cmd_pmac import pmac_cli
    from click.testing import CliRunner
    result = CliRunner().invoke(pmac_cli, ["prmsg", "--help"])
    cog.out("\n")
    cog.out("::\n\n")
    for line in result.output.splitlines():
        if line.strip():
            cog.out(f"   {line}\n")
        else:
            cog.out("\n")
    cog.out("\n")
   ]]]

::

   Usage: pmac prmsg [OPTIONS]

     Print out summary of commits suitable for a PR msg.

   Options:
     --help  Show this message and exit.

.. [[[end]]]


Why does this project exist?
============================

Two main reasons.

First, GitHub doesn't support combining pull requests. There is a forum post
about it here:
https://github.community/t/feature-request-combine-pull-requests/2250

Second, dependabot (also owned by GitHub) doesn't support grouping dependency
updates into a single pull request. If you have 50 dependency updates, it
creates 50 pull requests (sometimes more!). I have a lot of projects and lack
of grouping updates makes monthly maintenance miserable. There's an issue for
this:
https://github.com/dependabot/dependabot-core/issues/1190

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "paul-mclendahand",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "github, pr",
    "author": "Will Kahn-Greene",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/73/ab/32c947619151a71591ccfe318dea6cbe98a61364a2ce21fc3f852c4e07f2/paul_mclendahand-3.2.0.tar.gz",
    "platform": null,
    "description": "================\npaul-mclendahand\n================\n\nTool for combining GitHub pull requests.\n\n:Code:          https://github.com/willkg/paul-mclendahand\n:Issues:        https://github.com/willkg/paul-mclendahand/issues\n:License:       MPL v2\n:Documentation: this README\n\n\nInstall\n=======\n\n(Recommended) With `uv <https://docs.astral.sh/uv/>`__::\n\n    uv tool install paul-mclendahand\n\nWith pip from PyPI::\n\n    pip install paul-mclendahand\n    \n    \nQuick start\n===========\n\nConfigure pmac\n--------------\n\npmac needs to know the GitHub user and GitHub project.\n\nYou can set configuration in the ``pyproject.toml`` file::\n\n   [tool.paul-mclendahand]\n   github_user = \"user\"\n   github_project = \"project\"\n   main_branch = \"git-main-branch-name\"\n\nOr you can set configuration in the ``setup.cfg`` file::\n\n   [tool:paul-mclendahand]\n   github_user=user\n   github_project=project\n   main_branch=git-main-branch-name\n\nYou can override the configuration variables with environment variables::\n\n   PMAC_GITHUB_USER=user\n   PMAC_GITHUB_PROJECT=project\n   PMAC_MAIN_BRANCH=git-main-branch-name\n\n**Optional**\n\nYou can also use a GitHub personal access token. You set it in the\n``PMAC_GITHUB_API_TOKEN`` environment variable.\n\nFor example::\n\n    PMAC_GITHUB_API_TOKEN=abcdef0000000000000000000000000000000000 pmac listprs\n\n.. Note::\n\n   If you find pmac stops working because it's getting rate-limited by GitHub,\n   you should use a personal access token.\n\n\nConfigure git\n-------------\n\nWhen cherry-picking commits, ``pmac`` sometimes causes Git to push you\nto resolve the same issue multiple times. For this reason, we encourage\nyou to set ``rerere.enabled`` to ``true``.\n\nGlobally::\n\n    $ git config --global rerere.enabled true\n\nLocal to the git repository you're in::\n\n    $ git config rerere.enabled true\n\ngit will keep track of resolutions and re-apply them.\n\n\nUsing pmac\n----------\n\nAfter you've configured git, then you can use ``pmac`` like this:\n\n1. Create a new branch::\n\n       git checkout <MAIN-BRANCH>\n       git checkout -b update-prs\n\n2. List open PRs::\n\n       pmac listprs\n\n3. Combine some pull requests into it::\n\n       pmac add 5100 5101 5102\n\n   Use the same pull requests numbers as on GitHub.\n\n   Internally, ``pmac`` uses ``git am`` to apply commits from pull requests. If\n   you hit a ``git am`` conflict, ``pmac`` will tell you. You can edit the file\n   in another terminal to manually resolve the conflict. Then do::\n\n       git add FILE\n       git commit\n       git am --continue\n\n   After that, you can continue with ``pmac``.\n\n4. When you're done, push the branch to GitHub and create a pull request.\n\n   ``pmac`` can help with the PR description::\n\n       pmac prmsg\n\n\npmac\n----\n\n.. [[[cog\n    from paul_mclendahand.cmd_pmac import pmac_cli\n    from click.testing import CliRunner\n    result = CliRunner().invoke(pmac_cli, [\"--help\"])\n    cog.out(\"\\n\")\n    cog.out(\"::\\n\\n\")\n    for line in result.output.splitlines():\n        if line.strip():\n            cog.out(f\"   {line}\\n\")\n        else:\n            cog.out(\"\\n\")\n    cog.out(\"\\n\")\n   ]]]\n\n::\n\n   Usage: pmac [OPTIONS] COMMAND [ARGS]...\n\n     GitHub pull request combiner tool.\n\n     pmac uses a \"[tool:paul-mclendahand]\" section in setup.cfg to set\n     configuration variables. You can override these using PMAC_VARNAME environment\n     variables.\n\n     Additionally, if you want to use a GitHub personal access token, you need to\n     provide the \"PMAC_GITHUB_API_TOKEN\" variable in the environment set to the\n     token.\n\n     For issues, see: https://github.com/willkg/paul-mclendahand/issues\n\n   Options:\n     --version  Show the version and exit.\n     --help     Show this message and exit.\n\n   Commands:\n     add      Combine specified PRs into this branch.\n     listprs  List available PRs for the project.\n     prmsg    Print out summary of commits suitable for a PR msg.\n\n.. [[[end]]]\n\n\npmac listprs\n------------\n\n.. [[[cog\n    from paul_mclendahand.cmd_pmac import pmac_cli\n    from click.testing import CliRunner\n    result = CliRunner().invoke(pmac_cli, [\"listprs\", \"--help\"])\n    cog.out(\"\\n\")\n    cog.out(\"::\\n\\n\")\n    for line in result.output.splitlines():\n        if line.strip():\n            cog.out(f\"   {line}\\n\")\n        else:\n            cog.out(\"\\n\")\n    cog.out(\"\\n\")\n   ]]]\n\n::\n\n   Usage: pmac listprs [OPTIONS]\n\n     List available PRs for the project.\n\n   Options:\n     --labels / --no-labels  List labels\n     --format [table|tab]\n     --help                  Show this message and exit.\n\n.. [[[end]]]\n\n\npmac add\n--------\n\n.. [[[cog\n    from paul_mclendahand.cmd_pmac import pmac_cli\n    from click.testing import CliRunner\n    result = CliRunner().invoke(pmac_cli, [\"add\", \"--help\"])\n    cog.out(\"\\n\")\n    cog.out(\"::\\n\\n\")\n    for line in result.output.splitlines():\n        if line.strip():\n            cog.out(f\"   {line}\\n\")\n        else:\n            cog.out(\"\\n\")\n    cog.out(\"\\n\")\n   ]]]\n\n::\n\n   Usage: pmac add [OPTIONS] PR...\n\n     Combine specified PRs into this branch.\n\n   Options:\n     --help  Show this message and exit.\n\n.. [[[end]]]\n\n\npmac prmsg\n----------\n\n.. [[[cog\n    from paul_mclendahand.cmd_pmac import pmac_cli\n    from click.testing import CliRunner\n    result = CliRunner().invoke(pmac_cli, [\"prmsg\", \"--help\"])\n    cog.out(\"\\n\")\n    cog.out(\"::\\n\\n\")\n    for line in result.output.splitlines():\n        if line.strip():\n            cog.out(f\"   {line}\\n\")\n        else:\n            cog.out(\"\\n\")\n    cog.out(\"\\n\")\n   ]]]\n\n::\n\n   Usage: pmac prmsg [OPTIONS]\n\n     Print out summary of commits suitable for a PR msg.\n\n   Options:\n     --help  Show this message and exit.\n\n.. [[[end]]]\n\n\nWhy does this project exist?\n============================\n\nTwo main reasons.\n\nFirst, GitHub doesn't support combining pull requests. There is a forum post\nabout it here:\nhttps://github.community/t/feature-request-combine-pull-requests/2250\n\nSecond, dependabot (also owned by GitHub) doesn't support grouping dependency\nupdates into a single pull request. If you have 50 dependency updates, it\ncreates 50 pull requests (sometimes more!). I have a lot of projects and lack\nof grouping updates makes monthly maintenance miserable. There's an issue for\nthis:\nhttps://github.com/dependabot/dependabot-core/issues/1190\n",
    "bugtrack_url": null,
    "license": "MPLv2",
    "summary": "Tool for combining GitHub pull requests.",
    "version": "3.2.0",
    "project_urls": {
        "Homepage": "https://github.com/willkg/paul-mclendahanad",
        "Issues": "https://github.com/willkg/paul-mclendahanad/issues",
        "Source": "https://github.com/willkg/paul-mclendahanad"
    },
    "split_keywords": [
        "github",
        " pr"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "efa8c9cf07f6addf8046f45c788dd7f6da211907ecd93dee460830dfd7550ee8",
                "md5": "e6ecbfddfda4076cebd77387e128519c",
                "sha256": "13b1246a3b046f019753b55e02ff09f3fd91ce11fe9af5a29ed56ed41ce37c04"
            },
            "downloads": -1,
            "filename": "paul_mclendahand-3.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e6ecbfddfda4076cebd77387e128519c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 13921,
            "upload_time": "2024-10-30T00:19:33",
            "upload_time_iso_8601": "2024-10-30T00:19:33.207724Z",
            "url": "https://files.pythonhosted.org/packages/ef/a8/c9cf07f6addf8046f45c788dd7f6da211907ecd93dee460830dfd7550ee8/paul_mclendahand-3.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "73ab32c947619151a71591ccfe318dea6cbe98a61364a2ce21fc3f852c4e07f2",
                "md5": "64f6e78a3105e349c041a9cbd779a69c",
                "sha256": "84238ffc7cef0f49a4ba32c2cdf64b516e192c0d0096d5546332143ba0177a7a"
            },
            "downloads": -1,
            "filename": "paul_mclendahand-3.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "64f6e78a3105e349c041a9cbd779a69c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 17455,
            "upload_time": "2024-10-30T00:19:34",
            "upload_time_iso_8601": "2024-10-30T00:19:34.654731Z",
            "url": "https://files.pythonhosted.org/packages/73/ab/32c947619151a71591ccfe318dea6cbe98a61364a2ce21fc3f852c4e07f2/paul_mclendahand-3.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-30 00:19:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "willkg",
    "github_project": "paul-mclendahanad",
    "github_not_found": true,
    "lcname": "paul-mclendahand"
}
        
Elapsed time: 0.39844s