Skip to content

Commit 276ff52

Browse files
authored
Merge pull request #603 from numpy/pr/KotlinIsland/471
2 parents 287bde7 + 6adb645 commit 276ff52

31 files changed

+598
-597
lines changed

.dprint.jsonc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"lineWidth": 88,
3+
"json": {
4+
"array.preferSingleLine": true,
5+
"jsonTrailingCommaFiles": [".vscode/extensions.json", ".vscode/settings.json"],
6+
},
7+
"markdown": {
8+
"emphasisKind": "asterisks",
9+
// "textWrap": "always",
10+
},
11+
"yaml": {
12+
"braceSpacing": false,
13+
"formatComments": true,
14+
"indentBlockSequenceInMap": false,
15+
},
16+
"excludes": ["**/*-lock.json", "**/*.lock", "dist/", "site/"],
17+
"plugins": [
18+
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.1.wasm",
19+
"https://plugins.dprint.dev/json-0.20.0.wasm",
20+
"https://plugins.dprint.dev/markdown-0.19.0.wasm",
21+
"https://plugins.dprint.dev/toml-0.7.0.wasm",
22+
],
23+
}

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -4,63 +4,63 @@ title: "<Please write a comprehensive title>"
44
labels: ["stubs: Incorrect"]
55

66
body:
7-
- type: markdown
8-
attributes:
9-
value: >
10-
Thank you for taking the time to file a bug report. Before creating a new
11-
issue, please make sure to take a few minutes to check the issue tracker
12-
for existing issues about the bug.
7+
- type: markdown
8+
attributes:
9+
value: >
10+
Thank you for taking the time to file a bug report. Before creating a new
11+
issue, please make sure to take a few minutes to check the issue tracker
12+
for existing issues about the bug.
1313
14-
- type: textarea
15-
attributes:
16-
label: "Describe the issue:"
17-
validations:
18-
required: true
14+
- type: textarea
15+
attributes:
16+
label: "Describe the issue:"
17+
validations:
18+
required: true
1919

20-
- type: textarea
21-
attributes:
22-
label: "Reproduce the code example:"
23-
description: >
24-
A short code example that reproduces the error in your type-checker.
25-
It should be self-contained, i.e., can be run as-is via e.g. mypy myproblem.py or pyright myproblem.py.
26-
placeholder: |
27-
import numpy as np
28-
<< your code here >>
29-
render: python
30-
validations:
31-
required: true
20+
- type: textarea
21+
attributes:
22+
label: "Reproduce the code example:"
23+
description: >
24+
A short code example that reproduces the error in your type-checker.
25+
It should be self-contained, i.e., can be run as-is via e.g. mypy myproblem.py or pyright myproblem.py.
26+
placeholder: |
27+
import numpy as np
28+
<< your code here >>
29+
render: python
30+
validations:
31+
required: true
3232

33-
- type: textarea
34-
attributes:
35-
label: "Error message:"
36-
description: >
37-
Please include all relevant error messages from your type-checker or IDE.
38-
placeholder: |
39-
<< Full traceback starting from `Traceback: ...` or type checker output >>
40-
render: shell
33+
- type: textarea
34+
attributes:
35+
label: "Error message:"
36+
description: >
37+
Please include all relevant error messages from your type-checker or IDE.
38+
placeholder: |
39+
<< Full traceback starting from `Traceback: ...` or type checker output >>
40+
render: shell
4141

42-
- type: textarea
43-
attributes:
44-
label: "Python and NumPy versions:"
45-
description: >
46-
Output from `import sys, numpy; print(numpy.__version__); print(sys.version)`.
47-
validations:
48-
required: true
42+
- type: textarea
43+
attributes:
44+
label: "Python and NumPy versions:"
45+
description: >
46+
Output from `import sys, numpy; print(numpy.__version__); print(sys.version)`.
47+
validations:
48+
required: true
4949

