githarbor 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. githarbor-0.0.1/.copier-answers.yml +20 -0
  2. githarbor-0.0.1/.github/FUNDING.yml +3 -0
  3. githarbor-0.0.1/.github/copilot-instructions.md +19 -0
  4. githarbor-0.0.1/.github/dependabot.yml +9 -0
  5. githarbor-0.0.1/.github/workflows/build.yml +92 -0
  6. githarbor-0.0.1/.github/workflows/documentation.yml +57 -0
  7. githarbor-0.0.1/.gitignore +30 -0
  8. githarbor-0.0.1/.pre-commit-config.yaml +48 -0
  9. githarbor-0.0.1/LICENSE +22 -0
  10. githarbor-0.0.1/PKG-INFO +86 -0
  11. githarbor-0.0.1/README.md +32 -0
  12. githarbor-0.0.1/backup_abstract.py +153 -0
  13. githarbor-0.0.1/backup_bitbucket.py +772 -0
  14. githarbor-0.0.1/backup_github.py +612 -0
  15. githarbor-0.0.1/backup_gitlab.py +646 -0
  16. githarbor-0.0.1/bitbucketrepository.py.bak +322 -0
  17. githarbor-0.0.1/docs/.empty +0 -0
  18. githarbor-0.0.1/duties.py +60 -0
  19. githarbor-0.0.1/mkdocs.yml +92 -0
  20. githarbor-0.0.1/overrides/_dummy.txt +1 -0
  21. githarbor-0.0.1/pyproject.toml +233 -0
  22. githarbor-0.0.1/src/githarbor/__init__.py +27 -0
  23. githarbor-0.0.1/src/githarbor/core/__init__.py +0 -0
  24. githarbor-0.0.1/src/githarbor/core/base.py +125 -0
  25. githarbor-0.0.1/src/githarbor/core/models.py +210 -0
  26. githarbor-0.0.1/src/githarbor/exceptions.py +29 -0
  27. githarbor-0.0.1/src/githarbor/providers/__init__.py +18 -0
  28. githarbor-0.0.1/src/githarbor/providers/githubrepository.py +344 -0
  29. githarbor-0.0.1/src/githarbor/providers/gitlabrepository.py +344 -0
  30. githarbor-0.0.1/src/githarbor/providers/testrepository.py +119 -0
  31. githarbor-0.0.1/src/githarbor/py.typed +0 -0
  32. githarbor-0.0.1/src/githarbor/registry.py +73 -0
  33. githarbor-0.0.1/src/githarbor/repositories.py +50 -0
  34. githarbor-0.0.1/src/githarbor/repository.py +73 -0
  35. githarbor-0.0.1/tests/__init__.py +3 -0
  36. githarbor-0.0.1/tests/conftest.py +165 -0
  37. githarbor-0.0.1/tests/test_bitbucket_provider.py.bak +21 -0
  38. githarbor-0.0.1/tests/test_factory.py +38 -0
  39. githarbor-0.0.1/tests/test_github.py +68 -0
  40. githarbor-0.0.1/tests/test_gitlab.py +118 -0
  41. githarbor-0.0.1/tests/test_integration.py +32 -0
  42. githarbor-0.0.1/tests/test_registry.py +65 -0
