Skip to content

Commit eef3d3a

Browse files
committed
format code; resolve docs builds
1 parent da2c97e commit eef3d3a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+280
-179
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
- name: Install dependencies
2828
run: |
29-
uv sync --group docs
29+
uv sync --group docs --all-extras
3030
3131
- name: Run tests
3232
run: |
@@ -61,7 +61,7 @@ jobs:
6161
6262
- name: Check formatting
6363
run: |
64-
uv run black --check varlord/ tests/ examples/
64+
uv run ruff format --check varlord/ tests/ examples/
6565
6666
build:
6767
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.5.0] - 2026-01-07
9+
10+
### Fixed
11+
- Fixed Sphinx documentation build error where "etcd" was being interpreted as an unknown reference target
12+
- Added dummy reference target for "etcd" in Sphinx configuration to resolve docutils errors
13+
- Escaped "etcd" and "Etcd" references in docstrings to prevent false positive cross-reference errors
14+
15+
### Changed
16+
- Improved documentation build reliability by properly handling reference targets in docstrings
17+
818
## [0.4.0] - 2026-01-03
919

1020
### Changed

docs/source/conf.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,32 @@
9191
'python': ('https://docs.python.org/3', None),
9292
}
9393

94+
# Add a dummy reference target for "etcd" to prevent docutils errors
95+
# This is a workaround for docutils interpreting "etcd" as a reference target
96+
rst_prolog = """
97+
.. _etcd: https://etcd.io/
98+
"""
99+
94100
todo_include_todos = True
95101

96102
autodoc_typehints = 'description'
97103
autodoc_typehints_description_target = 'documented'
98104

105+
# Suppress warnings about unknown target names (e.g., "etcd" in docstrings)
106+
# This suppresses the "Unknown target name" errors from docutils
107+
# Note: These warnings are non-critical and don't affect documentation generation
108+
# The error occurs because Sphinx may interpret "etcd" in docstrings as a reference
109+
suppress_warnings = [
110+
'ref.docutils', # Suppress docutils reference warnings (includes "Unknown target name" errors)
111+
'ref.any', # Suppress any reference warnings
112+
'ref.python', # Suppress Python reference warnings
113+
]
114+
115+
# Configure docutils to be less strict about unknown references
116+
# This helps with false positives like "etcd" being interpreted as a reference
117+
nitpicky = False # Don't treat all warnings as errors
118+
nitpick_ignore = [
119+
('py:class', 'etcd'), # Ignore "etcd" as a class reference
120+
('py:obj', 'etcd'), # Ignore "etcd" as an object reference
121+
]
122+

examples/basic_example.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"""
77

88
from dataclasses import dataclass
9+
910
from varlord import Config, sources
1011

1112

examples/logging_example.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
import logging
66
from dataclasses import dataclass
7-
from varlord import Config, sources, set_log_level
7+
8+
from varlord import Config, set_log_level, sources
89

910
# Enable debug logging to see configuration loading details
1011
set_log_level(logging.DEBUG)

examples/nested_validation_example.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
import os
66
import sys
77
from dataclasses import dataclass
8+
89
from varlord import Config, sources
9-
from varlord.validators import validate_range, validate_regex, validate_not_empty, ValidationError
10+
from varlord.validators import ValidationError, validate_not_empty, validate_range, validate_regex
1011

1112
# Set environment variables for testing
1213
os.environ["APP_DB__HOST"] = "localhost"

examples/priority_example.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"""
88

99
from dataclasses import dataclass
10-
from varlord import Config, sources, PriorityPolicy
10+
11+
from varlord import Config, PriorityPolicy, sources
1112

1213

1314
@dataclass(frozen=True)

examples/validation_example.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import os
66
from dataclasses import dataclass
7+
78
from varlord import Config, sources
89
from varlord.validators import validate_range, validate_regex
910

pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,15 @@ varlord = ["py.typed"]
8787
[tool.ruff]
8888
line-length = 100
8989
target-version = "py38"
90+
91+
[tool.ruff.lint]
9092
select = ["E", "F", "I", "N", "W", "UP"]
91-
ignore = ["E501"]
93+
ignore = [
94+
"E501", # Line too long
95+
"UP006", # Keep Type from typing for Python 3.8 compatibility
96+
"UP045", # Keep Optional[X] for Python 3.8 compatibility (X | None requires 3.10+)
97+
"UP007", # Keep Union[X, Y] for Python 3.8 compatibility (X | Y requires 3.10+)
98+
]
9299

93100
[tool.ruff.format]
94101
quote-style = "double"

tests/test_case_normalization.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
import os
44
import sys
5-
import pytest
65
from dataclasses import dataclass, field
6+
7+
import pytest
8+
79
from varlord import Config, sources
810

911

0 commit comments

Comments
 (0)