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
21 changes: 21 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version, and other tools you might need
build:
os: ubuntu-lts-latest
tools:
python: "3.14"

Comment thread
jkowalleck marked this conversation as resolved.
# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py

python:
install:
- requirements: docs/requirements.txt

formats: all
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ All notable changes to this project will be documented in this file.
* New dict `RFC3987_SYNTAX_TERM_VALIDATORS` mapping `RFC3987_SYNTAX_TERMS` to validator function (via [#49])
* Performance
* Public symbols use lazy loading (via [#43], [#59])
* Docs:
* Added docstrings to public API (via [#58])
* Tests
* Add grammar regression tests (via [#48])

Expand All @@ -36,6 +38,7 @@ All notable changes to this project will be documented in this file.
[#50]: https://github.com/jkowalleck/rfc3987-syntax2/pull/50
[#51]: https://github.com/jkowalleck/rfc3987-syntax2/pull/51
[#52]: https://github.com/jkowalleck/rfc3987-syntax2/pull/52
[#58]: https://github.com/jkowalleck/rfc3987-syntax2/pull/58
[#59]: https://github.com/jkowalleck/rfc3987-syntax2/pull/59

## v1.2.0 - 2026-07-16
Expand Down
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/_build
54 changes: 54 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import tomllib
from pathlib import Path
from datetime import datetime


_ROOT = Path(__file__).resolve().parents[1]
_pyproject = tomllib.loads((_ROOT / "pyproject.toml").read_text(encoding="utf-8"))

project = _pyproject["project"]["name"]
author = ", ".join(a["name"] for a in _pyproject["project"].get("authors", [])) or "Unknown"
copyright = f"{datetime.now().year}, {author}"

release = _pyproject["project"].get("version", "-dev")


extensions = [
"sphinx.ext.autodoc",
# "sphinx.ext.viewcode",
"autoapi.extension",
"sphinx_rtd_theme",
"myst_parser",
]

source_suffix = ['.rst', '.md']

autoapi_type = 'python'
autoapi_dirs = ['../src/rfc3987_syntax2']
# see https://sphinx-autoapi.readthedocs.io/en/latest/reference/config.html#confval-autoapi_options
autoapi_options = [
'show-module-summary',
'members',
'undoc-members',
'inherited-members',
'show-inheritance',
'imported-members'
]


# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
# see https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-exclude_patterns
exclude_patterns = [
'_dev', # internal docs
'_build', # build target
'.*', '**/.*', # dotfiles and folders
'Thumbs.db', '**/Thumbs.db',
]

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

9 changes: 9 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. include:: ../README.md
:parser: myst_parser.sphinx_

.. toctree::
:maxdepth: 2
:caption: Contents:
:titlesonly:

autoapi/index
6 changes: 6 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@


myst-parser>=5.1.0,<6
sphinx>=9,<10
sphinx-autoapi>=3,<4
sphinx-rtd-theme>=3,<4
9 changes: 8 additions & 1 deletion src/rfc3987_syntax2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@
# Copyright (c) 2026 Jan Kowalleck - modifications and maintenance
# SPDX-License-Identifier: MIT

from typing import Any
"""
Re-export of :mod:`.syntax_helpers`
"""

from typing import Any, TYPE_CHECKING

from . import syntax_helpers as _syntax_helpers

__all__ = _syntax_helpers.__all__

_EXPORTS_SH = frozenset(_syntax_helpers.__all__)

if TYPE_CHECKING:
from .syntax_helpers import *
# cannot simply re-export - need to respect lazy-loading

def __getattr__(name: str) -> Any:
if name in _EXPORTS_SH:
Expand Down
Loading