@@ -0,0 +1,20 @@
1
+ # Changes here will be overwritten by Copier
2
+ _commit: v1.4.1
3
+ _src_path: .\copier-phil65\
4
+ author_email: philipptemminghoff@googlemail.com
5
+ author_fullname: Philipp Temminghoff
6
+ author_username: phil65
7
+ copyright_date: '2024'
8
+ copyright_holder: Philipp Temminghoff
9
+ copyright_holder_email: philipptemminghoff@googlemail.com
10
+ libraries_use_qt: false
11
+ project_description: Unified client for GitHub, GitLab and BitBucket
12
+ project_name: GitHarbor
13
+ python_minimum_version: '3.12'
14
+ python_package_command_line_name: githarbor
15
+ python_package_distribution_name: githarbor
16
+ python_package_import_name: githarbor
17
+ repository_name: githarbor
18
+ repository_namespace: phil65
19
+ repository_provider: github.com
20
+
@@ -0,0 +1,3 @@
1
+ github: phil65
2
+ custom:
3
+ - https://www.paypal.me/phil65
@@ -0,0 +1,19 @@
1
+ ## Code style
2
+
3
+ You can assume Python 3.12.
4
+ Use newest language features if possible
5
+ Consider using pattern matching, walrus operators and other new syntax features.
6
+ Adhere to pep8.
7
+
8
+ ## Tests
9
+
10
+ Tests are written using PyTest. Dont put tests into a class.
11
+
12
+ ## DocStrings
13
+
14
+ DocStrings are written in google-style.
15
+ Dont add the types to the "Args" section.
16
+ Only add a Return section if a value is returned and the meaning of the returned value
17
+ is not obvious.
18
+ You can use markdown admonitions with python-markdown syntax if neccessary (!!! info, !!! note, !!! warning).
19
+ You can use markdown tables and markdown lists if neccessary.
@@ -0,0 +1,9 @@
1
+ # Set update schedule for GitHub Actions
2
+
3
+ version: 2
4
+ updates:
5
+ - package-ecosystem: "github-actions"
6
+ directory: "/"
7
+ schedule:
8
+ # Check for updates to GitHub Actions every week
9
+ interval: "weekly"
@@ -0,0 +1,92 @@
1
+ name: Build
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ test:
7
+ runs-on: ${{ matrix.os }}
8
+ continue-on-error: ${{ matrix.python_version == '3.14' }}
9
+ strategy:
10
+ matrix:
11
+ python_version: ["3.12", "3.13", "3.14"]
12
+ os: ["ubuntu-latest", "macos-latest", "windows-latest"]
13
+ steps:
14
+ - name: Check out repository
15
+ uses: actions/checkout@v4
16
+
17
+ - name: Set up Python ${{ matrix.python_version }}
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: ${{ matrix.python_version }}
21
+ allow-prereleases: true
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@v3
24
+ with:
25
+ enable-cache: true
26
+ cache-dependency-glob: pyproject.toml
27
+ cache-suffix: py${{ matrix.python_version }}
28
+
29
+ - name: Install dependencies (uv sync)
30
+ run: uv sync --all-extras
31
+
32
+ - name: Check for code issues (ruff check)
33
+ uses: astral-sh/ruff-action@v1
34
+
35
+ - name: Check code format (ruff format)
36
+ uses: astral-sh/ruff-action@v1
37
+ with:
38
+ args: "format --check"
39
+
40
+ - name: Static type checking (MyPy)
41
+ run: uv run mypy src/githarbor/
42
+
43
+ - name: Run tests
44
+ run: uv run pytest --cov-report=xml --cov=src/githarbor/ --cov-report=term-missing
45
+ env:
46
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47
+ GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
48
+ BITBUCKET_TOKEN: ${{ secrets.BITBUCKET_TOKEN }}
49
+
50
+ - name: Upload test results to Codecov
51
+ uses: codecov/codecov-action@v4
52
+ with:
53
+ token: ${{ secrets.CODECOV_TOKEN }}
54
+ fail_ci_if_error: false
55
+ verbose: true
56
+
57
+ release:
58
+ runs-on: ubuntu-latest
59
+ needs: test
60
+ if: startsWith(github.ref, 'refs/tags/')
61
+ permissions:
62
+ # this permission is mandatory for trusted publishing
63
+ id-token: write
64
+ contents: write
65
+ steps:
66
+ - name: Check out repository
67
+ uses: actions/checkout@v4
68
+
69
+ - name: Set up Python
70
+ uses: actions/setup-python@v5
71
+ with:
72
+ python-version: "{{ python_minimum_version }}"
73
+
74
+ - name: Install uv
75
+ uses: astral-sh/setup-uv@v3
76
+ with:
77
+ enable-cache: true
78
+ cache-dependency-glob: pyproject.toml
79
+ cache-suffix: py${{ matrix.python_version }}
80
+
81
+ - name: Build package
82
+ run: uv build
83
+
84
+ - name: Release package on PyPI
85
+ run: uv publish
86
+
87
+ - name: Release package on GitHub
88
+ uses: ncipollo/release-action@v1
89
+ with:
90
+ body: ${{ github.event.head_commit.message }}
91
+ artifacts: dist/*.whl,dist/*.tar.gz
92
+ token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,57 @@
1
+ name: Build documentation
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
9
+ permissions:
10
+ contents: read
11
+ pages: write
12
+ id-token: write
13
+
14
+ # Allow one concurrent deployment
15
+ concurrency:
16
+ group: "pages"
17
+ cancel-in-progress: true
18
+
19
+ # Default to bash
20
+ defaults:
21
+ run:
22
+ shell: bash
23
+
24
+ jobs:
25
+ build:
26
+ runs-on: ubuntu-latest
27
+
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ with:
31
+ fetch-depth: 0
32
+ - name: Set up Python
33
+ uses: actions/setup-python@v5
34
+ with:
35
+ python-version: "3.12"
36
+ - name: Install uv
37
+ uses: astral-sh/setup-uv@v3
38
+ - name: Install dependencies
39
+ run: |
40
+ uv sync --all-extras
41
+ - name: Build
42
+ run: uv run mknodes build
43
+ - name: Upload artifact
44
+ uses: actions/upload-pages-artifact@v3
45
+ with:
46
+ path: ./site
47
+
48
+ deploy:
49
+ environment:
50
+ name: github-pages
51
+ url: ${{ steps.deployment.outputs.page_url }}
52
+ runs-on: ubuntu-latest
53
+ needs: build
54
+ steps:
55
+ - name: Deploy to GitHub Pages
56
+ id: deployment
57
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,30 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ # Distribution / packaging
5
+ *.sublime-workspace
6
+ # Unit test / coverage reports
7
+ .coverage
8
+ coverage.xml
9
+ .cache
10
+ .hatch
11
+ .pytest_cache/
12
+ junit.xml
13
+ # Jupyter Notebook
14
+ .ipynb_checkpoints
15
+ # pyenv
16
+ .python-version
17
+ # dotenv
18
+ .env
19
+ # virtualenv
20
+ .venv
21
+ # mkdocs documentation
22
+ /site
23
+ # mypy
24
+ .mypy_cache/
25
+ # .vscode
26
+ .vscode/
27
+ # OS files
28
+ .DS_Store
29
+ # uv
30
+ uv.lock
@@ -0,0 +1,48 @@
1
+ default_language_version:
2
+ python: python3.12
3
+ default_stages: [pre-commit]
4
+ repos:
5
+ - repo: local
6
+ hooks:
7
+ - id: pytest-check
8
+ name: pytest-check
9
+ entry: uv run pytest
10
+ language: system
11
+ # stages: [push]
12
+ types: [python]
13
+ pass_filenames: false
14
+ always_run: true
15
+
16
+ - repo: https://github.com/pre-commit/pre-commit-hooks
17
+ # https://pre-commit.com/hooks.html
18
+ rev: v5.0.0
19
+ hooks:
20
+ - id: check-added-large-files
21
+ - id: check-case-conflict
22
+ - id: check-merge-conflict
23
+ - id: check-toml
24
+ - id: check-json
25
+ - id: check-xml
26
+ - id: check-yaml
27
+ args: [--allow-multiple-documents, --unsafe]
28
+ - id: debug-statements
29
+ - id: detect-private-key
30
+
31
+ - repo: https://github.com/pre-commit/mirrors-mypy
32
+ rev: v1.13.0
33
+ hooks:
34
+ - id: mypy
35
+ additional_dependencies: [orjson]
36
+
37
+ - repo: https://github.com/charliermarsh/ruff-pre-commit
38
+ rev: v0.7.2
39
+ hooks:
40
+ - id: ruff
41
+ - id: ruff-format
42
+
43
+ - repo: https://github.com/commitizen-tools/commitizen
44
+ rev: v3.30.0
45
+ hooks:
46
+ - id: commitizen
47
+ stages: [commit-msg]
48
+ additional_dependencies: [typing-extensions]
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024, Philipp Temminghoff
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,86 @@
1
+ Metadata-Version: 2.3
2
+ Name: githarbor
3
+ Version: 0.0.1
4
+ Summary: Unified client for GitHub, GitLab and BitBucket
5
+ Project-URL: Documentation, https://phil65.github.io/githarbor/
6
+ Project-URL: Source, https://github.com/phil65/githarbor
7
+ Author-email: Philipp Temminghoff <philipptemminghoff@googlemail.com>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2024, Philipp Temminghoff
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+
30
+ Classifier: Development Status :: 4 - Beta
31
+ Classifier: Intended Audience :: Developers
32
+ Classifier: Operating System :: OS Independent
33
+ Classifier: Programming Language :: Python :: 3
34
+ Classifier: Programming Language :: Python :: 3 :: Only
35
+ Classifier: Programming Language :: Python :: 3.12
36
+ Classifier: Programming Language :: Python :: 3.13
37
+ Classifier: Programming Language :: Python :: 3.14
38
+ Classifier: Topic :: Documentation
39
+ Classifier: Topic :: Software Development
40
+ Classifier: Topic :: Utilities
41
+ Classifier: Typing :: Typed
42
+ Requires-Python: >=3.12
43
+ Provides-Extra: all
44
+ Requires-Dist: atlassian-python-api; extra == 'all'
45
+ Requires-Dist: pygithub; extra == 'all'
46
+ Requires-Dist: python-gitlab; extra == 'all'
47
+ Provides-Extra: bitbucket
48
+ Requires-Dist: atlassian-python-api; extra == 'bitbucket'
49
+ Provides-Extra: github
50
+ Requires-Dist: pygithub; extra == 'github'
51
+ Provides-Extra: gitlab
52
+ Requires-Dist: python-gitlab; extra == 'gitlab'
53
+ Description-Content-Type: text/markdown
54
+
55
+ # GitHarbor
56
+
57
+ [![PyPI License](https://img.shields.io/pypi/l/githarbor.svg)](https://pypi.org/project/githarbor/)
58
+ [![Package status](https://img.shields.io/pypi/status/githarbor.svg)](https://pypi.org/project/githarbor/)
59
+ [![Daily downloads](https://img.shields.io/pypi/dd/githarbor.svg)](https://pypi.org/project/githarbor/)
60
+ [![Weekly downloads](https://img.shields.io/pypi/dw/githarbor.svg)](https://pypi.org/project/githarbor/)
61
+ [![Monthly downloads](https://img.shields.io/pypi/dm/githarbor.svg)](https://pypi.org/project/githarbor/)
62
+ [![Distribution format](https://img.shields.io/pypi/format/githarbor.svg)](https://pypi.org/project/githarbor/)
63
+ [![Wheel availability](https://img.shields.io/pypi/wheel/githarbor.svg)](https://pypi.org/project/githarbor/)
64
+ [![Python version](https://img.shields.io/pypi/pyversions/githarbor.svg)](https://pypi.org/project/githarbor/)
65
+ [![Implementation](https://img.shields.io/pypi/implementation/githarbor.svg)](https://pypi.org/project/githarbor/)
66
+ [![Releases](https://img.shields.io/github/downloads/phil65/githarbor/total.svg)](https://github.com/phil65/githarbor/releases)
67
+ [![Github Contributors](https://img.shields.io/github/contributors/phil65/githarbor)](https://github.com/phil65/githarbor/graphs/contributors)
68
+ [![Github Discussions](https://img.shields.io/github/discussions/phil65/githarbor)](https://github.com/phil65/githarbor/discussions)
69
+ [![Github Forks](https://img.shields.io/github/forks/phil65/githarbor)](https://github.com/phil65/githarbor/forks)
70
+ [![Github Issues](https://img.shields.io/github/issues/phil65/githarbor)](https://github.com/phil65/githarbor/issues)
71
+ [![Github Issues](https://img.shields.io/github/issues-pr/phil65/githarbor)](https://github.com/phil65/githarbor/pulls)
72
+ [![Github Watchers](https://img.shields.io/github/watchers/phil65/githarbor)](https://github.com/phil65/githarbor/watchers)
73
+ [![Github Stars](https://img.shields.io/github/stars/phil65/githarbor)](https://github.com/phil65/githarbor/stars)
74
+ [![Github Repository size](https://img.shields.io/github/repo-size/phil65/githarbor)](https://github.com/phil65/githarbor)
75
+ [![Github last commit](https://img.shields.io/github/last-commit/phil65/githarbor)](https://github.com/phil65/githarbor/commits)
76
+ [![Github release date](https://img.shields.io/github/release-date/phil65/githarbor)](https://github.com/phil65/githarbor/releases)
77
+ [![Github language count](https://img.shields.io/github/languages/count/phil65/githarbor)](https://github.com/phil65/githarbor)
78
+ [![Github commits this week](https://img.shields.io/github/commit-activity/w/phil65/githarbor)](https://github.com/phil65/githarbor)
79
+ [![Github commits this month](https://img.shields.io/github/commit-activity/m/phil65/githarbor)](https://github.com/phil65/githarbor)
80
+ [![Github commits this year](https://img.shields.io/github/commit-activity/y/phil65/githarbor)](https://github.com/phil65/githarbor)
81
+ [![Package status](https://codecov.io/gh/phil65/githarbor/branch/main/graph/badge.svg)](https://codecov.io/gh/phil65/githarbor/)
82
+ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
83
+ [![PyUp](https://pyup.io/repos/github/phil65/githarbor/shield.svg)](https://pyup.io/repos/github/phil65/githarbor/)
84
+
85
+ [Read the documentation!](https://phil65.github.io/githarbor/)
86
+
@@ -0,0 +1,32 @@
1
+ # GitHarbor
2
+
3
+ [![PyPI License](https://img.shields.io/pypi/l/githarbor.svg)](https://pypi.org/project/githarbor/)
4
+ [![Package status](https://img.shields.io/pypi/status/githarbor.svg)](https://pypi.org/project/githarbor/)
5
+ [![Daily downloads](https://img.shields.io/pypi/dd/githarbor.svg)](https://pypi.org/project/githarbor/)
6
+ [![Weekly downloads](https://img.shields.io/pypi/dw/githarbor.svg)](https://pypi.org/project/githarbor/)
7
+ [![Monthly downloads](https://img.shields.io/pypi/dm/githarbor.svg)](https://pypi.org/project/githarbor/)
8
+ [![Distribution format](https://img.shields.io/pypi/format/githarbor.svg)](https://pypi.org/project/githarbor/)
9
+ [![Wheel availability](https://img.shields.io/pypi/wheel/githarbor.svg)](https://pypi.org/project/githarbor/)
10
+ [![Python version](https://img.shields.io/pypi/pyversions/githarbor.svg)](https://pypi.org/project/githarbor/)
11
+ [![Implementation](https://img.shields.io/pypi/implementation/githarbor.svg)](https://pypi.org/project/githarbor/)
12
+ [![Releases](https://img.shields.io/github/downloads/phil65/githarbor/total.svg)](https://github.com/phil65/githarbor/releases)
13
+ [![Github Contributors](https://img.shields.io/github/contributors/phil65/githarbor)](https://github.com/phil65/githarbor/graphs/contributors)
14
+ [![Github Discussions](https://img.shields.io/github/discussions/phil65/githarbor)](https://github.com/phil65/githarbor/discussions)
15
+ [![Github Forks](https://img.shields.io/github/forks/phil65/githarbor)](https://github.com/phil65/githarbor/forks)
16
+ [![Github Issues](https://img.shields.io/github/issues/phil65/githarbor)](https://github.com/phil65/githarbor/issues)
17
+ [![Github Issues](https://img.shields.io/github/issues-pr/phil65/githarbor)](https://github.com/phil65/githarbor/pulls)
18
+ [![Github Watchers](https://img.shields.io/github/watchers/phil65/githarbor)](https://github.com/phil65/githarbor/watchers)
19
+ [![Github Stars](https://img.shields.io/github/stars/phil65/githarbor)](https://github.com/phil65/githarbor/stars)
20
+ [![Github Repository size](https://img.shields.io/github/repo-size/phil65/githarbor)](https://github.com/phil65/githarbor)
21
+ [![Github last commit](https://img.shields.io/github/last-commit/phil65/githarbor)](https://github.com/phil65/githarbor/commits)
22
+ [![Github release date](https://img.shields.io/github/release-date/phil65/githarbor)](https://github.com/phil65/githarbor/releases)
23
+ [![Github language count](https://img.shields.io/github/languages/count/phil65/githarbor)](https://github.com/phil65/githarbor)
24
+ [![Github commits this week](https://img.shields.io/github/commit-activity/w/phil65/githarbor)](https://github.com/phil65/githarbor)
25
+ [![Github commits this month](https://img.shields.io/github/commit-activity/m/phil65/githarbor)](https://github.com/phil65/githarbor)
26
+ [![Github commits this year](https://img.shields.io/github/commit-activity/y/phil65/githarbor)](https://github.com/phil65/githarbor)
27
+ [![Package status](https://codecov.io/gh/phil65/githarbor/branch/main/graph/badge.svg)](https://codecov.io/gh/phil65/githarbor/)
28
+ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
29
+ [![PyUp](https://pyup.io/repos/github/phil65/githarbor/shield.svg)](https://pyup.io/repos/github/phil65/githarbor/)
30
+
31
+ [Read the documentation!](https://phil65.github.io/githarbor/)
32
+
@@ -0,0 +1,153 @@
1
+
2
+ @abstractmethod
3
+ def create_repository(
4
+ self,
5
+ name: str,
6
+ private: bool = False,
7
+ description: str = "",
8
+ **kwargs,
9
+ ) -> Repository:
10
+ """Create a new repository."""
11
+
12
+ @abstractmethod
13
+ def delete_repository(self, repo_name: str) -> bool:
14
+ """Delete a repository."""
15
+
16
+ # Branch Operations
17
+ @abstractmethod
18
+ def get_branches(self, repo_name: str) -> list[Branch]:
19
+ """Get all branches in the repository."""
20
+
21
+ @abstractmethod
22
+ def create_branch(
23
+ self, repo_name: str, branch_name: str, source_branch: str
24
+ ) -> Branch:
25
+ """Create a new branch from source branch."""
26
+
27
+ @abstractmethod
28
+ def delete_branch(self, repo_name: str, branch_name: str) -> bool:
29
+ """Delete a branch."""
30
+
31
+ @abstractmethod
32
+ def protect_branch(self, repo_name: str, branch_name: str) -> bool:
33
+ """Enable branch protection."""
34
+
35
+ # Pull Request Operations
36
+ @abstractmethod
37
+ def create_pull_request(
38
+ self,
39
+ repo_name: str,
40
+ source_branch: str,
41
+ target_branch: str,
42
+ title: str,
43
+ description: str = "",
44
+ ) -> PullRequest:
45
+ """Create a new pull request."""
46
+
47
+ @abstractmethod
48
+ def get_pull_request(self, repo_name: str, pr_id: str) -> PullRequest:
49
+ """Get pull request information."""
50
+
51
+ @abstractmethod
52
+ def merge_pull_request(self, repo_name: str, pr_id: str) -> bool:
53
+ """Merge a pull request."""
54
+
55
+ @abstractmethod
56
+ def get_pull_requests(self, repo_name: str, state: str = "open") -> list[PullRequest]:
57
+ """Get all pull requests in a repository."""
58
+
59
+ # Issue Operations
60
+ @abstractmethod
61
+ def create_issue(self, repo_name: str, title: str, description: str = "") -> Issue:
62
+ """Create a new issue."""
63
+
64
+ @abstractmethod
65
+ def get_issue(self, repo_name: str, issue_id: str) -> Issue:
66
+ """Get issue information."""
67
+
68
+ @abstractmethod
69
+ def close_issue(self, repo_name: str, issue_id: str) -> bool:
70
+ """Close an issue."""
71
+
72
+ # Comment Operations
73
+ @abstractmethod
74
+ def add_comment(
75
+ self, repo_name: str, target_id: str, comment: str, target_type: str = "pr"
76
+ ) -> Comment:
77
+ """Add a comment to a PR or issue."""
78
+
79
+ @abstractmethod
80
+ def get_comments(
81
+ self, repo_name: str, target_id: str, target_type: str = "pr"
82
+ ) -> list[Comment]:
83
+ """Get comments from a PR or issue."""
84
+
85
+ # Label Operations
86
+ @abstractmethod
87
+ def create_label(
88
+ self, repo_name: str, name: str, color: str, description: str = ""
89
+ ) -> Label:
90
+ """Create a new label."""
91
+
92
+ @abstractmethod
93
+ def add_labels(
94
+ self, repo_name: str, target_id: str, labels: list[str], target_type: str = "pr"
95
+ ) -> list[Label]:
96
+ """Add labels to a PR or issue."""
97
+
98
+ # Commit Operations
99
+ @abstractmethod
100
+ def get_commits(self, repo_name: str, branch: str | None = None) -> list[Commit]:
101
+ """Get commit history."""
102
+
103
+ @abstractmethod
104
+ def get_commit(self, repo_name: str, commit_sha: str) -> Commit:
105
+ """Get specific commit information."""
106
+
107
+ # User Operations
108
+ @abstractmethod
109
+ def get_user(self) -> User:
110
+ """Get authenticated user information."""
111
+
112
+ @abstractmethod
113
+ def get_collaborators(self, repo_name: str) -> list[User]:
114
+ """Get repository collaborators."""
115
+
116
+ @abstractmethod
117
+ def add_collaborator(
118
+ self, repo_name: str, username: str, permission: str = "pull"
119
+ ) -> bool:
120
+ """Add a collaborator to repository."""
121
+
122
+ # Workflow Operations
123
+ @abstractmethod
124
+ def get_workflows(self, repo_name: str) -> list[Workflow]:
125
+ """Get all workflows in a repository."""
126
+
127
+ @abstractmethod
128
+ def get_workflow(self, repo_name: str, workflow_id: str) -> Workflow:
129
+ """Get specific workflow information."""
130
+
131
+ @abstractmethod
132
+ def get_workflow_runs(
133
+ self, repo_name: str, workflow_id: str, branch: str | None = None
134
+ ) -> list[WorkflowRun]:
135
+ """Get workflow runs."""
136
+
137
+ @abstractmethod
138
+ def trigger_workflow(
139
+ self,
140
+ repo_name: str,
141
+ workflow_id: str,
142
+ branch: str,
143
+ inputs: dict[str, Any] | None = None,
144
+ ) -> WorkflowRun:
145
+ """Trigger a workflow run."""
146
+
147
+ @abstractmethod
148
+ def cancel_workflow_run(self, repo_name: str, run_id: str) -> bool:
149
+ """Cancel a workflow run."""
150
+
151
+ @abstractmethod
152
+ def get_workflow_run_logs(self, repo_name: str, run_id: str) -> str:
153
+ """Get logs from a workflow run."""