50-
- type: textarea
51-
attributes:
52-
label: "Type-checker version and configuration:"
53-
description: >
54-
Please include the exact version of the type-checker you are using.
55-
Popular (static) type checkers include Mypy, Pyright / Pylance, Pytype, Pyre, PyCharm, etc.
56-
Also include the full CLI command used to run the type-checker, and all of the relevant configuration options.
57-
validations:
58-
required: true
50+
- type: textarea
51+
attributes:
52+
label: "Type-checker version and configuration:"
53+
description: >
54+
Please include the exact version of the type-checker you are using.
55+
Popular (static) type checkers include Mypy, Pyright / Pylance, Pytype, Pyre, PyCharm, etc.
56+
Also include the full CLI command used to run the type-checker, and all of the relevant configuration options.
57+
validations:
58+
required: true
5959

60-
- type: textarea
61-
attributes:
62-
label: "Additional type packages:"
63-
description: >
64-
If you are using typing-extensions or typing-stub packages, please list their versions here.
65-
validations:
66-
required: false
60+
- type: textarea
61+
attributes:
62+
label: "Additional type packages:"
63+
description: >
64+
If you are using typing-extensions or typing-stub packages, please list their versions here.
65+
validations:
66+
required: false

.github/ISSUE_TEMPLATE/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ labels: ["topic: Docs"]
55

66
body:
77
- type: textarea
8-
attributes:
8+
attributes:
99
label: "Issue with current documentation:"
1010
description: >
1111
Please make sure to leave a reference to the document/code you're

.github/dependabot.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
version: 2
22
updates:
3-
- package-ecosystem: github-actions
4-
directory: "/"
5-
schedule:
6-
interval: daily
7-
allow:
8-
- dependency-type: "all"
9-
labels:
10-
- "topic: dependencies"
11-
- "tool: github-actions"
12-
commit-message:
13-
prefix: "⬆️ "
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
allow:
8+
- dependency-type: "all"
9+
labels:
10+
- "topic: dependencies"
11+
- "tool: github-actions"
12+
commit-message:
13+
prefix: "⬆️ "
1414

15-
- package-ecosystem: uv
16-
directories:
17-
- "/"
18-
- "/tool"
19-
schedule:
20-
interval: daily
21-
allow:
22-
- dependency-type: "all"
23-
versioning-strategy: increase
24-
labels:
25-
- "topic: dependencies"
26-
- "tool: uv"
27-
commit-message:
28-
prefix: "⬆️ "
15+
- package-ecosystem: uv
16+
directories:
17+
- "/"
18+
- "/tool"
19+
schedule:
20+
interval: daily
21+
allow:
22+
- dependency-type: "all"
23+
versioning-strategy: increase
24+
labels:
25+
- "topic: dependencies"
26+
- "tool: uv"
27+
commit-message:
28+
prefix: "⬆️ "

.github/labeler.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,16 @@
129129
- any-glob-to-any-file:
130130
- .github/workflows/**
131131

132+
"tool: lefthook":
133+
- changed-files:
134+
- any-glob-to-any-file:
135+
- lefthook.yml
136+
137+
"tool: dprint":
138+
- changed-files:
139+
- any-glob-to-any-file:
140+
- .dprint.jsonc
141+
132142
"topic: dependencies":
133143
- changed-files:
134144
- any-glob-to-any-file:
@@ -150,6 +160,5 @@
150160
"topic: code style":
151161
- changed-files:
152162
- any-glob-to-any-file:
153-
- .taplo.toml
154-
- **/.ruff.toml
155-
163+
- .dprint.jsonc
164+
- "**/.ruff.toml"

.github/workflows/ci.yml

Lines changed: 33 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: CI
2+
permissions: read-all
23

34
on:
45
push:
@@ -10,10 +11,6 @@ concurrency:
1011
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1112
cancel-in-progress: true
1213

