gitlike-commands 0.3.1__tar.gz → 0.4.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,55 @@
1
+ ---
2
+ engines:
3
+ pep8:
4
+ enabled: true
5
+ duplication:
6
+ enabled: true
7
+ config:
8
+ languages:
9
+ - "python"
10
+ fixme:
11
+ enabled: true
12
+ exclude_paths:
13
+ - config/engines.yml
14
+ pep8:
15
+ enabled: true
16
+ checks:
17
+ E111:
18
+ enabled: false
19
+ E501:
20
+ enabled: false
21
+ markdownlint:
22
+ enabled: true
23
+ checks:
24
+ MD004:
25
+ enabled: false
26
+ MD007:
27
+ enabled: false
28
+ MD013:
29
+ enabled: false
30
+ MD026:
31
+ enabled: false
32
+ MD029:
33
+ enabled: false
34
+ MD033:
35
+ enabled: false
36
+ MD034:
37
+ enabled: false
38
+ MD038:
39
+ enabled: false
40
+ shellcheck:
41
+ enabled: true
42
+ ratings:
43
+ paths:
44
+ - "bin/**/*"
45
+ - "**.py"
46
+ exclude_paths:
47
+ - "**.md"
48
+ - .bundle/
49
+ - benchmarks/**/*
50
+ - build/
51
+ - dist/
52
+ - include/**/*
53
+ - lib/**/*
54
+ - License.md
55
+ - spec/**/*
@@ -0,0 +1,2 @@
1
+ [flake8]
2
+ max-line-length = 132
@@ -0,0 +1,12 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4
+ patreon: unixorn
5
+ open_collective: # Replace with a single Open Collective username
6
+ ko_fi: unixorn
7
+ tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
+ community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ liberapay: # Replace with a single Liberapay username
10
+ issuehunt: # Replace with a single IssueHunt username
11
+ otechie: # Replace with a single Otechie username
12
+ custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,14 @@
1
+ ---
2
+ # Use `allow` to specify which dependencies to maintain
3
+
4
+ version: 2
5
+ updates:
6
+ - package-ecosystem: "github-actions"
7
+ directory: "/"
8
+ schedule:
9
+ interval: "weekly"
10
+
11
+ - package-ecosystem: "pip"
12
+ directory: "/"
13
+ schedule:
14
+ interval: "weekly"
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: Check links in Readme
3
+
4
+ on:
5
+ push:
6
+ branches: [ '*' ]
7
+ pull_request:
8
+ branches: [ '*' ]
9
+
10
+ jobs:
11
+ build:
12
+
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - uses: actions/checkout@v7
17
+ - uses: docker://dkhamsing/awesome_bot:latest
18
+ with:
19
+ args: /github/workspace/README.md --allow 500,501,502,503,504,509,521 --allow-dupe --request-delay 1 --allow-redirect --white-list https://ipfs.io,slideshare,https://img.shields.io
@@ -0,0 +1,72 @@
1
+ ---
2
+ ###########################
3
+ ###########################
4
+ ## Linter GitHub Actions ##
5
+ ###########################
6
+ ###########################
7
+ name: Lint Code Base
8
+
9
+ #
10
+ # Documentation:
11
+ # https://help.github.com/en/articles/workflow-syntax-for-github-actions
12
+ #
13
+
14
+ #############################
15
+ # Start the job on all push #
16
+ #############################
17
+ on:
18
+ push:
19
+ branches-ignore: [main]
20
+ # Remove the line above to run when pushing to main
21
+ pull_request:
22
+ branches: [main]
23
+
24
+ ###############
25
+ # Set the Job #
26
+ ###############
27
+ jobs:
28
+ build:
29
+ # Name the Job
30
+ name: Megalint Code Base
31
+ # Set the agent to run on
32
+ runs-on: ubuntu-latest
33
+
34
+ ##################
35
+ # Load all steps #
36
+ ##################
37
+ steps:
38
+ ##########################
39
+ # Checkout the code base #
40
+ ##########################
41
+ - name: Checkout Code
42
+ uses: actions/checkout@v7
43
+ with:
44
+ persist-credentials: false
45
+ # Full git history is needed to get a proper list of changed files within `super-linter`
46
+ fetch-depth: 0
47
+
48
+ ################################
49
+ # Run Linter against code base #
50
+ ################################
51
+ - name: Lint Code Base
52
+ uses: oxsecurity/megalinter/flavors/python@v10
53
+ env:
54
+ VALIDATE_ALL_CODEBASE: false
55
+ DEFAULT_BRANCH: main
56
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57
+ ACTION_ACTIONLINT_DISABLE_ERRORS: true
58
+ ACTION_ZIZMOR_DISABLE_ERRORS: true
59
+ PYTHON_FLAKE8_DISABLE_ERRORS: true
60
+ PYTHON_PYRIGHT_DISABLE_ERRORS: true
61
+ REPOSITORY_OSV_SCANNER_DISABLE_ERRORS: true
62
+ DISABLE_LINTERS: SPELL_CSPELL,PYTHON_BANDIT,PYTHON_BLACK,PYTHON_PYLINT,REPOSITORY_CHECKOV,REPOSITORY_TRIVY,REPOSITORY_GRYPE,SPELL_LYCHEE
63
+
64
+ # Upload Mega-Linter artifacts. They will be available on Github action page "Artifacts" section
65
+ - name: Archive production artifacts
66
+ if: ${{ success() || failure() }}
67
+ uses: actions/upload-artifact@v7
68
+ with:
69
+ name: Mega-Linter reports
70
+ path: |
71
+ report
72
+ mega-linter.log
@@ -0,0 +1,129 @@
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
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
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
+ target/
76
+
77
+ # Jupyter Notebook
78
+ .ipynb_checkpoints
79
+
80
+ # IPython
81
+ profile_default/
82
+ ipython_config.py
83
+
84
+ # pyenv
85
+ .python-version
86
+
87
+ # pipenv
88
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
90
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
91
+ # install all needed dependencies.
92
+ #Pipfile.lock
93
+
94
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95
+ __pypackages__/
96
+
97
+ # Celery stuff
98
+ celerybeat-schedule
99
+ celerybeat.pid
100
+
101
+ # SageMath parsed files
102
+ *.sage.py
103
+
104
+ # Environments
105
+ .env
106
+ .venv
107
+ env/
108
+ venv/
109
+ ENV/
110
+ env.bak/
111
+ venv.bak/
112
+
113
+ # Spyder project settings
114
+ .spyderproject
115
+ .spyproject
116
+
117
+ # Rope project settings
118
+ .ropeproject
119
+
120
+ # mkdocs documentation
121
+ /site
122
+
123
+ # mypy
124
+ .mypy_cache/
125
+ .dmypy.json
126
+ dmypy.json
127
+
128
+ # Pyre type checker
129
+ .pyre/
@@ -0,0 +1,5 @@
1
+ {
2
+ "MD024": {
3
+ "siblings_only": true
4
+ }
5
+ }
@@ -0,0 +1,2 @@
1
+ ACTION_ZIZMOR_UNSECURED_ENV_VARIABLES:
2
+ - GITHUB_TOKEN
@@ -0,0 +1,23 @@
1
+ # See https://pre-commit.com for more information
2
+ # See https://pre-commit.com/hooks.html for more hooks
3
+ repos:
4
+
5
+ - repo: https://github.com/astral-sh/ruff-pre-commit
6
+ # Ruff version.
7
+ rev: 'v0.17.1'
8
+ hooks:
9
+ - id: ruff
10
+ args: [--select, I, --fix]
11
+
12
+ - repo: https://github.com/pre-commit/pre-commit-hooks
13
+ rev: v6.0.0
14
+ hooks:
15
+ - id: check-added-large-files
16
+ - id: check-docstring-first
17
+ - id: check-executables-have-shebangs
18
+ - id: check-merge-conflict
19
+ - id: check-shebang-scripts-are-executable
20
+ - id: check-symlinks
21
+ - id: debug-statements
22
+ - id: end-of-file-fixer
23
+ - id: trailing-whitespace
@@ -0,0 +1,3 @@
1
+ {
2
+ "makefile.extensionOutputFolder": "./.vscode"
3
+ }
@@ -0,0 +1,110 @@
1
+ # ChangeLog
2
+
3
+ All notable changes to `gitlike-commands` are documented here, newest first.
4
+
5
+ <!-- START doctoc generated TOC please keep comment here to allow auto update -->
6
+ <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
7
+ **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
8
+
9
+ - [v0.4.0](#v040)
10
+ - [Features](#features)
11
+ - [Build tooling](#build-tooling)
12
+ - [Documentation](#documentation)
13
+ - [Tests](#tests)
14
+ - [v0.3.1 — 2026-03-31](#v031-2026-03-31)
15
+ - [Build tooling](#build-tooling-1)
16
+ - [CI](#ci)
17
+ - [v0.3.0 — 2024-01-26](#v030-2024-01-26)
18
+ - [Features](#features-1)
19
+ - [Build tooling](#build-tooling-2)
20
+ - [CI](#ci-1)
21
+ - [v0.2.1 — 2022-06-13](#v021-2022-06-13)
22
+ - [Packaging](#packaging)
23
+ - [Documentation](#documentation-1)
24
+ - [v0.1.0 — 2022-03-09](#v010-2022-03-09)
25
+ - [Features](#features-2)
26
+
27
+ <!-- END doctoc generated TOC please keep comment here to allow auto update -->
28
+
29
+ ## v0.4.0
30
+
31
+ ### Features
32
+
33
+ - `subcommand_driver` now passes `stdin`, `stdout`, and `stderr` explicitly to
34
+ the subcommand it runs with `subprocess.check_call`, via a new
35
+ `_stream_target` helper. Streams with a real file descriptor (the normal CLI
36
+ case) pass through unchanged; streams without one (a `StringIO`, a
37
+ test-capture wrapper) fall back to inheriting the parent descriptor instead
38
+ of raising. For a normal invocation this matches the previous inherit-by-
39
+ default behavior; the helper hardens the fd-less case.
40
+
41
+ ### Build tooling
42
+
43
+ - Finished the poetry-to-uv migration. `pyproject.toml` is now PEP 621:
44
+ `[project]` metadata with `requires-python = ">=3.9"`, dev dependencies
45
+ consolidated into a single `[dependency-groups]` dev group (`pytest`,
46
+ `pytest-cov`), and the build backend switched from `poetry-core` to
47
+ `hatchling`.
48
+ - Added `pytest-cov` as a dev dependency.
49
+
50
+ ### Documentation
51
+
52
+ - README `Usage` section documents the inherited `stdin`/`stdout`/`stderr`
53
+ behavior.
54
+ - README scripts-entry example now shows the PEP 621 `[project.scripts]` form
55
+ alongside the poetry form.
56
+
57
+ ### Tests
58
+
59
+ - Added unit tests covering `is_program`, `find_subcommand`, `_stream_target`,
60
+ and `subcommand_driver` (100% line coverage).
61
+ - Removed the `test_version` placeholder test, which asserted a hardcoded
62
+ version string and had to be edited on every release.
63
+
64
+ ## v0.3.1 — 2026-03-31
65
+
66
+ ### Build tooling
67
+
68
+ - Converted the project from poetry to uv.
69
+ - Cut a release to pull in accumulated dependency updates.
70
+ - Bumped the pytest requirement from `^7.4` to `^8.0`.
71
+
72
+ ### CI
73
+
74
+ - Updated mega-linter and applied its fixer suggestions.
75
+
76
+ ## v0.3.0 — 2024-01-26
77
+
78
+ ### Features
79
+
80
+ - Load the package version from installed metadata rather than hardcoding it.
81
+
82
+ ### Build tooling
83
+
84
+ - Replaced `distutils` with `shutil` (removes the deprecated dependency).
85
+ - Updated the pytest requirement from `^5.2` to `^7.4`.
86
+
87
+ ### CI
88
+
89
+ - Updated megalinter to v7 and demoted KICS findings to warnings.
90
+
91
+ ## v0.2.1 — 2022-06-13
92
+
93
+ ### Packaging
94
+
95
+ - Added classifier entries, license, and issue-tracker URL to `pyproject.toml`.
96
+
97
+ ### Documentation
98
+
99
+ - Clarified the requirements for subcommands in the README.
100
+ - Added a PyPI badge and cleaned up the license blurb.
101
+
102
+ ## v0.1.0 — 2022-03-09
103
+
104
+ ### Features
105
+
106
+ - Initial release. Code refactored out of
107
+ [thelogrus](https://github.com/unixorn/thelogrus/) so consumers depend only on
108
+ the Python standard library.
109
+ - `subcommand_driver`, `find_subcommand`, and `is_program` for building
110
+ git-style subcommand dispatch.
@@ -0,0 +1,13 @@
1
+ FROM unixorn/debian-py3
2
+
3
+ RUN mkdir -p /data && \
4
+ mkdir -p /config && \
5
+ mkdir -p /usr/local/bin
6
+
7
+ COPY tests/foo-bar /usr/local/bin
8
+ COPY dist/*.whl /data
9
+ RUN pip install --no-cache-dir --disable-pip-version-check /data/*.whl
10
+
11
+ # Use bash -l so that we pick up the REQUESTS_CA_BUNDLE value from
12
+ # /etc/profile.d/python-enable-all-ssl-certs.sh
13
+ CMD ["bash", "-l"]
@@ -0,0 +1,57 @@
1
+ h: help
2
+ help:
3
+ @echo "Options:"
4
+ @echo "format: Reformat all python files with ruff"
5
+ @echo "tests: Run tests with nosetest"
6
+ @echo "verbose_tests: Run tests with nosetest -v"
7
+
8
+ docker: local
9
+ f: format
10
+ t: test
11
+ i: image
12
+ image: local
13
+
14
+ format: format_code format_tests
15
+
16
+ fix_python_imports:
17
+ ruff check --select I --fix gitlike_commands/*.py
18
+
19
+ lint:
20
+ @echo "Linting with ruff"
21
+ ruff check gitlike_commands/*.py
22
+
23
+ fixup:
24
+ @echo "Fixing up with ruff"
25
+ ruff check --fix --show-fixes gitlike_commands/*.py
26
+
27
+ format_code: fix_python_imports lint fixup
28
+ ruff format gitlike_commands/*.py
29
+
30
+ format_tests:
31
+ ruff format tests/*.py
32
+ ruff check --fix --show-fixes tests/*.py
33
+ ruff check --select I --fix tests/*.py
34
+
35
+ tests: test
36
+ test:
37
+ nosetests
38
+
39
+ verbose_tests: verbose_test
40
+ verbose_test:
41
+ nosetests -v
42
+
43
+ wheel: clean format
44
+ uv build
45
+
46
+ local: wheel
47
+ docker buildx build --load -t unixorn/gitlike-commands .
48
+
49
+ fatimage: wheel
50
+ docker buildx build --platform linux/arm64,linux/amd64 --push -t unixorn/gitlike-commands .
51
+ make local
52
+
53
+ clean:
54
+ rm -f dist/*
55
+
56
+ fat:
57
+ make fatimage
@@ -0,0 +1 @@
1
+ [![Code Climate](https://codeclimate.com/github/unixorn/gitlike-commands/badges/gpa.svg)](https://codeclimate.com/github/unixorn/gitlike-commands)
@@ -1,27 +1,28 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: gitlike-commands
3
- Version: 0.3.1
3
+ Version: 0.4.0
4
4
  Summary: Makes driver scripts that enable git-like commands so that foo bar will run foo-bar
5
- License: Apache-2.0
5
+ Project-URL: Homepage, https://github.com/unixorn/gitlike-commands
6
+ Project-URL: Repository, https://github.com/unixorn/gitlike-commands
7
+ Project-URL: Bug Tracker, https://github.com/unixorn/gitlike-commands/issues
8
+ Author-email: Joe Block <jpb@unixorn.net>
9
+ License-Expression: Apache-2.0
6
10
  License-File: LICENSE
7
- Author: Joe Block
8
- Author-email: jpb@unixorn.net
9
- Requires-Python: >=3.9,<4.0
10
- Classifier: License :: OSI Approved :: Apache Software License
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.9
13
- Classifier: Programming Language :: Python :: 3.10
14
- Classifier: Programming Language :: Python :: 3.11
15
- Classifier: Programming Language :: Python :: 3.12
16
- Classifier: Programming Language :: Python :: 3.13
17
- Classifier: Programming Language :: Python :: 3.14
18
11
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
12
  Classifier: Topic :: System :: System Shells
20
- Project-URL: Bug Tracker, https://github.com/unixorn/gitlike-commands/issues
21
- Project-URL: Homepage, https://github.com/unixorn/gitlike-commands
22
- Project-URL: Repository, https://github.com/unixorn/gitlike-commands
13
+ Requires-Python: >=3.9
23
14
  Description-Content-Type: text/markdown
24
15
 
16
+ <!-- START doctoc generated TOC please keep comment here to allow auto update -->
17
+ <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
18
+ **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
19
+
20
+ - [gitlike-commands](#gitlike-commands)
21
+ - [Background](#background)
22
+ - [Usage](#usage)
23
+
24
+ <!-- END doctoc generated TOC please keep comment here to allow auto update -->
25
+
25
26
  # gitlike-commands
26
27
 
27
28
  [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/license/apache-2-0/)
@@ -52,12 +53,21 @@ if __name__ == '__main__':
52
53
 
53
54
  Running `foo bar baz` will look for a `foo-bar-baz` script, and if present in your `$PATH`, run it. If there is no `foo-bar-baz`, it will look for `foo-bar`, and if it finds that, run `foo-bar baz`.
54
55
 
55
- If you're using poetry in your python project, you can add a gitlike driver as a scripts entry:
56
+ You can add a gitlike driver as a scripts entry in your `pyproject.toml`. With a
57
+ PEP 621 layout (uv, hatch, pdm, and other standards-based tools):
58
+
59
+ ```toml
60
+ [project.scripts]
61
+ gitalike-demo = "gitlike_commands:subcommand_driver"
62
+ ```
63
+
64
+ Or, if your project still uses poetry:
56
65
 
57
66
  ```toml
58
67
  [tool.poetry.scripts]
59
68
  gitalike-demo = "gitlike_commands:subcommand_driver"
60
69
  ```
61
70
 
62
- The subcommands can be written in any language, the only requirements are that they are marked executable and follow the `foo-something` naming convention.
71
+ The subcommand inherits the driver's `stdin`, `stdout`, and `stderr`, so piped input (`echo data | foo bar`), interactive prompts, and output all pass through to the subcommand unchanged.
63
72
 
73
+ The subcommands can be written in any language, the only requirements are that they are marked executable and follow the `foo-something` naming convention.
@@ -1,3 +1,13 @@
1
+ <!-- START doctoc generated TOC please keep comment here to allow auto update -->
2
+ <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
3
+ **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
4
+
5
+ - [gitlike-commands](#gitlike-commands)
6
+ - [Background](#background)
7
+ - [Usage](#usage)
8
+
9
+ <!-- END doctoc generated TOC please keep comment here to allow auto update -->
10
+
1
11
  # gitlike-commands
2
12
 
3
13
  [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/license/apache-2-0/)
@@ -28,11 +38,21 @@ if __name__ == '__main__':
28
38
 
29
39
  Running `foo bar baz` will look for a `foo-bar-baz` script, and if present in your `$PATH`, run it. If there is no `foo-bar-baz`, it will look for `foo-bar`, and if it finds that, run `foo-bar baz`.
30
40
 
31
- If you're using poetry in your python project, you can add a gitlike driver as a scripts entry:
41
+ You can add a gitlike driver as a scripts entry in your `pyproject.toml`. With a
42
+ PEP 621 layout (uv, hatch, pdm, and other standards-based tools):
43
+
44
+ ```toml
45
+ [project.scripts]
46
+ gitalike-demo = "gitlike_commands:subcommand_driver"
47
+ ```
48
+
49
+ Or, if your project still uses poetry:
32
50
 
33
51
  ```toml
34
52
  [tool.poetry.scripts]
35
53
  gitalike-demo = "gitlike_commands:subcommand_driver"
36
54
  ```
37
55
 
56
+ The subcommand inherits the driver's `stdin`, `stdout`, and `stderr`, so piped input (`echo data | foo bar`), interactive prompts, and output all pass through to the subcommand unchanged.
57
+
38
58
  The subcommands can be written in any language, the only requirements are that they are marked executable and follow the `foo-something` naming convention.