compute-infinity 0.0.0__py3-none-any.whl
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.
compute_infinity/core.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from collections.abc import Sequence
|
|
3
|
+
|
|
4
|
+
Number = int | float
|
|
5
|
+
Vector = Sequence[Number]
|
|
6
|
+
Matrix = Sequence[Sequence[Number]]
|
|
7
|
+
Operand = Number | Vector | Matrix
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ArithmeticBackend(ABC):
|
|
11
|
+
@abstractmethod
|
|
12
|
+
def plus(self, left: Operand, right: Operand) -> Operand:
|
|
13
|
+
"""Add two operands."""
|
|
14
|
+
|
|
15
|
+
@abstractmethod
|
|
16
|
+
def minus(self, left: Operand, right: Operand) -> Operand:
|
|
17
|
+
"""Subtract right operand from left operand."""
|
|
18
|
+
|
|
19
|
+
@abstractmethod
|
|
20
|
+
def mul(self, left: Operand, right: Operand) -> Operand:
|
|
21
|
+
"""Multiply two operands."""
|
|
22
|
+
|
|
23
|
+
@abstractmethod
|
|
24
|
+
def divide(self, left: Operand, right: Operand) -> Operand:
|
|
25
|
+
"""Divide left operand by right operand."""
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def hello_world() -> str:
|
|
29
|
+
return "hello, world"
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: compute-infinity
|
|
3
|
+
Version: 0.0.0
|
|
4
|
+
Summary: A minimal Python library template using uv, ruff, and pytest.
|
|
5
|
+
Project-URL: Homepage, https://github.com/maifeeulasad/compute-infinity
|
|
6
|
+
Project-URL: Issues, https://github.com/maifeeulasad/compute-infinity/issues
|
|
7
|
+
Author: Maifee Ul Asad<maifeeulasad@gmail.com>
|
|
8
|
+
License: MIT License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2026 Maifee Ul Asad
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
in the Software without restriction, including without limitation the rights
|
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
SOFTWARE.
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Requires-Python: >=3.10
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# compute-infinity
|
|
34
|
+
|
|
35
|
+
A minimal Python library template using:
|
|
36
|
+
- `uv` for environment and dependency management
|
|
37
|
+
- `ruff` for linting
|
|
38
|
+
- `pytest` for tests
|
|
39
|
+
- GitHub Actions for CI (lint + test) and CD (publish to PyPI)
|
|
40
|
+
|
|
41
|
+
## Project layout
|
|
42
|
+
|
|
43
|
+
```text
|
|
44
|
+
.
|
|
45
|
+
├── pyproject.toml
|
|
46
|
+
├── src/
|
|
47
|
+
│ └── compute_infinity/
|
|
48
|
+
│ ├── __init__.py
|
|
49
|
+
│ └── core.py
|
|
50
|
+
├── tests/
|
|
51
|
+
│ └── test_core.py
|
|
52
|
+
└── .github/workflows/
|
|
53
|
+
├── ci.yml
|
|
54
|
+
└── publish.yml
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Quick start
|
|
58
|
+
|
|
59
|
+
1. Install dependencies:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
uv sync --dev
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
2. Run lint:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
uv run ruff check .
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
3. Run tests:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
uv run pytest
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Library API
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
from compute_infinity import hello_world
|
|
81
|
+
|
|
82
|
+
print(hello_world())
|
|
83
|
+
# hello, world
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## CI and CD
|
|
87
|
+
|
|
88
|
+
- CI: `.github/workflows/ci.yml`
|
|
89
|
+
- Runs `ruff` and `pytest` on push to `main` and pull requests.
|
|
90
|
+
- CD: `.github/workflows/publish.yml`
|
|
91
|
+
- Builds with `uv build`
|
|
92
|
+
- Publishes to PyPI using trusted publishing on release publish or manual trigger.
|
|
93
|
+
|
|
94
|
+
## PyPI publishing setup
|
|
95
|
+
|
|
96
|
+
1. Create a project on PyPI with the same name as `project.name` in `pyproject.toml`.
|
|
97
|
+
2. In PyPI, configure Trusted Publisher for this GitHub repository and workflow.
|
|
98
|
+
3. Create a GitHub Release to trigger publishing.
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
## Inspiration
|
|
102
|
+
### Naming
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
'Cause I love you for infinity (Oh, oh, oh)
|
|
106
|
+
I love you for infinity (Oh, oh, oh)
|
|
107
|
+
'Cause I love you for infinity (Oh, oh, oh)
|
|
108
|
+
I love you for infinity (Oh, oh, oh)
|
|
109
|
+
```
|
|
110
|
+
- Infinity, Jaymes Young
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
compute_infinity/__init__.py,sha256=xoJmmn-JbaEEZHrpI-peoJav1ZCGAH6oQ9CMmOghswM,180
|
|
2
|
+
compute_infinity/core.py,sha256=EUG-kCcVNwrzlvjqZRLBxK4E5Ms3gTm8vgJNLZU0U6g,788
|
|
3
|
+
compute_infinity-0.0.0.dist-info/METADATA,sha256=0a-MFb5JiN1GwpSTqXSMqMQih3AG9tKPUhtzUaEM4jU,3151
|
|
4
|
+
compute_infinity-0.0.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
5
|
+
compute_infinity-0.0.0.dist-info/licenses/LICENSE,sha256=yDXty2HaIMk_rHpPWUqecld7BoaOxhM1v791DhiwNf8,1071
|
|
6
|
+
compute_infinity-0.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Maifee Ul Asad
|
|
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.
|