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 __future__ import annotations
from typing import Optional, Union from typing import Optional, Type, Union
from argus import _argus from argus import _argus
from argus._argus import DType as DType 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""" """Declare a variable with the given name and type"""
if isinstance(dtype, type): if isinstance(dtype, type):
if dtype == bool: if dtype == bool:
@ -46,7 +46,7 @@ def literal(value: Union[bool, int, float]) -> Union[ConstBool, ConstInt, ConstU
def signal( 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, value: Optional[Union[bool, int, float]] = None,
) -> Signal: ) -> Signal:

View file

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

View file

@ -0,0 +1,3 @@