Skip to content

[WIP] feat!: move public API to __init__ - #65

Draft
jkowalleck wants to merge 5 commits into
mainfrom
bc/move-export-to-init
Draft

jkowalleck wants to merge 5 commits into
mainfrom
bc/move-export-to-init

Conversation

@jkowalleck

@jkowalleck jkowalleck commented Jul 21, 2026 •

Copy link
Copy Markdown
Collaborator

fixes #64

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
@jkowalleck jkowalleck added enhancement New feature or request Breacking Change labels Jul 21, 2026
@read-the-docs-community

read-the-docs-community Bot commented Jul 21, 2026 •

Copy link
Copy Markdown

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR consolidates the package’s public API by moving the previously exposed symbols from syntax_helpers.py (and the small helper in utils.py) into rfc3987_syntax2/__init__.py, aligning with the breaking-change request in issue #64.

Changes:

  • Removed rfc3987_syntax2.syntax_helpers and moved its public API into rfc3987_syntax2 (package root).
  • Removed rfc3987_syntax2.utils and inlined grammar loading logic into __init__.py.
  • Added a BREAKING note to the Unreleased section of the changelog.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

File Description
src/rfc3987_syntax2/utils.py Removes the old grammar-loading helper module.
src/rfc3987_syntax2/syntax_helpers.py Removes the prior public-API module (API is now at package root).
src/rfc3987_syntax2/__init__.py Becomes the primary public API surface, containing parser/validator APIs and lazy-loaded attributes.
CHANGELOG.md Documents the breaking removal of the old submodules.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +120 to 124
T_SYNTAX_PARSER_TERM = Literal["iri", "iri_reference", "absolute_iri"]
"""Top-level RFC 3987 parser start terms accepted by :func:`parse` and :func:`check`.

Allowed values are ``"iri"``, ``"iri_reference"``, and ``"absolute_iri"``.
"""
Comment thread CHANGELOG.md
Comment on lines +9 to +11
BREAKING:
- removed `.syntax_helpers`
- removed `.utils`
Comment thread CHANGELOG.md
Comment on lines +9 to +11
BREAKING:
- removed `.syntax_helpers`
- removed `.utils`

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

src/rfc3987_syntax2/init.py:124

  • Docstring references :func:check, but there is no check function exported from this module. This makes the public docs inaccurate and can confuse users.
T_SYNTAX_PARSER_TERM = Literal["iri", "iri_reference", "absolute_iri"]
"""Top-level RFC 3987 parser start terms accepted by :func:`parse` and :func:`check`.

Allowed values are ``"iri"``, ``"iri_reference"``, and ``"absolute_iri"``.
"""

CHANGELOG.md:11

  • The changelog notes removed modules but doesn’t provide a migration hint for users. Adding the new import path here would make the breaking change actionable.
BREAKING:
- removed `.syntax_helpers`
- removed `.utils`

Comment on lines +5 to +10
from pathlib import Path
from threading import Lock
from typing import TYPE_CHECKING, Any, Callable, Literal, Optional
from warnings import warn

from lark import Lark, ParseTree, exceptions
@jkowalleck
jkowalleck marked this pull request as draft July 21, 2026 20:12
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
@jkowalleck jkowalleck changed the title feat!: move public API to __init__ [WIP] feat!: move public API to __init__ Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breacking Change enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BC: move public API to __init__

2 participants