-
Notifications
You must be signed in to change notification settings - Fork 5
🧱 static integration testing #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jorenham
wants to merge
28
commits into
data-apis:main
Choose a base branch
from
jorenham:type-testing
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+554
−360
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
cf1306b
🧑💻 lefthook config fine-tuning
jorenham 3b23312
🎨 remove redundant `bound=object`
jorenham 5f5995b
🚚 restructured tests directories
jorenham 7434579
🔧⬆️ mypy config tweaks, reorder dep groups, and bump deps
jorenham a32517f
💡 remove redundant `# noqa`
jorenham d00681e
🧪 add (failing) numpy integration test for `HasArrayNamespace`
jorenham a15686c
🔧 fix awkward dependency groups
jorenham a7fe54d
👷 integration testing matrix for numpy
jorenham 2b30311
🙈 ignore some irrelevant ruff codes for the static integration tests
jorenham a6bb9b7
💚 fix test path
jorenham d59a1c5
💚 don't use `--frozen` when installing different a numpy version
jorenham 9a73605
🚧 debug-print the installed numpy version
jorenham cc91649
🚧 `--refresh` , maybe?
jorenham 26d85ba
🚧 `--reinstall`, maybe?
jorenham b9f77b5
⬆️ might as well bump `setup-uv` then...
jorenham d509f4f
🚧 `--isolated`, maybe?
jorenham 55ac805
🚧 `enable-cache: false`, maybe?
jorenham 110a869
🚧 `--exact`, maybe?
jorenham 7d2e59b
🚧 no mypy flags, maybe?
jorenham de3924e
🚧 `uv pip`, maybe?
jorenham 4db60c2
💚 clean up CI debug statements
jorenham 57eb000
🐛 fix `HasArrayNamespace` falsely rejecting `ndarray` instances on nu…
jorenham 9e1fc18
👷 remove numpy<2 from the integration testing matrix
jorenham a4a75f9
🧙 split numpy 1 and 2 integration tests with black voodoo magic
jorenham 95ec86d
✂️ don't `cut` more than needed
jorenham 9c89224
🩹 don't attempt to directly use `np.array_api.Array`
jorenham b0673fa
🔧 move ruff ignore rules for the tests to the tests
jorenham 5644f37
⏪ temporarily restore the lefthook step
jorenham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,33 @@ | ||
# Refer for explanation to following link: | ||
# https://lefthook.dev/configuration/ | ||
# | ||
|
||
templates: | ||
run: run --no-sync | ||
|
||
pre-commit: | ||
parallel: true | ||
jobs: | ||
- name: ruff-fix | ||
glob: "*.py" | ||
run: uv run ruff check --fix {staged_files} | ||
- name: ruff-format | ||
glob: "*.py" | ||
run: uv run ruff format {staged_files} | ||
- name: ruff | ||
glob: "*.{py,pyi}" | ||
stage_fixed: true | ||
group: | ||
piped: true | ||
jobs: | ||
- name: check | ||
run: uv {run} ruff check --fix {staged_files} | ||
- name: format | ||
run: uv {run} ruff format {staged_files} | ||
- name: mypy | ||
glob: "*.py" | ||
run: uv run --group mypy mypy {staged_files} | ||
glob: "*.{py,pyi}" | ||
run: uv {run} mypy {staged_files} | ||
|
||
post-checkout: | ||
jobs: | ||
- run: uv sync | ||
glob: uv.lock | ||
|
||
post-merge: | ||
files: "git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD" | ||
jobs: | ||
- run: uv sync | ||
glob: uv.lock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
extend = "../pyproject.toml" | ||
|
||
[lint] | ||
extend-ignore = [ | ||
nstarman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"ANN201", # https://docs.astral.sh/ruff/rules/missing-return-type-undocumented-public-function/ | ||
"D1", # https://docs.astral.sh/ruff/rules/#pydocstyle-d | ||
"INP001", # https://docs.astral.sh/ruff/rules/implicit-namespace-package/ | ||
"S101", # https://docs.astral.sh/ruff/rules/assert/ | ||
] |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
extend = "../.ruff.toml" | ||
|
||
[lint] | ||
extend-ignore = ["B018", "PYI015", "PYI017"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from typing import Any | ||
|
||
# requires numpy < 2 | ||
import numpy.array_api as np | ||
|
||
import array_api_typing as xpt | ||
|
||
### | ||
# Ensure that `np.ndarray` instances are assignable to `xpt.HasArrayNamespace`. | ||
|
||
arr = np.eye(2) | ||
arr_namespace: xpt.HasArrayNamespace[Any] = arr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from typing import Any | ||
|
||
import numpy.typing as npt | ||
|
||
import array_api_typing as xpt | ||
|
||
### | ||
# Ensure that `np.ndarray` instances are assignable to `xpt.HasArrayNamespace`. | ||
|
||
arr: npt.NDArray[Any] | ||
arr_namespace: xpt.HasArrayNamespace[Any] = arr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.