stoopid 0.1.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.
- stoopid-0.1.0/LICENSE +21 -0
- stoopid-0.1.0/PKG-INFO +89 -0
- stoopid-0.1.0/README.md +66 -0
- stoopid-0.1.0/pyproject.toml +72 -0
- stoopid-0.1.0/pyproject.toml.orig +59 -0
- stoopid-0.1.0/src/stoopid/__init__.py +9 -0
- stoopid-0.1.0/src/stoopid/__main__.py +5 -0
- stoopid-0.1.0/src/stoopid/cli.py +39 -0
- stoopid-0.1.0/src/stoopid/core.py +25 -0
- stoopid-0.1.0/src/stoopid/py.typed +0 -0
stoopid-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Simon Harvey
|
|
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.
|
stoopid-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: stoopid
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A deliberately meaningless package used to exercise a fully automated release pipeline.
|
|
5
|
+
Author: Simon Harvey
|
|
6
|
+
Author-email: Simon Harvey <simon.harvey.86@gmail.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Classifier: Typing :: Typed
|
|
18
|
+
Requires-Python: >=3.10
|
|
19
|
+
Project-URL: Homepage, https://github.com/mighty-muffin/stoopid
|
|
20
|
+
Project-URL: Changelog, https://github.com/mighty-muffin/stoopid/blob/main/CHANGELOG.md
|
|
21
|
+
Project-URL: Issues, https://github.com/mighty-muffin/stoopid/issues
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
# stoopid
|
|
25
|
+
|
|
26
|
+
[](https://github.com/mighty-muffin/stoopid/actions/workflows/ci.yml)
|
|
27
|
+
[](https://github.com/mighty-muffin/stoopid/actions/workflows/release.yml)
|
|
28
|
+
[](https://pypi.org/project/stoopid/)
|
|
29
|
+
[](https://pypi.org/project/stoopid/)
|
|
30
|
+
[](LICENSE)
|
|
31
|
+
|
|
32
|
+
A deliberately meaningless Python package. The code does nothing useful; it
|
|
33
|
+
exists so the **release pipeline around it** can be tested end to end. See
|
|
34
|
+
[`specs/0001-stoopid-design.md`](specs/0001-stoopid-design.md) for the full design.
|
|
35
|
+
|
|
36
|
+
## Install
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
pip install stoopid # latest release (PyPI)
|
|
40
|
+
pip install --pre --no-deps \
|
|
41
|
+
--index-url https://test.pypi.org/simple/ stoopid # latest dev build (TestPyPI)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
```console
|
|
47
|
+
$ stoopid add 1 2
|
|
48
|
+
3
|
|
49
|
+
$ stoopid mul 3 4
|
|
50
|
+
12
|
|
51
|
+
$ stoopid fib 10
|
|
52
|
+
55
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
>>> import stoopid
|
|
57
|
+
>>> stoopid.fibonacci(10)
|
|
58
|
+
55
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Development
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
uv sync # create .venv with dev tools
|
|
65
|
+
prek install # git hooks (ruff, ty, uv lock check, …)
|
|
66
|
+
uv run pytest # tests, 100 % coverage enforced
|
|
67
|
+
prek run --all-files # every check CI runs
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## How releasing works
|
|
71
|
+
|
|
72
|
+
1. Every PR title must follow [Conventional Commits](https://www.conventionalcommits.org/)
|
|
73
|
+
(`feat: …`, `fix: …`, `feat!: …`, `chore: …`). PRs are squash-merged, so the
|
|
74
|
+
title becomes the commit on `main`.
|
|
75
|
+
2. On each push to `main`, [release-please](https://github.com/googleapis/release-please)
|
|
76
|
+
keeps a **release PR** open with the next version and the `CHANGELOG.md` entry.
|
|
77
|
+
Until 1.0: `feat!` → minor, `feat`/`fix` → patch.
|
|
78
|
+
3. The same push publishes a dev build `X.Y.(Z+1).devN` to TestPyPI.
|
|
79
|
+
4. **Merging the release PR** tags `vX.Y.Z`, creates the GitHub Release, builds
|
|
80
|
+
once, publishes to TestPyPI, smoke-tests the install, then publishes to PyPI
|
|
81
|
+
(Trusted Publishing + PEP 740 attestations, no API tokens).
|
|
82
|
+
5. To force a version (e.g. 1.0.0), add `"release-as": "1.0.0"` to the package in
|
|
83
|
+
`release-please-config.json` through a PR, then remove it after the release.
|
|
84
|
+
|
|
85
|
+
Dependencies, Actions and hooks are updated weekly by Renovate; non-major
|
|
86
|
+
updates merge themselves when CI is green.
|
|
87
|
+
|
|
88
|
+
One-time setup (PyPI publishers, release GitHub App, Renovate):
|
|
89
|
+
`scripts/setup-wizard.sh`.
|
stoopid-0.1.0/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# stoopid
|
|
2
|
+
|
|
3
|
+
[](https://github.com/mighty-muffin/stoopid/actions/workflows/ci.yml)
|
|
4
|
+
[](https://github.com/mighty-muffin/stoopid/actions/workflows/release.yml)
|
|
5
|
+
[](https://pypi.org/project/stoopid/)
|
|
6
|
+
[](https://pypi.org/project/stoopid/)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
|
|
9
|
+
A deliberately meaningless Python package. The code does nothing useful; it
|
|
10
|
+
exists so the **release pipeline around it** can be tested end to end. See
|
|
11
|
+
[`specs/0001-stoopid-design.md`](specs/0001-stoopid-design.md) for the full design.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
pip install stoopid # latest release (PyPI)
|
|
17
|
+
pip install --pre --no-deps \
|
|
18
|
+
--index-url https://test.pypi.org/simple/ stoopid # latest dev build (TestPyPI)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```console
|
|
24
|
+
$ stoopid add 1 2
|
|
25
|
+
3
|
|
26
|
+
$ stoopid mul 3 4
|
|
27
|
+
12
|
|
28
|
+
$ stoopid fib 10
|
|
29
|
+
55
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
>>> import stoopid
|
|
34
|
+
>>> stoopid.fibonacci(10)
|
|
35
|
+
55
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Development
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
uv sync # create .venv with dev tools
|
|
42
|
+
prek install # git hooks (ruff, ty, uv lock check, …)
|
|
43
|
+
uv run pytest # tests, 100 % coverage enforced
|
|
44
|
+
prek run --all-files # every check CI runs
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## How releasing works
|
|
48
|
+
|
|
49
|
+
1. Every PR title must follow [Conventional Commits](https://www.conventionalcommits.org/)
|
|
50
|
+
(`feat: …`, `fix: …`, `feat!: …`, `chore: …`). PRs are squash-merged, so the
|
|
51
|
+
title becomes the commit on `main`.
|
|
52
|
+
2. On each push to `main`, [release-please](https://github.com/googleapis/release-please)
|
|
53
|
+
keeps a **release PR** open with the next version and the `CHANGELOG.md` entry.
|
|
54
|
+
Until 1.0: `feat!` → minor, `feat`/`fix` → patch.
|
|
55
|
+
3. The same push publishes a dev build `X.Y.(Z+1).devN` to TestPyPI.
|
|
56
|
+
4. **Merging the release PR** tags `vX.Y.Z`, creates the GitHub Release, builds
|
|
57
|
+
once, publishes to TestPyPI, smoke-tests the install, then publishes to PyPI
|
|
58
|
+
(Trusted Publishing + PEP 740 attestations, no API tokens).
|
|
59
|
+
5. To force a version (e.g. 1.0.0), add `"release-as": "1.0.0"` to the package in
|
|
60
|
+
`release-please-config.json` through a PR, then remove it after the release.
|
|
61
|
+
|
|
62
|
+
Dependencies, Actions and hooks are updated weekly by Renovate; non-major
|
|
63
|
+
updates merge themselves when CI is green.
|
|
64
|
+
|
|
65
|
+
One-time setup (PyPI publishers, release GitHub App, Renovate):
|
|
66
|
+
`scripts/setup-wizard.sh`.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "stoopid"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "A deliberately meaningless package used to exercise a fully automated release pipeline."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
requires-python = ">=3.10"
|
|
9
|
+
dependencies = []
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Development Status :: 3 - Alpha",
|
|
12
|
+
"Programming Language :: Python :: 3",
|
|
13
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
14
|
+
"Programming Language :: Python :: 3.10",
|
|
15
|
+
"Programming Language :: Python :: 3.11",
|
|
16
|
+
"Programming Language :: Python :: 3.12",
|
|
17
|
+
"Programming Language :: Python :: 3.13",
|
|
18
|
+
"Programming Language :: Python :: 3.14",
|
|
19
|
+
"Typing :: Typed",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
[[project.authors]]
|
|
23
|
+
name = "Simon Harvey"
|
|
24
|
+
email = "simon.harvey.86@gmail.com"
|
|
25
|
+
|
|
26
|
+
[project.urls]
|
|
27
|
+
Homepage = "https://github.com/mighty-muffin/stoopid"
|
|
28
|
+
Changelog = "https://github.com/mighty-muffin/stoopid/blob/main/CHANGELOG.md"
|
|
29
|
+
Issues = "https://github.com/mighty-muffin/stoopid/issues"
|
|
30
|
+
|
|
31
|
+
[project.scripts]
|
|
32
|
+
stoopid = "stoopid.cli:main"
|
|
33
|
+
|
|
34
|
+
[dependency-groups]
|
|
35
|
+
dev = [
|
|
36
|
+
"pytest>=9.2.0",
|
|
37
|
+
"pytest-cov>=7.1.0",
|
|
38
|
+
"ruff>=0.17.3",
|
|
39
|
+
"ty>=0.0.97",
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
[build-system]
|
|
43
|
+
requires = ["uv_build>=0.13.7,<0.14"]
|
|
44
|
+
build-backend = "uv_build"
|
|
45
|
+
|
|
46
|
+
[tool.ruff]
|
|
47
|
+
line-length = 100
|
|
48
|
+
target-version = "py310"
|
|
49
|
+
|
|
50
|
+
[tool.ruff.lint]
|
|
51
|
+
select = [
|
|
52
|
+
"E",
|
|
53
|
+
"W",
|
|
54
|
+
"F",
|
|
55
|
+
"I",
|
|
56
|
+
"B",
|
|
57
|
+
"UP",
|
|
58
|
+
"SIM",
|
|
59
|
+
"RUF",
|
|
60
|
+
"PT",
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
[tool.ty.environment]
|
|
64
|
+
python-version = "3.10"
|
|
65
|
+
|
|
66
|
+
[tool.pytest.ini_options]
|
|
67
|
+
addopts = "--strict-markers --cov=stoopid --cov-report=term-missing --cov-fail-under=100"
|
|
68
|
+
testpaths = ["tests"]
|
|
69
|
+
|
|
70
|
+
[tool.coverage.run]
|
|
71
|
+
branch = true
|
|
72
|
+
source = ["stoopid"]
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "stoopid"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "A deliberately meaningless package used to exercise a fully automated release pipeline."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
authors = [{ name = "Simon Harvey", email = "simon.harvey.86@gmail.com" }]
|
|
9
|
+
requires-python = ">=3.10"
|
|
10
|
+
dependencies = []
|
|
11
|
+
classifiers = [
|
|
12
|
+
"Development Status :: 3 - Alpha",
|
|
13
|
+
"Programming Language :: Python :: 3",
|
|
14
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
15
|
+
"Programming Language :: Python :: 3.10",
|
|
16
|
+
"Programming Language :: Python :: 3.11",
|
|
17
|
+
"Programming Language :: Python :: 3.12",
|
|
18
|
+
"Programming Language :: Python :: 3.13",
|
|
19
|
+
"Programming Language :: Python :: 3.14",
|
|
20
|
+
"Typing :: Typed",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[project.urls]
|
|
24
|
+
Homepage = "https://github.com/mighty-muffin/stoopid"
|
|
25
|
+
Changelog = "https://github.com/mighty-muffin/stoopid/blob/main/CHANGELOG.md"
|
|
26
|
+
Issues = "https://github.com/mighty-muffin/stoopid/issues"
|
|
27
|
+
|
|
28
|
+
[project.scripts]
|
|
29
|
+
stoopid = "stoopid.cli:main"
|
|
30
|
+
|
|
31
|
+
[dependency-groups]
|
|
32
|
+
dev = [
|
|
33
|
+
"pytest>=9.2.0",
|
|
34
|
+
"pytest-cov>=7.1.0",
|
|
35
|
+
"ruff>=0.17.3",
|
|
36
|
+
"ty>=0.0.97",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[build-system]
|
|
40
|
+
requires = ["uv_build>=0.13.7,<0.14"]
|
|
41
|
+
build-backend = "uv_build"
|
|
42
|
+
|
|
43
|
+
[tool.ruff]
|
|
44
|
+
line-length = 100
|
|
45
|
+
target-version = "py310"
|
|
46
|
+
|
|
47
|
+
[tool.ruff.lint]
|
|
48
|
+
select = ["E", "W", "F", "I", "B", "UP", "SIM", "RUF", "PT"]
|
|
49
|
+
|
|
50
|
+
[tool.ty.environment]
|
|
51
|
+
python-version = "3.10"
|
|
52
|
+
|
|
53
|
+
[tool.pytest.ini_options]
|
|
54
|
+
addopts = "--strict-markers --cov=stoopid --cov-report=term-missing --cov-fail-under=100"
|
|
55
|
+
testpaths = ["tests"]
|
|
56
|
+
|
|
57
|
+
[tool.coverage.run]
|
|
58
|
+
branch = true
|
|
59
|
+
source = ["stoopid"]
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"""stoopid: a deliberately meaningless package for testing release automation."""
|
|
2
|
+
|
|
3
|
+
from importlib.metadata import version
|
|
4
|
+
|
|
5
|
+
from stoopid.core import add, fibonacci, multiply
|
|
6
|
+
|
|
7
|
+
__all__ = ["__version__", "add", "fibonacci", "multiply"]
|
|
8
|
+
|
|
9
|
+
__version__ = version("stoopid")
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""Command-line interface: ``stoopid add 1 2``."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
from collections.abc import Sequence
|
|
7
|
+
|
|
8
|
+
from stoopid import __version__
|
|
9
|
+
from stoopid.core import add, fibonacci, multiply
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def build_parser() -> argparse.ArgumentParser:
|
|
13
|
+
parser = argparse.ArgumentParser(prog="stoopid", description=__doc__)
|
|
14
|
+
parser.add_argument("--version", action="version", version=__version__)
|
|
15
|
+
sub = parser.add_subparsers(dest="command", required=True)
|
|
16
|
+
|
|
17
|
+
for name, help_text in (("add", "add two integers"), ("mul", "multiply two integers")):
|
|
18
|
+
cmd = sub.add_parser(name, help=help_text)
|
|
19
|
+
cmd.add_argument("a", type=int)
|
|
20
|
+
cmd.add_argument("b", type=int)
|
|
21
|
+
|
|
22
|
+
fib = sub.add_parser("fib", help="n-th Fibonacci number")
|
|
23
|
+
fib.add_argument("n", type=int)
|
|
24
|
+
return parser
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def main(argv: Sequence[str] | None = None) -> int:
|
|
28
|
+
args = build_parser().parse_args(argv)
|
|
29
|
+
if args.command == "add":
|
|
30
|
+
result = add(args.a, args.b)
|
|
31
|
+
elif args.command == "mul":
|
|
32
|
+
result = multiply(args.a, args.b)
|
|
33
|
+
else:
|
|
34
|
+
try:
|
|
35
|
+
result = fibonacci(args.n)
|
|
36
|
+
except ValueError as exc:
|
|
37
|
+
build_parser().error(str(exc))
|
|
38
|
+
print(result)
|
|
39
|
+
return 0
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""Arithmetic nobody needed."""
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def add(a: int, b: int) -> int:
|
|
5
|
+
"""Return the sum of ``a`` and ``b``."""
|
|
6
|
+
return a + b
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def multiply(a: int, b: int) -> int:
|
|
10
|
+
"""Return the product of ``a`` and ``b``."""
|
|
11
|
+
return a * b
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def fibonacci(n: int) -> int:
|
|
15
|
+
"""Return the ``n``-th Fibonacci number (``fibonacci(0) == 0``).
|
|
16
|
+
|
|
17
|
+
Raises:
|
|
18
|
+
ValueError: if ``n`` is negative.
|
|
19
|
+
"""
|
|
20
|
+
if n < 0:
|
|
21
|
+
raise ValueError("n must be non-negative")
|
|
22
|
+
a, b = 0, 1
|
|
23
|
+
for _ in range(n):
|
|
24
|
+
a, b = b, a + b
|
|
25
|
+
return a
|
|
File without changes
|