Skip to content
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
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ When stuck in debugging loops:
In your Sphinx `conf.py`:
```python
extensions = ["linkify_issues"]
issue_url_tpl = 'https://github.com/git-pull/gp-libs/issues/{issue_id}'
issue_url_tpl = "https://github.com/git-pull/gp-libs/issues/{issue_id}"
```

## References
Expand Down
15 changes: 15 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,21 @@ what each key holds. They previously reached the rendered API reference as

### Development

#### Minimum ruff 0.16 (#82)

Minimum `ruff>=0.16.0` (was unpinned). ruff 0.16 formats Python and pycon code
blocks inside Markdown, so `ruff format` now reaches documentation snippets
alongside the Python sources. Without a floor, a contributor on an older ruff
would see `ruff format --check` disagree with CI.

#### ruff's default rule set is enabled (#82)

Linting runs ruff's curated default rule set, with this project's own linters
layered on top of it via `extend-select`. The config previously used `select`,
which _replaces_ the default set rather than extending it, so every rule the
list did not name was silently switched off. Expect findings from rules the
project never deliberately opted out of.

#### CI actions updated to current majors

Workflow actions moved to their current major releases: `actions/checkout` v7,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ In your _conf.py_:

```python
# linkify_issues
issue_url_tpl = 'https://github.com/git-pull/gp-libs/issues/{issue_id}'
issue_url_tpl = "https://github.com/git-pull/gp-libs/issues/{issue_id}"
```

The config variable is formatted via `str.format()` where `issue_id` is
Expand Down
14 changes: 10 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ dev = [
"coverage",
"pytest-cov",
# Lint
"ruff",
"ruff>=0.16.0",
"mypy",
"typing-extensions",
"types-docutils",
Expand All @@ -88,7 +88,7 @@ coverage =[
"pytest-cov",
]
lint = [
"ruff",
"ruff>=0.16.0",
"mypy",
"typing-extensions",
"types-docutils",
Expand Down Expand Up @@ -151,7 +151,10 @@ files = [
target-version = "py310"

[tool.ruff.lint]
select = [
# `select` is deliberately unset: ruff 0.16 enables a curated default rule
# set, and an explicit `select` would replace it rather than extend it.
# `extend-select` layers this project's additional linters on top.
extend-select = [
"E", # pycodestyle
"F", # pyflakes
"I", # isort
Expand All @@ -168,7 +171,7 @@ select = [
"PERF", # Perflint
"RUF", # Ruff-specific rules
"D", # pydocstyle
"FA100", # future annotations
"FA100", # future annotations
]
ignore = [
"COM812", # missing trailing comma, ruff format conflict
Expand Down Expand Up @@ -198,6 +201,9 @@ convention = "numpy"

[tool.ruff.lint.per-file-ignores]
"*/__init__.py" = ["F401"]
# Sphinx conf.py reads the package's metadata by exec'ing its source, so
# building the docs never imports gp_libs or its dependencies.
"docs/conf.py" = ["S102"] # flake8-bandit: exec-builtin

[tool.pytest.ini_options]
addopts = "--tb=short --no-header --showlocals --doctest-modules"
Expand Down
4 changes: 2 additions & 2 deletions src/doctest_docutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class DocTestFinderNameDoesNotExist(ValueError):
"""Raised with doctest lookup name not provided."""

def __init__(self, string: str) -> None:
return super().__init__(
super().__init__(
"DocTestFinder.find: name must be given "
f"when string.__name__ doesn't exist: {type(string)!r}",
)
Expand Down Expand Up @@ -420,7 +420,7 @@ class TestDocutilsPackageRelativeError(Exception):
"""Raise when doctest_docutils is called for package not relative to module."""

def __init__(self) -> None:
return super().__init__(
super().__init__(
"Package may only be specified for module-relative paths.",
)

Expand Down
17 changes: 16 additions & 1 deletion tests/test_doctest_docutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class FilePathModeNotImplemented(Exception):
"""Raised if file_path_mode not supported."""

def __init__(self, file_path_mode: str) -> None:
return super().__init__(f"No file_path_mode supported for {file_path_mode}")
super().__init__(f"No file_path_mode supported for {file_path_mode}")


@pytest.mark.parametrize(
Expand Down Expand Up @@ -321,3 +321,18 @@ def test_doctestopt_re_whitespace_trimming(
"""
result = doctest_docutils.doctestopt_re.sub("", input_code)
assert result == expected_output


def test_doctest_finder_name_does_not_exist_message() -> None:
"""DocTestFinderNameDoesNotExist reports the offending object's type."""
exc = doctest_docutils.DocTestFinderNameDoesNotExist("not-a-module")

assert "DocTestFinder.find: name must be given" in str(exc)
assert repr(str) in str(exc)


def test_docutils_package_relative_error_message() -> None:
"""TestDocutilsPackageRelativeError states the module-relative constraint."""
exc = doctest_docutils.TestDocutilsPackageRelativeError()

assert str(exc) == "Package may only be specified for module-relative paths."
46 changes: 23 additions & 23 deletions uv.lock

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