chore(pyargus): minor changes

This commit is contained in:
Anand Balakrishnan 2023-08-30 16:02:37 -07:00
parent 73921db5f9
commit a5bc6f5d36
3 changed files with 17 additions and 11 deletions

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import Optional, Union
from typing import Optional, Type, Union
from argus import _argus
from argus._argus import DType as DType
@ -13,7 +13,7 @@ except AttributeError:
...
def declare_var(name: str, dtype: Union[DType, type[Union[bool, int, float]]]) -> Union[VarBool, VarInt, VarUInt, VarFloat]:
def declare_var(name: str, dtype: Union[DType, Type[Union[bool, int, float]]]) -> Union[VarBool, VarInt, VarUInt, VarFloat]:
"""Declare a variable with the given name and type"""
if isinstance(dtype, type):
if dtype == bool:
@ -46,7 +46,7 @@ def literal(value: Union[bool, int, float]) -> Union[ConstBool, ConstInt, ConstU
def signal(
dtype: Union[DType, type[Union[bool, int, float]]],
dtype: Union[DType, Type[Union[bool, int, float]]],
*,
value: Optional[Union[bool, int, float]] = None,
) -> Signal:

View file

@ -1,10 +1,7 @@
[build-system]
requires = ["maturin>=0.14,<0.15"]
build-backend = "maturin"
[project]
name = "pyargus"
requires-python = ">=3.7"
version = "0.1.0"
requires-python = ">=3.8"
classifiers = [
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
@ -27,12 +24,19 @@ dev = [
"black",
]
test = ["pytest", "pytest-cov", "hypothesis"]
[build-system]
requires = ["maturin>=1.0,<2.0"]
build-backend = "maturin"
[tool.maturin]
features = ["pyo3/extension-module"]
module-name = "argus._argus"
[tool.pyright]
include = ["argus/", "examples/"]
[tool.pytest.ini_options]
addopts = ["--import-mode=importlib"]
[tool.mypy]
# ignore_missing_imports = true
@ -72,7 +76,6 @@ profile = "black"
line_length = 127
skip_gitignore = false
group_by_package = true
src_paths = ["argus", "examples/"]
extend_skip = [
# No need to traverse our git directory
".git/",

View file

@ -0,0 +1,3 @@