paul-mclendahand


Namepaul-mclendahand JSON
Version 3.1.0 PyPI version JSON
download
home_page
SummaryTool for combining GitHub pull requests.
upload_time2023-10-09 18:36:45
maintainer
docs_urlNone
authorWill Kahn-Greene
requires_python>=3.8
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 `pipx <https://pypi.org/project/pipx/>`_::

    pipx install paul-mclendahand

With pip from PyPI::

    pip install paul-mclendahand
    
With pip from GitHub main branch::

    pip install https://github.com/willkg/paul-mclendahand/archive/main.zip

With pip from a clone of the repository with dev dependencies::

    pip install -r requirements-dev.txt

    
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.


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": "",
    "name": "paul-mclendahand",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "github,pr",
    "author": "Will Kahn-Greene",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/e1/f7/d42cb1ccf920580e88351886887467742e2745660634e037a133c5e35c76/paul-mclendahand-3.1.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 `pipx <https://pypi.org/project/pipx/>`_::\n\n    pipx install paul-mclendahand\n\nWith pip from PyPI::\n\n    pip install paul-mclendahand\n    \nWith pip from GitHub main branch::\n\n    pip install https://github.com/willkg/paul-mclendahand/archive/main.zip\n\nWith pip from a clone of the repository with dev dependencies::\n\n    pip install -r requirements-dev.txt\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\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.1.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": "fededc5b5d0c0a440a0e98e741ffbf7d959e8d8e3472e3992d1eeac9a71a5193",
                "md5": "4640cb9faa729d982be12b301a7d90ec",
                "sha256": "27fd1f4c397bbd7ded1f133bdec37acfd32ce9dc5da1a9f929b539cd3015ea56"
            },
            "downloads": -1,
            "filename": "paul_mclendahand-3.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4640cb9faa729d982be12b301a7d90ec",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 13821,
            "upload_time": "2023-10-09T18:36:43",
            "upload_time_iso_8601": "2023-10-09T18:36:43.864880Z",
            "url": "https://files.pythonhosted.org/packages/fe/de/dc5b5d0c0a440a0e98e741ffbf7d959e8d8e3472e3992d1eeac9a71a5193/paul_mclendahand-3.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e1f7d42cb1ccf920580e88351886887467742e2745660634e037a133c5e35c76",
                "md5": "b93d060e0abee2aa2dd651aa369be6b9",
                "sha256": "0ab42ae357f14b3d44da86d6a4ddd578b08e9f6e2c03c53f59989888dfb029cb"
            },
            "downloads": -1,
            "filename": "paul-mclendahand-3.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "b93d060e0abee2aa2dd651aa369be6b9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 15099,
            "upload_time": "2023-10-09T18:36:45",
            "upload_time_iso_8601": "2023-10-09T18:36:45.203577Z",
            "url": "https://files.pythonhosted.org/packages/e1/f7/d42cb1ccf920580e88351886887467742e2745660634e037a133c5e35c76/paul-mclendahand-3.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-09 18:36:45",
    "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.13049s