rcmt


Namercmt JSON
Version 0.30.0 PyPI version JSON
download
home_pagehttps://github.com/wndhydrnt/rcmt
Summary
upload_time2023-12-23 07:56:28
maintainer
docs_urlNone
authorMarkus Meyer
requires_python>=3.9,<4.0
licenseMPL-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # rcmt

<div align="center">

[![pypi](https://img.shields.io/pypi/v/rcmt.svg)](https://pypi.org/project/rcmt/)
[![python](https://img.shields.io/pypi/pyversions/rcmt.svg)](https://pypi.org/project/rcmt/)
[![docs](https://readthedocs.org/projects/rcmt/badge/?version=stable)](https://readthedocs.org/projects/rcmt/?badge=stable)

</div>

rcmt automates refactorings across many repositories.

Write Python code to define how the content of files should look like. Then let rcmt
apply the changes across repositories and create pull requests.


## Features

- **Mass Refactoring** - create, update or delete files across many repositories.
- **Automation** - automatic creation of merge requests in repositories; optionally
  merge them automatically if approved and all checks have passed.
- **Flexibility** - call third-party APIs or integrate libraries.

## The Task file

A Task file tells rcmt which repositories to modify. It is written in Python.

```python
from rcmt import Task, Context, register_task


# Replace with your repository.
REPOSITORY = "github.com/wndhydrnt/rcmt-example"

# A Task bundles the code that determines which repositories to modify and how to modify
# them. It is a regular Python class that extends the base class `Task`.
class HelloWorld(Task):
    name = "hello-world"
    pr_title = "rcmt Hello World"
    pr_body = """This pull request has been created as part of the how-to guide:

https://rcmt.readthedocs.io/get-started/create-a-task/
"""

    # The `filter` method determines which repositories to modify. It is called by rcmt
    # for each repository.
    def filter(self, ctx: Context) -> bool:
        return ctx.repo.full_name == REPOSITORY

    # The `apply` method contains the code that modifies files in a repository. In this
    # example, the `own` function creates the file `hello-world.txt` with the content
    # `Hello World` in the root of the repository. `target` is not an absolute path
    # because rcmt automatically sets the current working directory (`cwd`) to the
    # checkout of the repository.
    def apply(self, ctx: Context) -> None:
        with open("hello-world.txt", "w+") as f:
            f.write("Hello World")


# Register the task with rcmt so rcmt knows about it.
register_task(HelloWorld())
```

## What's next

- [Tutorial](https://rcmt.readthedocs.io/en/stable/get-started/tutorial/)
- [Learn how rcmt works](https://rcmt.readthedocs.io/en/stable/get-started/how-it-works/)
- [Features](https://rcmt.readthedocs.io/en/stable/features/events/)
- [Examples](https://rcmt.readthedocs.io/en/stable/examples/simple/)
- [Reference](https://rcmt.readthedocs.io/en/stable/reference/configuration/)

## Contributing

[Learn how to contribute code to rcmt](https://rcmt.readthedocs.io/en/stable/contributing/)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/wndhydrnt/rcmt",
    "name": "rcmt",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Markus Meyer",
    "author_email": "hydrantanderwand@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b4/5d/f205ce64e23d02c619d03aad7a707b0af15381d169350fd6281379375ebc/rcmt-0.30.0.tar.gz",
    "platform": null,
    "description": "# rcmt\n\n<div align=\"center\">\n\n[![pypi](https://img.shields.io/pypi/v/rcmt.svg)](https://pypi.org/project/rcmt/)\n[![python](https://img.shields.io/pypi/pyversions/rcmt.svg)](https://pypi.org/project/rcmt/)\n[![docs](https://readthedocs.org/projects/rcmt/badge/?version=stable)](https://readthedocs.org/projects/rcmt/?badge=stable)\n\n</div>\n\nrcmt automates refactorings across many repositories.\n\nWrite Python code to define how the content of files should look like. Then let rcmt\napply the changes across repositories and create pull requests.\n\n\n## Features\n\n- **Mass Refactoring** - create, update or delete files across many repositories.\n- **Automation** - automatic creation of merge requests in repositories; optionally\n  merge them automatically if approved and all checks have passed.\n- **Flexibility** - call third-party APIs or integrate libraries.\n\n## The Task file\n\nA Task file tells rcmt which repositories to modify. It is written in Python.\n\n```python\nfrom rcmt import Task, Context, register_task\n\n\n# Replace with your repository.\nREPOSITORY = \"github.com/wndhydrnt/rcmt-example\"\n\n# A Task bundles the code that determines which repositories to modify and how to modify\n# them. It is a regular Python class that extends the base class `Task`.\nclass HelloWorld(Task):\n    name = \"hello-world\"\n    pr_title = \"rcmt Hello World\"\n    pr_body = \"\"\"This pull request has been created as part of the how-to guide:\n\nhttps://rcmt.readthedocs.io/get-started/create-a-task/\n\"\"\"\n\n    # The `filter` method determines which repositories to modify. It is called by rcmt\n    # for each repository.\n    def filter(self, ctx: Context) -> bool:\n        return ctx.repo.full_name == REPOSITORY\n\n    # The `apply` method contains the code that modifies files in a repository. In this\n    # example, the `own` function creates the file `hello-world.txt` with the content\n    # `Hello World` in the root of the repository. `target` is not an absolute path\n    # because rcmt automatically sets the current working directory (`cwd`) to the\n    # checkout of the repository.\n    def apply(self, ctx: Context) -> None:\n        with open(\"hello-world.txt\", \"w+\") as f:\n            f.write(\"Hello World\")\n\n\n# Register the task with rcmt so rcmt knows about it.\nregister_task(HelloWorld())\n```\n\n## What's next\n\n- [Tutorial](https://rcmt.readthedocs.io/en/stable/get-started/tutorial/)\n- [Learn how rcmt works](https://rcmt.readthedocs.io/en/stable/get-started/how-it-works/)\n- [Features](https://rcmt.readthedocs.io/en/stable/features/events/)\n- [Examples](https://rcmt.readthedocs.io/en/stable/examples/simple/)\n- [Reference](https://rcmt.readthedocs.io/en/stable/reference/configuration/)\n\n## Contributing\n\n[Learn how to contribute code to rcmt](https://rcmt.readthedocs.io/en/stable/contributing/)\n",
    "bugtrack_url": null,
    "license": "MPL-2.0",
    "summary": "",
    "version": "0.30.0",
    "project_urls": {
        "Changelog": "https://github.com/wndhydrnt/rcmt/blob/main/CHANGELOG.md",
        "Documentation": "https://rcmt.readthedocs.io/",
        "Homepage": "https://github.com/wndhydrnt/rcmt",
        "Repository": "https://github.com/wndhydrnt/rcmt"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0f7892a688dc1d0c6f9bd4c6f90a3d4f742465415f9d4d33d487fb5bf909a26b",
                "md5": "167980df34d80c36e16200df9b480cc8",
                "sha256": "65b0e8f633b072be42582baa985cbbe84b666338174fbec3d20cdd105afaccb4"
            },
            "downloads": -1,
            "filename": "rcmt-0.30.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "167980df34d80c36e16200df9b480cc8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 48926,
            "upload_time": "2023-12-23T07:56:26",
            "upload_time_iso_8601": "2023-12-23T07:56:26.587683Z",
            "url": "https://files.pythonhosted.org/packages/0f/78/92a688dc1d0c6f9bd4c6f90a3d4f742465415f9d4d33d487fb5bf909a26b/rcmt-0.30.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b45df205ce64e23d02c619d03aad7a707b0af15381d169350fd6281379375ebc",
                "md5": "9bba9d0e6371c7eb6e78dced4159e20d",
                "sha256": "fdab03f5269abc84b255fb737fe7fb8d75f635f44497efd500ae39f575ea662a"
            },
            "downloads": -1,
            "filename": "rcmt-0.30.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9bba9d0e6371c7eb6e78dced4159e20d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 36496,
            "upload_time": "2023-12-23T07:56:28",
            "upload_time_iso_8601": "2023-12-23T07:56:28.729441Z",
            "url": "https://files.pythonhosted.org/packages/b4/5d/f205ce64e23d02c619d03aad7a707b0af15381d169350fd6281379375ebc/rcmt-0.30.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-23 07:56:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "wndhydrnt",
    "github_project": "rcmt",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "rcmt"
}
        
Elapsed time: 0.16414s