test-python-package-release 0.3.2__tar.gz → 0.5.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.
- test_python_package_release-0.5.0/.dockerignore +17 -0
- test_python_package_release-0.5.0/.github/.release-please-manifest.json +3 -0
- test_python_package_release-0.5.0/.github/workflows/docker-publish.yml +48 -0
- {test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/CHANGELOG.md +23 -0
- test_python_package_release-0.5.0/Dockerfile +18 -0
- {test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/PKG-INFO +22 -2
- {test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/README.md +20 -0
- {test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/pyproject.toml +1 -1
- test_python_package_release-0.5.0/src/test_python_package_release/__init__.py +37 -0
- test_python_package_release-0.5.0/src/test_python_package_release/calculator.py +38 -0
- test_python_package_release-0.5.0/src/test_python_package_release/strings.py +26 -0
- test_python_package_release-0.5.0/tests/test_calculator.py +80 -0
- test_python_package_release-0.5.0/tests/test_strings.py +59 -0
- {test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/uv.lock +2 -2
- test_python_package_release-0.3.2/.github/.release-please-manifest.json +0 -3
- test_python_package_release-0.3.2/src/test_python_package_release/__init__.py +0 -16
- test_python_package_release-0.3.2/src/test_python_package_release/calculator.py +0 -20
- test_python_package_release-0.3.2/src/test_python_package_release/strings.py +0 -7
- test_python_package_release-0.3.2/tests/test_calculator.py +0 -36
- test_python_package_release-0.3.2/tests/test_strings.py +0 -17
- {test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/.github/dependabot.yml +0 -0
- {test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/.github/release-please-config.json +0 -0
- {test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/.github/workflows/ci.yml +0 -0
- {test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/.github/workflows/claude-review.yml +0 -0
- {test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/.github/workflows/publish.yml +0 -0
- {test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/.github/workflows/release-please.yml +0 -0
- {test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/.gitignore +0 -0
- {test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/.pre-commit-config.yaml +0 -0
- {test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/.python-version +0 -0
- {test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/LICENSE +0 -0
- {test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/commitlint.config.cjs +0 -0
- {test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/docs/superpowers/plans/2026-05-30-python-package-release-template.md +0 -0
- {test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/docs/superpowers/specs/2026-05-30-python-package-release-template-design.md +0 -0
- {test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/tests/__init__.py +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: Docker Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
IMAGE_NAME: ${{ vars.DOCKERHUB_USERNAME }}/test-python-package-release
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
docker:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
permissions:
|
|
15
|
+
contents: read
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Docker meta
|
|
20
|
+
id: meta
|
|
21
|
+
uses: docker/metadata-action@v6
|
|
22
|
+
with:
|
|
23
|
+
images: ${{ env.IMAGE_NAME }}
|
|
24
|
+
# release-please tags look like "test-python-package-release-v1.2.3"
|
|
25
|
+
tags: |
|
|
26
|
+
type=semver,pattern={{version}},match=v(\d+\.\d+\.\d+.*)$
|
|
27
|
+
type=semver,pattern={{major}}.{{minor}},match=v(\d+\.\d+\.\d+.*)$
|
|
28
|
+
type=sha
|
|
29
|
+
|
|
30
|
+
- uses: docker/setup-qemu-action@v4
|
|
31
|
+
- uses: docker/setup-buildx-action@v4
|
|
32
|
+
|
|
33
|
+
- name: Login to Docker Hub
|
|
34
|
+
uses: docker/login-action@v4
|
|
35
|
+
with:
|
|
36
|
+
username: ${{ vars.DOCKERHUB_USERNAME }}
|
|
37
|
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
38
|
+
|
|
39
|
+
- name: Build and push
|
|
40
|
+
uses: docker/build-push-action@v7
|
|
41
|
+
with:
|
|
42
|
+
context: .
|
|
43
|
+
platforms: linux/amd64,linux/arm64
|
|
44
|
+
push: true
|
|
45
|
+
tags: ${{ steps.meta.outputs.tags }}
|
|
46
|
+
labels: ${{ steps.meta.outputs.labels }}
|
|
47
|
+
cache-from: type=gha
|
|
48
|
+
cache-to: type=gha,mode=max
|
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.5.0](https://github.com/wozniakos10/test_python_package_release/compare/test-python-package-release-v0.4.0...test-python-package-release-v0.5.0) (2026-12-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **docker:** publish image to Docker Hub on release ([1c7ccec](https://github.com/wozniakos10/test_python_package_release/commit/1c7ccec3b0395be10c8678728b43eb94002ed239))
|
|
9
|
+
* **docker:** publish image to Docker Hub on release ([75695c7](https://github.com/wozniakos10/test_python_package_release/commit/75695c78082df0888927b68f94b313db16ef8cfa))
|
|
10
|
+
|
|
11
|
+
## [0.4.0](https://github.com/wozniakos10/test_python_package_release/compare/test-python-package-release-v0.3.2...test-python-package-release-v0.4.0) (2026-05-31)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **calculator:** add modulo, sqrt, and is_divisible functions ([5c5d4b1](https://github.com/wozniakos10/test_python_package_release/commit/5c5d4b14d72f9d2cfebe515a52d1f02e22f2dfcf))
|
|
17
|
+
* **calculator:** add modulo, sqrt, and is_divisible functions ([6f0e60a](https://github.com/wozniakos10/test_python_package_release/commit/6f0e60a8e6c95eaf755a2e225ecab4e9b6d4f5e6))
|
|
18
|
+
* **strings:** add count_words, camel_to_snake, and truncate functions ([ce969a5](https://github.com/wozniakos10/test_python_package_release/commit/ce969a5bdc25d59ba805ed79bccb000e84d64bcf))
|
|
19
|
+
* **strings:** add count_words, camel_to_snake, and truncate functions ([9600b2c](https://github.com/wozniakos10/test_python_package_release/commit/9600b2c6171d93ce77e4b5929f05422b924dd7ba))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* **init:** resolve duplicate imports after calculator-extras merge ([5313c13](https://github.com/wozniakos10/test_python_package_release/commit/5313c130f0918733aae5a8e34fc55ab86fe1c54d))
|
|
25
|
+
|
|
3
26
|
## [0.3.2](https://github.com/wozniakos10/test_python_package_release/compare/test-python-package-release-v0.3.1...test-python-package-release-v0.3.2) (2026-05-30)
|
|
4
27
|
|
|
5
28
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS builder
|
|
2
|
+
|
|
3
|
+
WORKDIR /app
|
|
4
|
+
COPY pyproject.toml uv.lock README.md LICENSE ./
|
|
5
|
+
COPY src ./src
|
|
6
|
+
RUN uv build --wheel --out-dir /dist
|
|
7
|
+
|
|
8
|
+
FROM python:3.13-slim
|
|
9
|
+
|
|
10
|
+
LABEL org.opencontainers.image.source="https://github.com/wozniakos10/test-python-package-release"
|
|
11
|
+
|
|
12
|
+
COPY --from=builder /dist/*.whl /tmp/
|
|
13
|
+
RUN pip install --no-cache-dir /tmp/*.whl && rm /tmp/*.whl
|
|
14
|
+
|
|
15
|
+
RUN useradd --create-home appuser
|
|
16
|
+
USER appuser
|
|
17
|
+
|
|
18
|
+
CMD ["python", "-c", "import test_python_package_release as p; print(f'test-python-package-release {p.__version__}'); print('2 + 3 =', p.add(2, 3))"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: test-python-package-release
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: Template library demonstrating Python package release CI/CD
|
|
5
5
|
Author-email: Dawid Wozniak <wozniakos10@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -137,8 +137,28 @@ Release PR merged ──▶ release-please tags + creates GitHub Release
|
|
|
137
137
|
└─ publish.yml ──▶ uv build
|
|
138
138
|
──▶ TestPyPI (OIDC)
|
|
139
139
|
──▶ PyPI (OIDC, gated env)
|
|
140
|
+
│
|
|
141
|
+
└─ docker-publish.yml ──▶ Docker Hub
|
|
142
|
+
(<version>, <major.minor>, sha-*)
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Docker image
|
|
146
|
+
|
|
147
|
+
Each GitHub Release also publishes a multi-arch image (amd64, arm64) to
|
|
148
|
+
Docker Hub. To try it locally:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
docker build -t test-python-package-release .
|
|
152
|
+
docker run --rm test-python-package-release
|
|
140
153
|
```
|
|
141
154
|
|
|
155
|
+
Required repo configuration (Settings → Secrets and variables → Actions):
|
|
156
|
+
|
|
157
|
+
- Variable `DOCKERHUB_USERNAME`: your Docker Hub username
|
|
158
|
+
- Secret `DOCKERHUB_TOKEN`: a Docker Hub
|
|
159
|
+
[personal access token](https://app.docker.com/settings/personal-access-tokens)
|
|
160
|
+
with Read & Write scope
|
|
161
|
+
|
|
142
162
|
## First-time setup after cloning the template
|
|
143
163
|
|
|
144
164
|
1. **Rename the package**: update `name` in `pyproject.toml`, the directory
|
|
@@ -103,8 +103,28 @@ Release PR merged ──▶ release-please tags + creates GitHub Release
|
|
|
103
103
|
└─ publish.yml ──▶ uv build
|
|
104
104
|
──▶ TestPyPI (OIDC)
|
|
105
105
|
──▶ PyPI (OIDC, gated env)
|
|
106
|
+
│
|
|
107
|
+
└─ docker-publish.yml ──▶ Docker Hub
|
|
108
|
+
(<version>, <major.minor>, sha-*)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Docker image
|
|
112
|
+
|
|
113
|
+
Each GitHub Release also publishes a multi-arch image (amd64, arm64) to
|
|
114
|
+
Docker Hub. To try it locally:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
docker build -t test-python-package-release .
|
|
118
|
+
docker run --rm test-python-package-release
|
|
106
119
|
```
|
|
107
120
|
|
|
121
|
+
Required repo configuration (Settings → Secrets and variables → Actions):
|
|
122
|
+
|
|
123
|
+
- Variable `DOCKERHUB_USERNAME`: your Docker Hub username
|
|
124
|
+
- Secret `DOCKERHUB_TOKEN`: a Docker Hub
|
|
125
|
+
[personal access token](https://app.docker.com/settings/personal-access-tokens)
|
|
126
|
+
with Read & Write scope
|
|
127
|
+
|
|
108
128
|
## First-time setup after cloning the template
|
|
109
129
|
|
|
110
130
|
1. **Rename the package**: update `name` in `pyproject.toml`, the directory
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""Test Python package release — template library."""
|
|
2
|
+
|
|
3
|
+
__version__ = "0.5.0" # managed by release-please
|
|
4
|
+
|
|
5
|
+
from test_python_package_release.calculator import (
|
|
6
|
+
add,
|
|
7
|
+
divide,
|
|
8
|
+
is_divisible,
|
|
9
|
+
modulo,
|
|
10
|
+
multiply,
|
|
11
|
+
power,
|
|
12
|
+
sqrt,
|
|
13
|
+
subtract,
|
|
14
|
+
)
|
|
15
|
+
from test_python_package_release.strings import (
|
|
16
|
+
camel_to_snake,
|
|
17
|
+
count_words,
|
|
18
|
+
reverse_string,
|
|
19
|
+
snake_to_camel,
|
|
20
|
+
truncate,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
__all__ = [
|
|
24
|
+
"add",
|
|
25
|
+
"camel_to_snake",
|
|
26
|
+
"count_words",
|
|
27
|
+
"divide",
|
|
28
|
+
"is_divisible",
|
|
29
|
+
"modulo",
|
|
30
|
+
"multiply",
|
|
31
|
+
"power",
|
|
32
|
+
"reverse_string",
|
|
33
|
+
"snake_to_camel",
|
|
34
|
+
"sqrt",
|
|
35
|
+
"subtract",
|
|
36
|
+
"truncate",
|
|
37
|
+
]
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
def add(a: float, b: float) -> float:
|
|
2
|
+
return a + b
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def subtract(a: float, b: float) -> float:
|
|
6
|
+
return a - b
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def multiply(a: float, b: float) -> float:
|
|
10
|
+
return a * b
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def divide(a: float, b: float) -> float:
|
|
14
|
+
if b == 0:
|
|
15
|
+
raise ZeroDivisionError("Cannot divide by zero")
|
|
16
|
+
return a / b
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def power(base: float, exponent: float) -> float:
|
|
20
|
+
return base**exponent
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def modulo(a: float, b: float) -> float:
|
|
24
|
+
if b == 0:
|
|
25
|
+
raise ZeroDivisionError("Cannot modulo by zero")
|
|
26
|
+
return a % b
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def sqrt(x: float) -> float:
|
|
30
|
+
if x < 0:
|
|
31
|
+
raise ValueError("Cannot take square root of a negative number")
|
|
32
|
+
return x**0.5
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def is_divisible(a: float, b: float) -> bool:
|
|
36
|
+
if b == 0:
|
|
37
|
+
raise ZeroDivisionError("Cannot divide by zero")
|
|
38
|
+
return a % b == 0
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
def reverse_string(s: str) -> str:
|
|
2
|
+
return s[::-1]
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def snake_to_camel(s: str) -> str:
|
|
6
|
+
parts = s.split("_")
|
|
7
|
+
return parts[0] + "".join(p.title() for p in parts[1:])
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def count_words(s: str) -> int:
|
|
11
|
+
return len(s.split()) if s.strip() else 0
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def camel_to_snake(s: str) -> str:
|
|
15
|
+
result = []
|
|
16
|
+
for i, ch in enumerate(s):
|
|
17
|
+
if ch.isupper() and i > 0:
|
|
18
|
+
result.append("_")
|
|
19
|
+
result.append(ch.lower())
|
|
20
|
+
return "".join(result)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def truncate(s: str, max_length: int, suffix: str = "...") -> str:
|
|
24
|
+
if len(s) <= max_length:
|
|
25
|
+
return s
|
|
26
|
+
return s[: max_length - len(suffix)] + suffix
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
|
|
3
|
+
from test_python_package_release import (
|
|
4
|
+
add,
|
|
5
|
+
divide,
|
|
6
|
+
is_divisible,
|
|
7
|
+
modulo,
|
|
8
|
+
multiply,
|
|
9
|
+
power,
|
|
10
|
+
sqrt,
|
|
11
|
+
subtract,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def test_add():
|
|
16
|
+
assert add(2, 3) == 5
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def test_subtract():
|
|
20
|
+
assert subtract(5, 3) == 2
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def test_multiply():
|
|
24
|
+
assert multiply(3, 4) == 12
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def test_divide():
|
|
28
|
+
assert divide(10, 2) == 5.0
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def test_divide_by_zero():
|
|
32
|
+
with pytest.raises(ZeroDivisionError):
|
|
33
|
+
divide(1, 0)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def test_power():
|
|
37
|
+
assert power(2, 10) == 1024
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def test_power_zero_exponent():
|
|
41
|
+
assert power(5, 0) == 1
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def test_power_negative_exponent():
|
|
45
|
+
assert power(2, -2) == 0.25
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def test_modulo():
|
|
49
|
+
assert modulo(10, 3) == 1
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def test_modulo_by_zero():
|
|
53
|
+
with pytest.raises(ZeroDivisionError):
|
|
54
|
+
modulo(5, 0)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def test_sqrt():
|
|
58
|
+
assert sqrt(9) == 3.0
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def test_sqrt_zero():
|
|
62
|
+
assert sqrt(0) == 0.0
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def test_sqrt_negative():
|
|
66
|
+
with pytest.raises(ValueError):
|
|
67
|
+
sqrt(-1)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def test_is_divisible_true():
|
|
71
|
+
assert is_divisible(10, 2) is True
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def test_is_divisible_false():
|
|
75
|
+
assert is_divisible(10, 3) is False
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def test_is_divisible_by_zero():
|
|
79
|
+
with pytest.raises(ZeroDivisionError):
|
|
80
|
+
is_divisible(5, 0)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
from test_python_package_release import (
|
|
2
|
+
camel_to_snake,
|
|
3
|
+
count_words,
|
|
4
|
+
reverse_string,
|
|
5
|
+
snake_to_camel,
|
|
6
|
+
truncate,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def test_reverse_string():
|
|
11
|
+
assert reverse_string("abc") == "cba"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def test_reverse_string_empty():
|
|
15
|
+
assert reverse_string("") == ""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def test_snake_to_camel():
|
|
19
|
+
assert snake_to_camel("hello_world_foo") == "helloWorldFoo"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def test_snake_to_camel_single_word():
|
|
23
|
+
assert snake_to_camel("single") == "single"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def test_count_words():
|
|
27
|
+
assert count_words("hello world foo") == 3
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def test_count_words_empty():
|
|
31
|
+
assert count_words("") == 0
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def test_count_words_whitespace_only():
|
|
35
|
+
assert count_words(" ") == 0
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def test_camel_to_snake():
|
|
39
|
+
assert camel_to_snake("helloWorldFoo") == "hello_world_foo"
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def test_camel_to_snake_single_word():
|
|
43
|
+
assert camel_to_snake("hello") == "hello"
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def test_truncate_short():
|
|
47
|
+
assert truncate("hello", 10) == "hello"
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def test_truncate_exact():
|
|
51
|
+
assert truncate("hello", 5) == "hello"
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def test_truncate_long():
|
|
55
|
+
assert truncate("hello world", 8) == "hello..."
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def test_truncate_custom_suffix():
|
|
59
|
+
assert truncate("hello world", 7, suffix="!") == "hello !"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
version = 1
|
|
2
|
-
revision =
|
|
2
|
+
revision = 5
|
|
3
3
|
requires-python = ">=3.11"
|
|
4
4
|
|
|
5
5
|
[[package]]
|
|
@@ -367,7 +367,7 @@ wheels = [
|
|
|
367
367
|
|
|
368
368
|
[[package]]
|
|
369
369
|
name = "test-python-package-release"
|
|
370
|
-
version = "0.
|
|
370
|
+
version = "0.5.0"
|
|
371
371
|
source = { editable = "." }
|
|
372
372
|
|
|
373
373
|
[package.dev-dependencies]
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"""Test Python package release — template library."""
|
|
2
|
-
|
|
3
|
-
__version__ = "0.3.2" # managed by release-please
|
|
4
|
-
|
|
5
|
-
from test_python_package_release.calculator import add, divide, multiply, power, subtract
|
|
6
|
-
from test_python_package_release.strings import reverse_string, snake_to_camel
|
|
7
|
-
|
|
8
|
-
__all__ = [
|
|
9
|
-
"add",
|
|
10
|
-
"divide",
|
|
11
|
-
"multiply",
|
|
12
|
-
"power",
|
|
13
|
-
"reverse_string",
|
|
14
|
-
"snake_to_camel",
|
|
15
|
-
"subtract",
|
|
16
|
-
]
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
def add(a: float, b: float) -> float:
|
|
2
|
-
return a + b
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def subtract(a: float, b: float) -> float:
|
|
6
|
-
return a - b
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def multiply(a: float, b: float) -> float:
|
|
10
|
-
return a * b
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def divide(a: float, b: float) -> float:
|
|
14
|
-
if b == 0:
|
|
15
|
-
raise ZeroDivisionError("Cannot divide by zero")
|
|
16
|
-
return a / b
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def power(base: float, exponent: float) -> float:
|
|
20
|
-
return base**exponent
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
|
|
3
|
-
from test_python_package_release import add, divide, multiply, power, subtract
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def test_add():
|
|
7
|
-
assert add(2, 3) == 5
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def test_subtract():
|
|
11
|
-
assert subtract(5, 3) == 2
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def test_multiply():
|
|
15
|
-
assert multiply(3, 4) == 12
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
def test_divide():
|
|
19
|
-
assert divide(10, 2) == 5.0
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
def test_divide_by_zero():
|
|
23
|
-
with pytest.raises(ZeroDivisionError):
|
|
24
|
-
divide(1, 0)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def test_power():
|
|
28
|
-
assert power(2, 10) == 1024
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def test_power_zero_exponent():
|
|
32
|
-
assert power(5, 0) == 1
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
def test_power_negative_exponent():
|
|
36
|
-
assert power(2, -2) == 0.25
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
from test_python_package_release import reverse_string, snake_to_camel
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def test_reverse_string():
|
|
5
|
-
assert reverse_string("abc") == "cba"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def test_reverse_string_empty():
|
|
9
|
-
assert reverse_string("") == ""
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
def test_snake_to_camel():
|
|
13
|
-
assert snake_to_camel("hello_world_foo") == "helloWorldFoo"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
def test_snake_to_camel_single_word():
|
|
17
|
-
assert snake_to_camel("single") == "single"
|
{test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/.github/dependabot.yml
RENAMED
|
File without changes
|
|
File without changes
|
{test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/.github/workflows/ci.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/.pre-commit-config.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{test_python_package_release-0.3.2 → test_python_package_release-0.5.0}/commitlint.config.cjs
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|