diff --git a/CHANGELOG.rst b/CHANGELOG.rst index da91c7b..267615d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,54 @@ +.. + 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-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/fragment-template.rst.jinja2 b/changelog.d/fragment-template.rst.jinja2 new file mode 100644 index 0000000..6d373ce --- /dev/null +++ b/changelog.d/fragment-template.rst.jinja2 @@ -0,0 +1,32 @@ +.. + + 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) after the first sentence. + For example: + + 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 %} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + {{ 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/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/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 6ba5e3c..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" }, ] @@ -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 = [ @@ -94,3 +85,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" 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" 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):