Skip to content

Commit e411a2b

Browse files
committed
📝 docs: add and test readme
Signed-off-by: Nathaniel Starkman <nstarman@users.noreply.github.com>
1 parent e2deb6a commit e411a2b

File tree

3 files changed

+184
-125
lines changed

3 files changed

+184
-125
lines changed

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<h1 align='center'> array-api-typing </h1>
2+
<h3 align="center">Runtime-Checkable Type Annotations for the Array APi</h3>
3+
4+
---
5+
6+
## Installation
7+
8+
```bash
9+
pip install array-api-typing
10+
```
11+
12+
<details>
13+
<summary>using <code>uv</code></summary>
14+
15+
```bash
16+
uv add array-api-typing
17+
```
18+
19+
</details>
20+
<details>
21+
<summary>from source, using pip</summary>
22+
23+
```bash
24+
pip install git+https://https://github.com/data-apis/array-api-typing.git
25+
```
26+
27+
</details>
28+
<details>
29+
<summary>building from source</summary>
30+
31+
```bash
32+
cd /path/to/parent
33+
git clone https://https://github.com/data-apis/array-api-typing.git
34+
cd array-api-typing
35+
pip install -e . # editable mode
36+
```
37+
38+
</details>
39+
40+
### Quick example
41+
42+
```pycon
43+
>>> import array_api_typing as arrt
44+
>>> import numpy as np
45+
46+
>>> def func(x: arrt.HasNamespace) -> arrt.HasNamespace:
47+
... return x
48+
49+
>>> func(np.array([1, 2, 3]))
50+
array([1, 2, 3])
51+
52+
```

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@
4343
"lefthook>=1.11.13",
4444
]
4545
test = [
46+
"numpy>=2.2.6",
4647
"pytest>=8.3.3",
4748
"pytest-cov>=3",
4849
"pytest-github-actions-annotate-failures>=0.3.0",
4950
"sybil>=8.0.0",
50-
]
51+
]
5152

5253

5354
[tool.hatch]

0 commit comments

Comments
 (0)