Skip to content

Commit

Permalink
Add stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
dustalov committed Jun 17, 2024
1 parent 8c9955e commit 845dd6e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ jobs:
echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV
- name: Set up Maturin
run: |
uv pip install pip maturin
uv pip install pip maturin mypy
maturin develop
- uses: chartboost/ruff-action@v1
- name: Run Mypy
run: mypy .
- name: Run tests (Python)
run: python3 -m unittest discover python
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,24 @@ name = "evalica"
requires-python = ">= 3.8"
dependencies = ["numpy~=1.26.4"]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Information Analysis",
"Typing :: Typed",
]
dynamic = ["version"]

[tool.maturin]
features = ["pyo3/extension-module"]
python-source = "python"

[tool.mypy]
ignore_missing_imports = true
plugins = ["numpy.typing.mypy_plugin"]
strict = true
15 changes: 15 additions & 0 deletions python/evalica/evalica.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from typing import Tuple

import numpy as np
import numpy.typing as npt

def py_bradley_terry(
m: npt.NDArray[np.int64]
) -> Tuple[int, npt.NDArray[np.float64]]: ...

def py_newman(
m: npt.NDArray[np.int64],
seed: int,
tolerance: float,
max_iter: int
) -> Tuple[int, npt.NDArray[np.float64]]: ...
1 change: 1 addition & 0 deletions python/evalica/py.typed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
partial

0 comments on commit 845dd6e

Please sign in to comment.