From c3b930d9cc4496b3d94773048ff1c27e765d22a5 Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Wed, 29 Jul 2026 12:28:20 -0500 Subject: [PATCH 1/4] Use scriv to manage the CHANGELOG --- CHANGELOG.rst | 21 ++++++++++++++ .../20260729_122729_kurtmckee_use_scriv.rst | 4 +++ changelog.d/fragment-template.rst.jinja2 | 28 +++++++++++++++++++ docs/changelog.rst | 2 ++ pyproject.toml | 25 +++++++++++++++++ 5 files changed, 80 insertions(+) create mode 100644 changelog.d/20260729_122729_kurtmckee_use_scriv.rst create mode 100644 changelog.d/fragment-template.rst.jinja2 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index da91c7b..b0fad0b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,27 @@ +.. + This is the feedparser-sgmllib changelog. + + It is managed and updated by scriv during development. + Do not edit this file directly. + Instead, run "scriv create" to create a new changelog fragment. + + CHANGELOG ######### + +Unreleased changes +================== + +Please see the fragment files in the `changelog.d directory`_. + +.. _changelog.d directory: https://github.com/python-syndication/feedparser-sgmllib/tree/main/changelog.d + + +.. scriv-insert-here + +.. _changelog-1.0.0: + 1.0.0 - 2026-07-27 ================== diff --git a/changelog.d/20260729_122729_kurtmckee_use_scriv.rst b/changelog.d/20260729_122729_kurtmckee_use_scriv.rst new file mode 100644 index 0000000..c99de23 --- /dev/null +++ b/changelog.d/20260729_122729_kurtmckee_use_scriv.rst @@ -0,0 +1,4 @@ +Development +----------- + +* Use scriv to manage the CHANGELOG. diff --git a/changelog.d/fragment-template.rst.jinja2 b/changelog.d/fragment-template.rst.jinja2 new file mode 100644 index 0000000..de56313 --- /dev/null +++ b/changelog.d/fragment-template.rst.jinja2 @@ -0,0 +1,28 @@ +.. + + Please select the correct category for the change you are making. + + 1. Remove all lines before and after the chosen category + including these instructions and the divider lines that + use tildes ("~"). + + 2. Remove the four spaces in front of the remaining text. + + 3. Describe your change using active verbs and full sentences. + For example, write "Support a new feature" instead of + "Supports a new feature" or "A new feature is supported". + + 4. If your change is associated with an issue on GitHub, + list the issue number(s) in parentheses, separated by + commas. For example: + + Support a new feature. (#10, #20) + +{% for category in config.categories %} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + {{ category }} + {{ config.rst_header_chars[1] * (category|length) }} + + * Describe your "{{ category }}" change here. EDIT ME! +{% endfor -%} diff --git a/docs/changelog.rst b/docs/changelog.rst index e64adc2..2265571 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1 +1,3 @@ +:tocdepth: 2 + .. include:: ../CHANGELOG.rst diff --git a/pyproject.toml b/pyproject.toml index 6ba5e3c..e93b19e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,3 +94,28 @@ filterwarnings = [ "error", ] strict = true + + +# scriv +# ----- + +[tool.scriv] +version = "literal: pyproject.toml: project.version" +categories = [ + "Breaking changes", + "Python support", + "Added", + "Fixed", + "Removed", + "Changed", + "Deprecated", + "Security", + "Documentation", + "Development", +] +entry_title_template = "{{ version }} - {{ date.strftime('%Y-%m-%d') }}" +format = "rst" +fragment_directory = "changelog.d" +insert_marker = "scriv-insert-here" +main_branches = ["main", "releases"] +new_fragment_template = "file: fragment-template.rst.jinja2" From 0c83dfe8a132221b473e086fdbeeab96d5229e9b Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Wed, 29 Jul 2026 13:16:48 -0500 Subject: [PATCH 2/4] Use the `sphinx-issues` plugin to link to issues and PRs --- .../20260729_130324_kurtmckee_regular_package.rst | 4 ++++ changelog.d/fragment-template.rst.jinja2 | 10 +++++++--- docs/conf.py | 9 +++++++++ requirements/docs/pyproject.toml | 1 + requirements/docs/requirements.txt | 3 ++- 5 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 changelog.d/20260729_130324_kurtmckee_regular_package.rst diff --git a/changelog.d/20260729_130324_kurtmckee_regular_package.rst b/changelog.d/20260729_130324_kurtmckee_regular_package.rst new file mode 100644 index 0000000..60265f7 --- /dev/null +++ b/changelog.d/20260729_130324_kurtmckee_regular_package.rst @@ -0,0 +1,4 @@ +Documentation +------------- + +* Use the ``sphinx-issues`` plugin to link to issues and PRs. diff --git a/changelog.d/fragment-template.rst.jinja2 b/changelog.d/fragment-template.rst.jinja2 index de56313..6d373ce 100644 --- a/changelog.d/fragment-template.rst.jinja2 +++ b/changelog.d/fragment-template.rst.jinja2 @@ -13,10 +13,14 @@ "Supports a new feature" or "A new feature is supported". 4. If your change is associated with an issue on GitHub, - list the issue number(s) in parentheses, separated by - commas. For example: + list the issue number(s) after the first sentence. + For example: - Support a new feature. (#10, #20) + Support a new feature. (:issue:`10, 20`) + + It's also possible to reference other repositories' issues: + + Fix a bug. (:issue:`group/repo#10`) {% for category in config.categories %} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/conf.py b/docs/conf.py index f7f8525..f264837 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,6 +22,15 @@ # The name of the Pygments (syntax highlighting) style to use. pygments_style = "sphinx" +extensions = [ + "sphinx_issues", +] + +# `sphinx_issues` configuration +# ----------------------------- + +issues_github_path = "python-syndication/feedparser-sgmllib" + # HTML theme configuration # ------------------------ diff --git a/requirements/docs/pyproject.toml b/requirements/docs/pyproject.toml index 9633448..c33ce90 100644 --- a/requirements/docs/pyproject.toml +++ b/requirements/docs/pyproject.toml @@ -6,4 +6,5 @@ name = "dependencies" requires-python = ">=3.10" dependencies = [ "sphinx", + "sphinx_issues", ] diff --git a/requirements/docs/requirements.txt b/requirements/docs/requirements.txt index 49376e8..f2d3ddf 100644 --- a/requirements/docs/requirements.txt +++ b/requirements/docs/requirements.txt @@ -1,6 +1,6 @@ alabaster==1.0.0 ; python_version >= "3.10" babel==2.18.0 ; python_version >= "3.10" -certifi==2026.6.17 ; python_version >= "3.10" +certifi==2026.7.22 ; python_version >= "3.10" charset-normalizer==3.4.9 ; python_version >= "3.10" colorama==0.4.6 ; python_version >= "3.10" and sys_platform == "win32" docutils==0.21.2 ; python_version >= "3.10" @@ -12,6 +12,7 @@ packaging==26.2 ; python_version >= "3.10" pygments==2.20.0 ; python_version >= "3.10" requests==2.34.2 ; python_version >= "3.10" snowballstemmer==3.1.1 ; python_version >= "3.10" +sphinx-issues==6.0.0 ; python_version >= "3.10" sphinx==8.1.3 ; python_version >= "3.10" sphinxcontrib-applehelp==2.0.0 ; python_version >= "3.10" sphinxcontrib-devhelp==2.0.0 ; python_version >= "3.10" From 29be938d536ef2623626aeaaaf666cfa93f9dc4a Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Wed, 29 Jul 2026 13:18:07 -0500 Subject: [PATCH 3/4] Switch from a namespace package to a regular package --- .../20260729_131657_kurtmckee_regular_package.rst | 9 +++++++++ docs/sgmllib.rst | 8 ++++---- pyproject.toml | 13 ++----------- .../sgmllib => feedparser_sgmllib}/__init__.py | 0 .../sgmllib => feedparser_sgmllib}/py.typed | 0 tests/conftest.py | 2 +- tests/test_sgmllib.py | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 changelog.d/20260729_131657_kurtmckee_regular_package.rst rename src/{feedparser/sgmllib => feedparser_sgmllib}/__init__.py (100%) rename src/{feedparser/sgmllib => feedparser_sgmllib}/py.typed (100%) diff --git a/changelog.d/20260729_131657_kurtmckee_regular_package.rst b/changelog.d/20260729_131657_kurtmckee_regular_package.rst new file mode 100644 index 0000000..e833233 --- /dev/null +++ b/changelog.d/20260729_131657_kurtmckee_regular_package.rst @@ -0,0 +1,9 @@ +Breaking changes +---------------- + +* Switch from a namespace package to a regular package. (:issue:`kurtmckee/feedparser#585`) + + The choice to use a namespace package caused development issues in feedparser, + and affected deployments for users. + + The new package name is ``feedparser_sgmllib``. diff --git a/docs/sgmllib.rst b/docs/sgmllib.rst index 8be775e..d386412 100644 --- a/docs/sgmllib.rst +++ b/docs/sgmllib.rst @@ -1,7 +1,7 @@ -:mod:`sgmllib` --- Simple SGML parser -===================================== +API documentation +================= -.. module:: sgmllib +.. module:: feedparser_sgmllib :synopsis: Support parsing XML feeds and HTML. .. index:: single: SGML @@ -139,7 +139,7 @@ A single exception is defined as well: .. method:: SGMLParser.convert_codepoint(codepoint) Convert a code point to a :class:`str` value. Encodings can be handled here if - appropriate, though the rest of :mod:`sgmllib` is oblivious on this matter. + appropriate, though the rest of :mod:`feedparser_sgmllib` is oblivious on this matter. .. method:: SGMLParser.handle_entityref(ref) diff --git a/pyproject.toml b/pyproject.toml index e93b19e..5fb0ca3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,15 +19,6 @@ requires = ["poetry-core>=2.0.0,<3.0.0"] build-backend = "poetry.core.masonry.api" -# poetry -# ------ - -[tool.poetry] -packages = [ - { include = "feedparser", from = "src" } -] - - # coverage # -------- @@ -36,7 +27,7 @@ relative_files = true parallel = true branch = true source = [ - "feedparser.sgmllib", + "feedparser_sgmllib", "tests", ] @@ -72,7 +63,7 @@ force_single_line = true # ---- [tool.mypy] -packages = "feedparser.sgmllib" +packages = "feedparser_sgmllib" strict = true sqlite_cache = true enable_error_code = [ diff --git a/src/feedparser/sgmllib/__init__.py b/src/feedparser_sgmllib/__init__.py similarity index 100% rename from src/feedparser/sgmllib/__init__.py rename to src/feedparser_sgmllib/__init__.py diff --git a/src/feedparser/sgmllib/py.typed b/src/feedparser_sgmllib/py.typed similarity index 100% rename from src/feedparser/sgmllib/py.typed rename to src/feedparser_sgmllib/py.typed diff --git a/tests/conftest.py b/tests/conftest.py index 97dea4b..d4dd00d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2,7 +2,7 @@ import pytest -import feedparser.sgmllib as sgmllib +import feedparser_sgmllib as sgmllib @pytest.fixture diff --git a/tests/test_sgmllib.py b/tests/test_sgmllib.py index 14c5a1a..0387e8a 100644 --- a/tests/test_sgmllib.py +++ b/tests/test_sgmllib.py @@ -3,7 +3,7 @@ import pytest -import feedparser.sgmllib as sgmllib +import feedparser_sgmllib as sgmllib def test_doctype_decl_internal(event_collector): From 12a7c36bcf43bd685bb9423df6d3c551002f70b7 Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Thu, 30 Jul 2026 07:37:52 -0500 Subject: [PATCH 4/4] Update project metadata --- CHANGELOG.rst | 27 +++++++++++++++++++ .../20260729_122729_kurtmckee_use_scriv.rst | 4 --- ...60729_130324_kurtmckee_regular_package.rst | 4 --- ...60729_131657_kurtmckee_regular_package.rst | 9 ------- pyproject.toml | 2 +- 5 files changed, 28 insertions(+), 18 deletions(-) delete mode 100644 changelog.d/20260729_122729_kurtmckee_use_scriv.rst delete mode 100644 changelog.d/20260729_130324_kurtmckee_regular_package.rst delete mode 100644 changelog.d/20260729_131657_kurtmckee_regular_package.rst diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b0fad0b..267615d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -20,6 +20,33 @@ Please see the fragment files in the `changelog.d directory`_. .. scriv-insert-here +.. _changelog-2.0.0: + +2.0.0 - 2026-07-30 +================== + +Breaking changes +---------------- + +* Switch from a namespace package to a regular package. (:issue:`kurtmckee/feedparser#585`) + + The namespace package caused issues in the feedparser dev environment + due to conflicts with editable installs of feedparser. + It also adversely affected deployments for users + due to separated installs between system and venv environments. + + The new package name is ``feedparser_sgmllib``. + +Documentation +------------- + +* Use the ``sphinx-issues`` plugin to link to issues and PRs. + +Development +----------- + +* Use scriv to manage the CHANGELOG. + .. _changelog-1.0.0: 1.0.0 - 2026-07-27 diff --git a/changelog.d/20260729_122729_kurtmckee_use_scriv.rst b/changelog.d/20260729_122729_kurtmckee_use_scriv.rst deleted file mode 100644 index c99de23..0000000 --- a/changelog.d/20260729_122729_kurtmckee_use_scriv.rst +++ /dev/null @@ -1,4 +0,0 @@ -Development ------------ - -* Use scriv to manage the CHANGELOG. diff --git a/changelog.d/20260729_130324_kurtmckee_regular_package.rst b/changelog.d/20260729_130324_kurtmckee_regular_package.rst deleted file mode 100644 index 60265f7..0000000 --- a/changelog.d/20260729_130324_kurtmckee_regular_package.rst +++ /dev/null @@ -1,4 +0,0 @@ -Documentation -------------- - -* Use the ``sphinx-issues`` plugin to link to issues and PRs. diff --git a/changelog.d/20260729_131657_kurtmckee_regular_package.rst b/changelog.d/20260729_131657_kurtmckee_regular_package.rst deleted file mode 100644 index e833233..0000000 --- a/changelog.d/20260729_131657_kurtmckee_regular_package.rst +++ /dev/null @@ -1,9 +0,0 @@ -Breaking changes ----------------- - -* Switch from a namespace package to a regular package. (:issue:`kurtmckee/feedparser#585`) - - The choice to use a namespace package caused development issues in feedparser, - and affected deployments for users. - - The new package name is ``feedparser_sgmllib``. diff --git a/pyproject.toml b/pyproject.toml index 5fb0ca3..941ff3e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "feedparser-sgmllib" description = "sgmllib from Python 2.7. For feedparser use only." -version = "1.0.0" +version = "2.0.0" maintainers = [ { name = "Kurt McKee", email = "contactme@kurtmckee.org" }, ]