Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent installation of docutils==0.21.post1 #402

Merged
merged 2 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,559 changes: 912 additions & 647 deletions poetry.lock

Large diffs are not rendered by default.

24 changes: 16 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +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. 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.24.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 @@ -87,14 +90,16 @@ 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"
tomli = "^2.0.1"
requests-mock = "^1.11.0"
pytest-cov = "^4.1.0"
docstring-parser = "^0.15"
pytest-cov = "^5.0"
docstring-parser = "^0.16"


[tool.poetry.group.docs.dependencies]
Expand All @@ -106,7 +111,10 @@ furo = "^2023.9.10"
sphinx-copybutton = "^0.5.2"
sphinx-reredirects = "^0.1.3"
sphinx-design = "^0.5.0"
sphinx-autobuild = "^2021.3.14"
sphinx-autobuild = [
{ version = "^2021.03.14", python = "3.8" },
{ version = "^2024.02.04", python = ">=3.9" },
]

[tool.poetry.scripts]
snakebids = "snakebids.admin:main"
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