Metadata-Version: 2.4
Name: repo-smith
Version: 0.2.0
Summary: YAML-based configuration for initializing Git repositories for unit testing
Project-URL: Homepage, https://github.com/git-mastery/repo-smith.git
Project-URL: Repository, https://github.com/git-mastery/repo-smith.git
Project-URL: Issues, https://github.com/git-mastery/repo-smith/issues
Author-email: "Jiahao, Woo" <woojiahao1234@gmail.com>
License: MIT License
        
        Copyright (c) 2025 git-mastery
        
        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.
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development
Requires-Python: >=3.13
Requires-Dist: gitpython
Description-Content-Type: text/markdown

# repo-smith

YAML-based configuration for Git repository initialization for unit testing

## Installation

```bash
pip install -U repo-smith
```

## Usage

Create a new configuration file (following the [specification](/specification.md)).

```yml
# File path: tests/specs/basic_spec.yml
name: Basic spec
description: Starting basic spec
initialization:
  steps:
    - name: Create filea.txt
      type: new-file
      filename: filea.txt
      contents: |
        Hello world
    - name: Add filea.txt
      type: add
      files:
        - filea.txt
    - name: Initial commit
      type: commit
      message: Initial commit
      id: initial-commit
    - name: v0 tag
      type: tag
      tag-name: v0
```

Create a unit test accordingly.

```py
from repo_smith.initialize_repo import initialize_repo
from git import Repo

def test_dummy():
  repo_initializer = initialize_repo("test/specs/basic_spec.yml")
  with repo_initializer.initialize() as repo:
    # All unit testing code for the dummy repository goes here
    print(repo)
```

For more use cases of `repo-smith`, refer to:

- [Official specification](/specification.md)
- [Unit tests](./tests/)
