mud-git 1.0.0__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.
@@ -0,0 +1,34 @@
1
+ name: Publish Python Package
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*.*.*'
7
+
8
+ jobs:
9
+ build:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Check out the repository
14
+ uses: actions/checkout@v3
15
+
16
+ - name: Set up Python
17
+ uses: actions/setup-python@v4
18
+ with:
19
+ python-version: '3.12'
20
+
21
+ - name: Install dependencies
22
+ run: |
23
+ python -m pip install --upgrade pip
24
+ pip install build twine
25
+
26
+ - name: Build the package
27
+ run: python -m build
28
+
29
+ - name: Publish to PyPI
30
+ env:
31
+ TWINE_USERNAME: "__token__"
32
+ TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
33
+ run: |
34
+ twine upload dist/*
@@ -0,0 +1,98 @@
1
+ name: Test projects integrity
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ branches:
9
+ - master
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ test:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - name: Set up Python 3.12
20
+ uses: actions/setup-python@v3
21
+ with:
22
+ python-version: "3.12"
23
+ - name: Install dependencies and set up the environment
24
+ run: |
25
+ python -m pip install -r requirements.txt
26
+ python -m pip install requests build
27
+
28
+ python -m build
29
+ pip install dist/*.whl
30
+ - name: Create repositories
31
+ run: |
32
+ git config --global user.name "Jasur Sadikov"
33
+ git config --global user.email "test@test.com"
34
+
35
+ for i in {1..3}; do
36
+ mkdir "repo_$i"
37
+ cd "repo_$i"
38
+ echo "repo_$i" > test.txt
39
+ git init
40
+ git add .
41
+ git commit -m "Initial commit"
42
+ cd ..
43
+ done
44
+ - name: Initialize
45
+ run: |
46
+ mud init
47
+ - name: Test remove by path
48
+ run: |
49
+ for i in {1..3}; do
50
+ mud remove repo_$i
51
+ done
52
+ - name: Test add with label
53
+ run: |
54
+ for i in {1..3}; do
55
+ mud add label_$i repo_$i
56
+ done
57
+ mud lb
58
+ - name: Test remove label
59
+ run: |
60
+ for i in {1..3}; do
61
+ mud remove label_$i
62
+ done
63
+ mud lb
64
+ - name: Add all repositories with labels
65
+ run: |
66
+ rm .mudconfig
67
+ mud init
68
+ for i in {1..3}; do
69
+ mud add label_$i repo_$i
70
+ done
71
+ mud lb
72
+ - name: Test default commands
73
+ run: |
74
+ echo "mud labels"
75
+ mud labels
76
+ echo "mud status"
77
+ mud status
78
+ echo "mud info"
79
+ mud info
80
+ echo "mud log"
81
+ mud log
82
+ echo "mud branch"
83
+ mud branch
84
+ echo "mud tags"
85
+ mud tags
86
+ - name: Test custom command
87
+ run: |
88
+ mud echo "Hello world"
89
+ mud -a echo "Hello world"
90
+ mud -a -t echo "Hello world"
91
+ mud -t echo "Hello world"
92
+ mud -t -c='echo "Hello" && echo "world"'
93
+ - name: Test label filtering
94
+ run: mud -l=label_1 echo "Hello world"
95
+ - name: Test branch filtering
96
+ run: |
97
+ mud -l=label_1 git checkout -b develop
98
+ mud -b=develop echo "Hello world"
@@ -0,0 +1,160 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Cython debug symbols
153
+ cython_debug/
154
+
155
+ # PyCharm
156
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
159
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
160
+ .idea/
mud_git-1.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Jasur Sadikov
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.
mud_git-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,110 @@
1
+ Metadata-Version: 2.3
2
+ Name: mud-git
3
+ Version: 1.0.0
4
+ Summary: 🗃️ Multi repository git utility. Manage multiple git-repositories simultaneously.
5
+ Project-URL: Homepage, https://github.com/jasursadikov/mud
6
+ Project-URL: Issues, https://github.com/jasursadikov/mud/issues
7
+ Author-email: Jasur Sadikov <jasur@sadikoff.com>
8
+ License-File: LICENSE
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3
12
+ Requires-Python: >=3.12
13
+ Requires-Dist: prettytable
14
+ Description-Content-Type: text/markdown
15
+
16
+ # mud
17
+
18
+ ![Version](https://img.shields.io/pypi/pyversions/mud?logo=python)
19
+ ![Build Status](https://img.shields.io/github/actions/workflow/status/jasursadikov/mud/test.yaml?logo=github)
20
+ ![Pulbish](https://img.shields.io/github/actions/workflow/status/jasursadikov/mud/publish.yaml?logo=github)
21
+
22
+ ![Demo](./img.png)
23
+
24
+ mud is a multi-directory git runner which allows you to run git commands in a multiple repositories. It has multiple powerful tools filtering tools and support of aliasing. This tool is not limited to git commands only, you can run any commands as you wish, but this tool was primarily designed to be used with git, so each referenced directory should have `.git`.
25
+
26
+ ## Installing
27
+ ```bash
28
+ pip install mud
29
+ ```
30
+
31
+ ## Getting started
32
+
33
+ 1. Run `mud config` to start interactive wizard which help you to set the preferable settings. Check [settings](#settings) section for more. At the end, `.mudsettings` file will appear at your home directory that you can alter in the future.
34
+ 2. Locate to your preferable directory with repositories.
35
+ 3. Run `mud init` command to create `.mudconfig` file. This file is important to keep references to repositories. All repositories in current dictionary would be included to `.mudconfig`.
36
+ 4. Optional: Run [`mud --set-global`](#global-mudconfig) to make current configuration default and reachable from any directory.
37
+
38
+ All entries are stored in `.mudconfig` in TSV format. After making your first entry, you can open `.mudconfig` in a text editor and modify it according to your needs.
39
+
40
+ ### Global .mudconfig
41
+ - `mud --set-global` - sets current `.mudconfig` as a global configuration, so it would be used as a fallback configuration to run from any directory.
42
+
43
+ ## Using
44
+
45
+ ### Commands
46
+ `mud <FILTER> <COMMAND>` will execute bash command across all repositories. To filter repositories check [arguments](#arguments) section.
47
+
48
+ - `mud info`/`mud i` - displays branch divergence and working directory changes.
49
+ - `mud status`/`mud st` - displays working directory changes.
50
+ - `mud log`/`mud l` - displays latest commit message, it's time and it's author.
51
+ - `mud labels`/`mud lb` - displays mud labels across repositories.
52
+ - `mud branch`/`mud br` - displays all branches in repositories.
53
+ - `mud remote-branch`/`mud rbr` - displays all branches in repositories.
54
+ - `mud tags`/`mud t` - displays git tags in repositories.
55
+
56
+ ### Arguments
57
+ - `-l=<label>` or `--label=<label>` - includes repositories with provided label.
58
+ - `-nl=<label>` or `--not-label=<label>` - excludes repositories with provided label.
59
+ - `-b=<branch>` or `--branch=<branch>` - includes repositories with provided branch.
60
+ - `-nb=<branch>` or `--not-branch=<branch>` - excludes repositories with provided label.
61
+ - `-c` or `--command` - explicit command argument. Use this whenever you're trying to run a complex command.
62
+ - `-m` or `--modified` - filters out modified repositories.
63
+ - `-d` or `--diverged` - filters repositories with diverged branches.
64
+ - `-t` or `--table` - toggles default table view setting for run.
65
+ - `-a` or `--async` - toggles asynchronous run feature.
66
+
67
+ Example:
68
+
69
+ ```bash
70
+ mud -b=master -d git pull
71
+ # Filters out all repos with master branch and diverged branches and then runs pull command.
72
+ ```
73
+
74
+ ## Settings
75
+
76
+ Settings are stored in your home directory in `.mudsettings` file.
77
+
78
+ - `run_async = 0/1` - enables asynchronous commands.
79
+ - `run_table = 0/1` - enables asynchronous commands in a table view. Requires `run_async`.
80
+ - `nerd_fonts = 0/1` - use nerd fonts in the output 💅.
81
+ - `show_borders = 0/1` - enables borders in table view.
82
+ - `collapse_paths = 0/1` - simplifies branch name in the branch view.
83
+ - `config_path = /home/user/path/.mudconfig` - this is set up by `mud --set-global` [command](#global-mudconfig).
84
+
85
+ ### Aliases
86
+
87
+ You can create your own aliases for commands. To create your own aliases, edit .mudsettings file, `[alias]` section. .mudsettings has the following aliases by default:
88
+
89
+ ```ini
90
+ [alias]
91
+ to = git checkout
92
+ fetch = git fetch
93
+ pull = git pull
94
+ push = git push
95
+ ```
96
+
97
+ ## Labeling
98
+
99
+ You can modify your .mudconfig file by using following commands:
100
+
101
+ ### Adding and labeling repositories
102
+
103
+ - `mud add <label> <path>` - adds path with an optional label.
104
+ - `mud add <path>` - adds path without a label.
105
+
106
+ ### Removing labels and repositories
107
+
108
+ - `mud remove <label>` - removes label from all directories.
109
+ - `mud remove <path>` - removes directory with a specified path.
110
+ - `mud remove <label> <path>` - removes label from a directory.
@@ -0,0 +1,95 @@
1
+ # mud
2
+
3
+ ![Version](https://img.shields.io/pypi/pyversions/mud?logo=python)
4
+ ![Build Status](https://img.shields.io/github/actions/workflow/status/jasursadikov/mud/test.yaml?logo=github)
5
+ ![Pulbish](https://img.shields.io/github/actions/workflow/status/jasursadikov/mud/publish.yaml?logo=github)
6
+
7
+ ![Demo](./img.png)
8
+
9
+ mud is a multi-directory git runner which allows you to run git commands in a multiple repositories. It has multiple powerful tools filtering tools and support of aliasing. This tool is not limited to git commands only, you can run any commands as you wish, but this tool was primarily designed to be used with git, so each referenced directory should have `.git`.
10
+
11
+ ## Installing
12
+ ```bash
13
+ pip install mud
14
+ ```
15
+
16
+ ## Getting started
17
+
18
+ 1. Run `mud config` to start interactive wizard which help you to set the preferable settings. Check [settings](#settings) section for more. At the end, `.mudsettings` file will appear at your home directory that you can alter in the future.
19
+ 2. Locate to your preferable directory with repositories.
20
+ 3. Run `mud init` command to create `.mudconfig` file. This file is important to keep references to repositories. All repositories in current dictionary would be included to `.mudconfig`.
21
+ 4. Optional: Run [`mud --set-global`](#global-mudconfig) to make current configuration default and reachable from any directory.
22
+
23
+ All entries are stored in `.mudconfig` in TSV format. After making your first entry, you can open `.mudconfig` in a text editor and modify it according to your needs.
24
+
25
+ ### Global .mudconfig
26
+ - `mud --set-global` - sets current `.mudconfig` as a global configuration, so it would be used as a fallback configuration to run from any directory.
27
+
28
+ ## Using
29
+
30
+ ### Commands
31
+ `mud <FILTER> <COMMAND>` will execute bash command across all repositories. To filter repositories check [arguments](#arguments) section.
32
+
33
+ - `mud info`/`mud i` - displays branch divergence and working directory changes.
34
+ - `mud status`/`mud st` - displays working directory changes.
35
+ - `mud log`/`mud l` - displays latest commit message, it's time and it's author.
36
+ - `mud labels`/`mud lb` - displays mud labels across repositories.
37
+ - `mud branch`/`mud br` - displays all branches in repositories.
38
+ - `mud remote-branch`/`mud rbr` - displays all branches in repositories.
39
+ - `mud tags`/`mud t` - displays git tags in repositories.
40
+
41
+ ### Arguments
42
+ - `-l=<label>` or `--label=<label>` - includes repositories with provided label.
43
+ - `-nl=<label>` or `--not-label=<label>` - excludes repositories with provided label.
44
+ - `-b=<branch>` or `--branch=<branch>` - includes repositories with provided branch.
45
+ - `-nb=<branch>` or `--not-branch=<branch>` - excludes repositories with provided label.
46
+ - `-c` or `--command` - explicit command argument. Use this whenever you're trying to run a complex command.
47
+ - `-m` or `--modified` - filters out modified repositories.
48
+ - `-d` or `--diverged` - filters repositories with diverged branches.
49
+ - `-t` or `--table` - toggles default table view setting for run.
50
+ - `-a` or `--async` - toggles asynchronous run feature.
51
+
52
+ Example:
53
+
54
+ ```bash
55
+ mud -b=master -d git pull
56
+ # Filters out all repos with master branch and diverged branches and then runs pull command.
57
+ ```
58
+
59
+ ## Settings
60
+
61
+ Settings are stored in your home directory in `.mudsettings` file.
62
+
63
+ - `run_async = 0/1` - enables asynchronous commands.
64
+ - `run_table = 0/1` - enables asynchronous commands in a table view. Requires `run_async`.
65
+ - `nerd_fonts = 0/1` - use nerd fonts in the output 💅.
66
+ - `show_borders = 0/1` - enables borders in table view.
67
+ - `collapse_paths = 0/1` - simplifies branch name in the branch view.
68
+ - `config_path = /home/user/path/.mudconfig` - this is set up by `mud --set-global` [command](#global-mudconfig).
69
+
70
+ ### Aliases
71
+
72
+ You can create your own aliases for commands. To create your own aliases, edit .mudsettings file, `[alias]` section. .mudsettings has the following aliases by default:
73
+
74
+ ```ini
75
+ [alias]
76
+ to = git checkout
77
+ fetch = git fetch
78
+ pull = git pull
79
+ push = git push
80
+ ```
81
+
82
+ ## Labeling
83
+
84
+ You can modify your .mudconfig file by using following commands:
85
+
86
+ ### Adding and labeling repositories
87
+
88
+ - `mud add <label> <path>` - adds path with an optional label.
89
+ - `mud add <path>` - adds path without a label.
90
+
91
+ ### Removing labels and repositories
92
+
93
+ - `mud remove <label>` - removes label from all directories.
94
+ - `mud remove <path>` - removes directory with a specified path.
95
+ - `mud remove <label> <path>` - removes label from a directory.
mud_git-1.0.0/img.png ADDED
Binary file
@@ -0,0 +1,30 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "mud-git"
7
+ version = "1.0.0"
8
+ authors = [{ name = "Jasur Sadikov", email = "jasur@sadikoff.com" }]
9
+ description = "🗃️ Multi repository git utility. Manage multiple git-repositories simultaneously."
10
+ readme = "README.md"
11
+ requires-python = ">=3.12"
12
+ classifiers = [
13
+ "Programming Language :: Python :: 3",
14
+ "License :: OSI Approved :: MIT License",
15
+ "Operating System :: OS Independent",
16
+ ]
17
+ dependencies = ["prettytable"]
18
+
19
+ [project.urls]
20
+ Homepage = "https://github.com/jasursadikov/mud"
21
+ Issues = "https://github.com/jasursadikov/mud/issues"
22
+
23
+ [tool.hatch.build.targets.wheel]
24
+ packages = ["src/mud"]
25
+
26
+ [tool.hatch.version]
27
+ path = "src/mud/__about__.py"
28
+
29
+ [project.scripts]
30
+ mud = "mud:run"
@@ -0,0 +1 @@
1
+ prettytable
@@ -0,0 +1 @@
1
+ __version__ = "1.0.0"
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env python3
2
+
3
+ import sys
4
+
5
+ from mud import utils, settings
6
+ from mud.app import App
7
+
8
+ def run():
9
+ try:
10
+ utils.settings = settings.Settings(utils.SETTINGS_FILE_NAME)
11
+
12
+ app = App()
13
+ app.run()
14
+ except KeyboardInterrupt:
15
+ utils.print_error('Stopped by user.', 0)
16
+
17
+
18
+ if __name__ == '__main__':
19
+ run()