zen-cli 0.1.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.
@@ -0,0 +1,12 @@
1
+ .venv/
2
+ dist/
3
+ build/
4
+ *.egg-info/
5
+ .mypy_cache/
6
+ .ruff_cache/
7
+ .pytest_cache/
8
+ __pycache__/
9
+ *.py[cod]
10
+ .pypirc
11
+ .coverage
12
+ htmlcov/
zen_cli-0.1.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 zen-cli authors
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.
zen_cli-0.1.1/PKG-INFO ADDED
@@ -0,0 +1,57 @@
1
+ Metadata-Version: 2.5
2
+ Name: zen-cli
3
+ Version: 0.1.1
4
+ Summary: A small command-line toolkit.
5
+ Project-URL: Homepage, https://pypi.org/project/zen-cli/
6
+ Author: zen-cli authors
7
+ License-Expression: MIT
8
+ License-File: LICENSE
9
+ Requires-Python: <3.13,>=3.12
10
+ Requires-Dist: click>=8.1
11
+ Provides-Extra: dev
12
+ Requires-Dist: build; extra == 'dev'
13
+ Requires-Dist: mypy; extra == 'dev'
14
+ Requires-Dist: pre-commit; extra == 'dev'
15
+ Requires-Dist: ruff; extra == 'dev'
16
+ Provides-Extra: release
17
+ Requires-Dist: build; extra == 'release'
18
+ Requires-Dist: twine; extra == 'release'
19
+ Description-Content-Type: text/markdown
20
+
21
+ # zen-cli
22
+
23
+ Python 3.12 command-line skeleton. All local workflow goes through `dev.py`.
24
+
25
+ ## Develop
26
+
27
+ You need Python 3.12. On Windows, if `python` is another version, use `py -3.12`:
28
+
29
+ ```text
30
+ py -3.12 dev.py init
31
+ zen --help
32
+ ```
33
+
34
+ `init` creates `.venv`, runs `pip install -U -e ".[dev]"`, and installs git hooks.
35
+
36
+ | Command | What it does |
37
+ |---|---|
38
+ | `python dev.py init` | Create the env and editable-install the CLI |
39
+ | `python dev.py lint` | Ruff fix/format and mypy |
40
+ | `python dev.py test` | unittest |
41
+ | `python dev.py bump [--part patch\|minor\|major]` | Change `version` in `pyproject.toml` |
42
+ | `python dev.py publish` | Build and upload to PyPI |
43
+ | `python dev.py release [--part patch]` | lint, test, bump, then publish |
44
+ | `python dev.py clean [--venv]` | Remove artifacts; `--venv` also deletes `.venv` |
45
+
46
+ Publish needs a PyPI API token in `TWINE_PASSWORD` (optional `TWINE_USERNAME=__token__`) or `~/.pypirc`. Do not commit credentials. PyPI rejects uploading the same version twice.
47
+
48
+ ## Jenkins
49
+
50
+ The `Jenkinsfile` only calls `dev.py`. Default runs `init`, `lint`, and `test`. Set `PUBLISH=true` to run `release`. Store the PyPI token as a Jenkins secret text credential named `pypi-api-token`.
51
+
52
+ ## Install a published build
53
+
54
+ ```text
55
+ pip install zen-cli
56
+ pipx install zen-cli
57
+ ```
@@ -0,0 +1,37 @@
1
+ # zen-cli
2
+
3
+ Python 3.12 command-line skeleton. All local workflow goes through `dev.py`.
4
+
5
+ ## Develop
6
+
7
+ You need Python 3.12. On Windows, if `python` is another version, use `py -3.12`:
8
+
9
+ ```text
10
+ py -3.12 dev.py init
11
+ zen --help
12
+ ```
13
+
14
+ `init` creates `.venv`, runs `pip install -U -e ".[dev]"`, and installs git hooks.
15
+
16
+ | Command | What it does |
17
+ |---|---|
18
+ | `python dev.py init` | Create the env and editable-install the CLI |
19
+ | `python dev.py lint` | Ruff fix/format and mypy |
20
+ | `python dev.py test` | unittest |
21
+ | `python dev.py bump [--part patch\|minor\|major]` | Change `version` in `pyproject.toml` |
22
+ | `python dev.py publish` | Build and upload to PyPI |
23
+ | `python dev.py release [--part patch]` | lint, test, bump, then publish |
24
+ | `python dev.py clean [--venv]` | Remove artifacts; `--venv` also deletes `.venv` |
25
+
26
+ Publish needs a PyPI API token in `TWINE_PASSWORD` (optional `TWINE_USERNAME=__token__`) or `~/.pypirc`. Do not commit credentials. PyPI rejects uploading the same version twice.
27
+
28
+ ## Jenkins
29
+
30
+ The `Jenkinsfile` only calls `dev.py`. Default runs `init`, `lint`, and `test`. Set `PUBLISH=true` to run `release`. Store the PyPI token as a Jenkins secret text credential named `pypi-api-token`.
31
+
32
+ ## Install a published build
33
+
34
+ ```text
35
+ pip install zen-cli
36
+ pipx install zen-cli
37
+ ```
@@ -0,0 +1,40 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.26"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "zen-cli"
7
+ version = "0.1.1"
8
+ description = "A small command-line toolkit."
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ license-files = ["LICENSE"]
12
+ requires-python = ">=3.12,<3.13"
13
+ authors = [{ name = "zen-cli authors" }]
14
+ dependencies = ["click>=8.1"]
15
+
16
+ [project.optional-dependencies]
17
+ dev = ["build", "pre-commit", "ruff", "mypy"]
18
+ release = ["build", "twine"]
19
+
20
+ [project.scripts]
21
+ zen = "zen_cli.cli:cli"
22
+
23
+ [project.urls]
24
+ Homepage = "https://pypi.org/project/zen-cli/"
25
+
26
+ [tool.hatch.build.targets.sdist]
27
+ include = ["src/zen_cli", "tests", "README.md", "LICENSE"]
28
+
29
+ [tool.ruff]
30
+ target-version = "py312"
31
+ line-length = 88
32
+ src = ["src"]
33
+
34
+ [tool.ruff.lint]
35
+ select = ["E", "F", "I", "UP", "B", "SIM", "RUF"]
36
+
37
+ [tool.mypy]
38
+ python_version = "3.12"
39
+ strict = true
40
+ files = ["src"]
@@ -0,0 +1 @@
1
+ """zen-cli package."""
@@ -0,0 +1,4 @@
1
+ from zen_cli.cli import cli
2
+
3
+ if __name__ == "__main__":
4
+ cli()
@@ -0,0 +1,12 @@
1
+ import click
2
+
3
+ from zen_cli.commands.hello import hello
4
+
5
+
6
+ @click.group(name="zen")
7
+ @click.version_option(package_name="zen-cli", prog_name="zen")
8
+ def cli() -> None:
9
+ """zen command-line interface."""
10
+
11
+
12
+ cli.add_command(hello)
@@ -0,0 +1 @@
1
+ """Click subcommands."""
@@ -0,0 +1,7 @@
1
+ import click
2
+
3
+
4
+ @click.command()
5
+ def hello() -> None:
6
+ """Print a short greeting."""
7
+ click.echo("Hello from zen.")
@@ -0,0 +1,24 @@
1
+ import unittest
2
+ from importlib.metadata import version
3
+
4
+ from click.testing import CliRunner
5
+
6
+ from zen_cli.cli import cli
7
+
8
+
9
+ class TestCli(unittest.TestCase):
10
+ def test_help(self) -> None:
11
+ result = CliRunner().invoke(cli, ["--help"])
12
+ self.assertEqual(result.exit_code, 0)
13
+ self.assertIn("Usage:", result.output)
14
+
15
+ def test_version(self) -> None:
16
+ result = CliRunner().invoke(cli, ["--version"])
17
+ self.assertEqual(result.exit_code, 0)
18
+ self.assertIn("zen, version", result.output)
19
+ self.assertIn(version("zen-cli"), result.output)
20
+
21
+ def test_hello(self) -> None:
22
+ result = CliRunner().invoke(cli, ["hello"])
23
+ self.assertEqual(result.exit_code, 0)
24
+ self.assertIn("Hello from zen.", result.output)