format and also add pdm scripts

This commit is contained in:
sneakers-the-rat 2024-10-03 20:01:56 -07:00
parent 8f1eb6e5b4
commit 7dbb22f828
Signed by untrusted user who does not match committer: jonny
GPG key ID: 6DCB96EF1E4D232D
5 changed files with 10 additions and 3 deletions

View file

@ -96,6 +96,12 @@ distribution = true
[tool.pdm.build]
includes = []
[tool.pdm.scripts]
lint = "ruff check"
format = {shell = "ruff check --fix ; black ."}
test = "pytest"
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"

View file

@ -25,7 +25,7 @@ def hdf5_array(
) -> H5ArrayPath:
array_path = "/" + "_".join([str(s) for s in shape]) + "__" + dtype.__name__
generator = np.random.default_rng()
if not compound:
if dtype is str:
data = generator.random(shape).astype(bytes)

View file

@ -91,7 +91,7 @@ def interfaces():
def test_interface_match_error(interfaces):
"""
Test that `match` and `match_output` raises errors when no or multiple matches
Test that `match` and `match_output` raises errors when no or multiple matches
are found
"""
with pytest.raises(ValueError) as e:

View file

@ -91,6 +91,7 @@ def test_schema_number():
def test_ndarray_union():
generator = np.random.default_rng()
class Model(BaseModel):
array: Optional[
Union[

View file

@ -116,7 +116,7 @@ def test_absolute_path(hdf5_at_path, tmp_output_dir, model_blank):
def test_walk_and_apply():
"""
Walk and apply should recursively apply a function to everything in a
Walk and apply should recursively apply a function to everything in a
nesty structure
"""
test = {