Skip to content

Commit

Permalink
Update dependencies and fix resulting bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
pvandyken committed Apr 17, 2024
1 parent 1493940 commit 7c7faf9
Show file tree
Hide file tree
Showing 37 changed files with 2,888 additions and 36 deletions.
16 changes: 8 additions & 8 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,23 @@ pandas = [
{ version = "<=2.0.3", python = "<3.9" },
{ version = ">=2.1.1", python = ">=3.12" },
]
# minimum 8.2.0 to use post-copy mesages
copier = ">=8.2.0"
# minimum 9.2.0 because of breaking dependency changes and changes to validation errors
copier = ">=9.2.0"
jinja2-time = ">=0.2.0"
# minimum 2.31.0 because of security vulnerability
requests = ">=2.31.0"
ruamel-yaml = ">=0.17.2"
lazy-loader = ">=0.3"
# Docutils is a requirement of snakemake, for snakebids otherwise it is merely a doc
# dependency. Can't do 0.21 with poetry because of https://github.com/python-poetry/poetry/issues/9293
docutils = "!=0.21.1"
# dependency. 0.21.post1 needs to be excluded because of
# https://github.com/python-poetry/poetry/issues/9293
docutils = "!=0.21.post1"

[tool.poetry.group.dev.dependencies]
pytest = "^7.0.0"
pytest-mock = "^3.7.0"
poethepoet = "^0.25.1"
pre-commit = "^3.0.0"
# need custom fork of mkinit to handle .pyi files. PR to main repo pending
# a mkinit dep has the 'platform_system == "Windows"' as a marker on an incompatible dependeny
# (pydantic<2.0 cf copier), so set the inverse as a marker here so mkinit can
# still be resolved
Expand All @@ -90,7 +90,9 @@ pytest-benchmark = "^4.0.0"
pyfakefs = "^5.1.0"
pyparsing = "^3.0.9"
pathvalidate = "^3.0.0"
pyright = "^1.1.339"
# Bug in .358 preventing the types from the converter arguments of attrs classes to
# propogate properly
pyright = "^1.1.339,<1.1.358"
ruff = "^0.1.7"
pytest-xdist = "^3.3.1"
pytest-split = "^0.8.1"
Expand Down
2 changes: 1 addition & 1 deletion snakebids/io/yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def path2str(dumper: Dumper, data: Path):
return dumper.represent_scalar(
"tag:yaml.org,2002:str",
str(data),
) # type: ignore
)

def to_dict(dumper: Dumper, data: OrderedDict[Any, Any]):
return dumper.represent_dict(dict(data))
Expand Down
4 changes: 3 additions & 1 deletion snakebids/tests/test_generate_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,9 @@ def test_collects_only_filtered_entities(
name="foo", path=get_bids_path(result_filtered), zip_lists=result_filtered
)

@settings(deadline=400, suppress_health_check=[HealthCheck.function_scoped_fixture])
@settings(
deadline=None, suppress_health_check=[HealthCheck.function_scoped_fixture]
)
@given(path_entities=path_entities())
def test_collect_all_but_filters_when_exclusion_filters_used(
self,
Expand Down
5 changes: 2 additions & 3 deletions snakebids/tests/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import copier
import more_itertools as itx
import pathvalidate
import prompt_toolkit.validation
import pytest
import requests_mock
from hypothesis import HealthCheck, assume, given, settings
Expand Down Expand Up @@ -98,7 +97,7 @@ def invalid_emails():
def test_invalid_email_raises_error(email: str, tmp_path: Path):
data = get_empty_data("testapp", "setuptools")
data["email"] = email
with pytest.raises(prompt_toolkit.validation.ValidationError):
with pytest.raises(ValueError, match="Must be a valid email"):
copier.run_copy(
str(Path(itx.first(snakebids.__path__), "project_template")),
tmp_path / data["app_full_name"],
Expand Down Expand Up @@ -184,7 +183,7 @@ def test_gets_correct_snakebids_version(
@allow_function_scoped
def test_invalid_app_name_raises_error(name: str, tmp_path: Path):
data = get_empty_data(name, "setuptools")
with pytest.raises(prompt_toolkit.validation.ValidationError):
with pytest.raises(ValueError, match="Name must be a valid"):
copier.run_copy(
str(Path(itx.first(snakebids.__path__), "project_template")),
tmp_path / data["app_full_name"],
Expand Down
4 changes: 2 additions & 2 deletions snakebids/utils/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def __repr__(self) -> str:
return f"{self.__class__.__name__}({list(self._data)})"

@override
def __contains__(self, item: object, /) -> bool:
return item in self._data
def __contains__(self, value: object) -> bool:
return value in self._data

@override
def __hash__(self):
Expand Down
15 changes: 0 additions & 15 deletions typings/importlib_metadata/__init__.pyi

This file was deleted.

17 changes: 17 additions & 0 deletions typings/ruamel/yaml/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""
This type stub file was generated by pyright.
"""

from __future__ import annotations

from typing import Any

from ruamel.yaml.main import *

from .cyaml import *

if False: ...
_package_data: dict[Any, Any] = ...
version_info = ...
__version__ = ...
__with_libyaml__ = ...
12 changes: 12 additions & 0 deletions typings/ruamel/yaml/anchor.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""
This type stub file was generated by pyright.
"""

if False: ...
anchor_attrib = ...

class Anchor:
__slots__ = ...
attrib = ...
def __init__(self) -> None: ...
def __repr__(self) -> Any: ...
Loading

0 comments on commit 7c7faf9

Please sign in to comment.