13-
permissions:
14-
contents: read
15-
pull-requests: write
16-
1714
env:
1815
UV_LOCKED: 1
1916

@@ -23,37 +20,26 @@ jobs:
2320
timeout-minutes: 1
2421

2522
steps:
26-
- uses: actions/[email protected]
27-
28-
- name: typos
29-
uses: crate-ci/[email protected]
23+
- uses: actions/[email protected]
3024

31-
- name: markdownlint
32-
uses: DavidAnson/[email protected]
33-
with:
34-
config: "docs/.markdownlint.yaml"
35-
globs: "**/*.md"
25+
- name: typos
26+
uses: crate-ci/[email protected]
3627

37-
- uses: uncenter/[email protected]
38-
with:
39-
version: "0.9.3"
40-
- name: taplo
41-
run: |
42-
taplo validate --colors never --no-schema
43-
taplo fmt --colors never --check
28+
- uses: astral-sh/[email protected]
4429

45-
- uses: astral-sh/[email protected]
30+
- name: dprint
31+
run: uv run dprint check
4632

47-
- name: ruff
48-
run: |
49-
uv run ruff check --output-format=github
50-
uv run ruff format --check
33+
- name: ruff
34+
run: |
35+
uv run ruff check --output-format=github
36+
uv run ruff format --check
5137
52-
- name: pytest
53-
run: uv run pytest
38+
- name: format-ignores
39+
run: uv run tool/format_ignores.py --check
5440

55-
- name: format-ignores
56-
run: uv run tool/format_ignores.py --check
41+
- name: pytest
42+
run: uv run pytest
5743

5844
# NOTE: Static typing only differs between `python<3.12` and otherwise,
5945
# so there's no need to run the type-checkers on all Python versions.
@@ -66,14 +52,14 @@ jobs:
6652
matrix:
6753
py: ["3.11", "3.13"]
6854
steps:
69-
- uses: actions/[email protected]
55+
- uses: actions/[email protected]
7056

71-
- uses: astral-sh/[email protected]
72-
with:
73-
python-version: ${{ matrix.py }}
57+
- uses: astral-sh/[email protected]
58+
with:
59+
python-version: ${{ matrix.py }}
7460

75-
- name: basedpyright
76-
run: uv run basedpyright
61+
- name: basedpyright
62+
run: uv run basedpyright
7763

7864
mypy:
7965
runs-on: ubuntu-latest
@@ -83,14 +69,14 @@ jobs:
8369
matrix:
8470
py: ["3.11", "3.13"]
8571
steps:
86-
- uses: actions/[email protected]
72+
- uses: actions/[email protected]
8773

88-
- uses: astral-sh/[email protected]
89-
with:
90-
python-version: ${{ matrix.py }}
74+
- uses: astral-sh/[email protected]
75+
with:
76+
python-version: ${{ matrix.py }}
9177

92-
- name: mypy
93-
run: uv run --no-editable mypy --no-incremental --cache-dir=/dev/null .
78+
- name: mypy
79+
run: uv run --no-editable mypy --no-incremental --cache-dir=/dev/null .
9480

9581
# NOTE: Stubtest does runtime inspections, so we consider all Python versions.
9682

@@ -103,11 +89,11 @@ jobs:
10389
os: [ubuntu-latest, macos-latest, windows-latest]
10490
py: ["3.11", "3.12", "3.13", "3.14"]
10591
steps:
106-
- uses: actions/[email protected]
92+
- uses: actions/[email protected]
10793

108-
- uses: astral-sh/[email protected]
109-
with:
110-
python-version: ${{ matrix.py }}
94+
- uses: astral-sh/[email protected]
95+
with:
96+
python-version: ${{ matrix.py }}
11197

112-
- name: stubtest
113-
run: uv run --active tool/stubtest.py
98+
- name: stubtest
99+
run: uv run --active tool/stubtest.py

0 commit comments

Comments
 (0)