Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-sphinxext-opengraph for 
openSUSE:Factory checked in at 2023-01-07 17:19:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-sphinxext-opengraph (Old)
 and      /work/SRC/openSUSE:Factory/.python-sphinxext-opengraph.new.1563 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-sphinxext-opengraph"

Sat Jan  7 17:19:56 2023 rev:3 rq:1056770 version:0.7.5

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-sphinxext-opengraph/python-sphinxext-opengraph.changes
    2022-11-01 13:42:16.455802253 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-sphinxext-opengraph.new.1563/python-sphinxext-opengraph.changes
  2023-01-07 17:23:18.459442167 +0100
@@ -1,0 +2,19 @@
+Sat Jan  7 12:46:14 UTC 2023 - Dirk Müller <[email protected]>
+
+- update to v0.7.5:
+  * check for description length before subscripting
+  * Use Sphinx Builder method to get page url
+  * Fix field names in readme
+  * Allow dirhtml builder without ogp_site_url
+  * Take default og:site_name from sphinx project config value
+  * Do not append index with dirhtml
+  * Create wheel with version number not "main"
+  * Don't run CI on tag and push
+  * Fix option name in README.md.
+  * Test multiple Sphinx and OS versions
+  * Fix ci workflow syntax
+  * Tidy up whitespace
+  * ci: Pin PyPI publish action to v1
+  * Add support for meta description
+
+-------------------------------------------------------------------

Old:
----
  sphinxext-opengraph-0.6.3.tar.gz

New:
----
  sphinxext-opengraph-0.7.5.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-sphinxext-opengraph.spec ++++++
--- /var/tmp/diff_new_pack.TVT7jR/_old  2023-01-07 17:23:18.855444529 +0100
+++ /var/tmp/diff_new_pack.TVT7jR/_new  2023-01-07 17:23:18.859444553 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-sphinxext-opengraph
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -27,13 +27,14 @@
 %endif
 %define skip_python2 1
 Name:           python-sphinxext-opengraph
-Version:        0.6.3
+Version:        0.7.5
 Release:        0
 Summary:        Sphinx Extension to enable OGP support
 License:        MIT
 URL:            https://github.com/wpilibsuite/sphinxext-opengraph
 Source:         
https://github.com/wpilibsuite/sphinxext-opengraph/archive/v%{version}.tar.gz#/sphinxext-opengraph-%{version}.tar.gz
-BuildRequires:  %{python_module setuptools}
+BuildRequires:  %{python_module pip}
+BuildRequires:  %{python_module wheel}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
 Requires:       python3-Sphinx >= 2.0
@@ -53,11 +54,11 @@
 %setup -q -n sphinxext-opengraph-%{version}
 
 %build
-%python_build
+%pyproject_wheel
 
 %install
 %if !%{with test}
-%python_install
+%pyproject_install
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 %endif
 

++++++ sphinxext-opengraph-0.6.3.tar.gz -> sphinxext-opengraph-0.7.5.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sphinxext-opengraph-0.6.3/.github/workflows/workflow.yml 
new/sphinxext-opengraph-0.7.5/.github/workflows/workflow.yml
--- old/sphinxext-opengraph-0.6.3/.github/workflows/workflow.yml        
2022-03-29 19:45:08.000000000 +0200
+++ new/sphinxext-opengraph-0.7.5/.github/workflows/workflow.yml        
2023-01-03 21:37:53.000000000 +0100
@@ -1,60 +1,120 @@
 name: Test and Deploy
 on:
   pull_request:
-    branches: 
-      - main
-  push:
     branches:
       - main
-  create:
-    tags:
-      - '*'
+  push:
+
+env:
+  FORCE_COLOR: 1
+
 jobs:
   check:
     runs-on: ubuntu-latest
+
+    # We want to run on external PRs, but not on our own internal PRs as 
they'll be run
+    # by the push to the branch.
+    if: github.event_name == 'push' || 
github.event.pull_request.head.repo.full_name != github.repository
+
     steps:
-    - uses: actions/checkout@v2
-    - uses: actions/setup-python@v2
+    - uses: actions/checkout@v3
+    - uses: actions/setup-python@v4
       with:
-        python-version: 3.8
+        python-version: '3.x'
+        cache: pip
+        cache-dependency-path: .github/workflows/workflow.yml
     - name: Black
       run: |
         pip install black
         black --check --exclude /docs --diff .
 
-  test-extension:
+  build-wheel:
     runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v3
+        with:
+          fetch-depth: 0
+      - name: Set up Python
+        uses: actions/setup-python@v4
+        with:
+          python-version: "3.7"
+          cache: pip
+          cache-dependency-path: |
+            .github/workflows/workflow.yml
+            dev-requirements.txt
+      - name: Install dependencies
+        run: |
+          set -xe
+          python -VV
+          python -m site
+          python -m pip install --upgrade pip setuptools wheel
+          python -m pip install -r dev-requirements.txt
+      - name: Install package
+        run: |
+          python -m pip install .
+      - name: Build wheel
+        run: |
+          python -m pip install build
+          python -m build
+      - name: Upload sdist and wheel artifacts
+        uses: actions/upload-artifact@v3
+        with:
+          name: my-dist
+          path: dist/*
+
+  test:
+    needs: build-wheel
+    runs-on: ${{ matrix.os }}
     strategy:
+      fail-fast: false
       matrix:
-        python-version: ['3.6', '3.7',  '3.8', '3.9', 'pypy3']
+        python-version: ['3.7',  '3.8', '3.9', '3.10', '3.11', 'pypy3.8']
+        sphinx-version: ['>=4,<5', '>=5,<6', '>=6a0,<7']
+        os: [windows-latest, macos-latest, ubuntu-latest]
+        exclude:
+          # Sphinx 6 supports 3.8+
+          - { python-version: '3.7', sphinx-version: '>=6a0,<7' }
     steps:
-      - uses: actions/checkout@v2
-      - name: Setup Python
-        uses: actions/setup-python@v2
+      - uses: actions/checkout@v3
+      - name: Set up Python ${{ matrix.python-version }}
+        uses: actions/setup-python@v4
         with:
           python-version: ${{ matrix.python-version }}
+          cache: pip
+          cache-dependency-path: |
+            .github/workflows/workflow.yml
+            dev-requirements.txt
       - name: Install dependencies
         run: |
-          set -xe
           python -VV
           python -m site
           python -m pip install --upgrade pip setuptools wheel
           python -m pip install -r dev-requirements.txt
-      - name: Install Package
+          python -m pip install "sphinx${{ matrix.sphinx-version }}"
+      - name: Download sdist and wheel artifacts
+        uses: actions/download-artifact@v3
+        with:
+          name: my-dist
+          path: dist
+      - name: Install downloaded wheel
         run: |
-          python -m pip install .
-      - name: Run Tests for ${{ matrix.python-version }}
+          python -m pip install --only-binary=:all: --no-index 
--find-links=dist sphinxext-opengraph
+      - name: Run tests for ${{ matrix.python-version }}
         run: |
           python -m pytest -vv
 
   build-docs:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
         with:
           fetch-depth: 0
       - name: Setup Python
-        uses: actions/setup-python@v2
+        uses: actions/setup-python@v4
+        with:
+          python-version: '3.x'
+          cache: pip
+          cache-dependency-path: docs/requirements.txt
       - name: Install dependencies
         run: |
           pip install -r docs/requirements.txt
@@ -64,27 +124,16 @@
           make html
 
   pypi-release:
-    needs: test-extension
+    needs: test
     runs-on: ubuntu-latest
-    if: contains(github.ref, 'refs/tags/') && github.repository_owner  == 
'wpilibsuite'
+    if: contains(github.ref, 'refs/tags/') && github.repository_owner == 
'wpilibsuite'
     steps:
-      - uses: actions/checkout@v2
-        with:
-          fetch-depth: 0
-      - name: Set up Python
-        uses: actions/setup-python@v2
+      - name: Download sdist and wheel artifacts
+        uses: actions/download-artifact@v3
         with:
-          python-version: '3.7'
-      - name: Install Dependencies
-        run: |
-          python -m pip install --upgrade pip
-          pip install -r ./dev-requirements.txt
-      - name: Build PyPI Wheel
-        run: |
-          python setup.py sdist
-          python setup.py bdist_wheel
+          name: my-dist
+          path: dist
       - name: Publish a Python distribution to PyPI
-        uses: pypa/gh-action-pypi-publish@master
+        uses: pypa/gh-action-pypi-publish@release/v1
         with:
-          user: __token__
           password: ${{ secrets.pypi_password }}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sphinxext-opengraph-0.6.3/README.md 
new/sphinxext-opengraph-0.7.5/README.md
--- old/sphinxext-opengraph-0.6.3/README.md     2022-03-29 19:45:08.000000000 
+0200
+++ new/sphinxext-opengraph-0.7.5/README.md     2023-01-03 21:37:53.000000000 
+0100
@@ -1,12 +1,15 @@
 # sphinxext-opengraph
-![Build](https://github.com/wpilibsuite/sphinxext-opengraph/workflows/Test%20and%20Deploy/badge.svg)
-[![Code style: 
black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
 
-Sphinx extension to generate OpenGraph metadata (https://ogp.me/)
+[![Build](https://github.com/wpilibsuite/sphinxext-opengraph/workflows/Test%20and%20Deploy/badge.svg)](https://github.com/wpilibsuite/sphinxext-opengraph/actions)
+[![Code style: 
Black](https://img.shields.io/badge/code%20style-Black-000000.svg)](https://github.com/psf/black)
+
+Sphinx extension to generate [Open Graph metadata](https://ogp.me/).
 
 ## Installation
 
-`python -m pip install sphinxext-opengraph`
+```sh
+python -m pip install sphinxext-opengraph
+```
 
 ## Usage
 Just add `sphinxext.opengraph` to your extensions list in your `conf.py`
@@ -17,27 +20,29 @@
 ]
 ```
 ## Options
-These values are placed in the conf.py of your sphinx project.
+These values are placed in the `conf.py` of your Sphinx project.
 
-Users hosting documentation on Read The Docs *do not* need to set any of the 
following unless custom configuration is wanted. The extension will 
automatically retrieve your site url.
+Users hosting documentation on Read The Docs *do not* need to set any of the 
following unless custom configuration is wanted. The extension will 
automatically retrieve your site URL.
 
 * `ogp_site_url`
     * This config option is very important, set it to the URL the site is 
being hosted on. 
 * `ogp_description_length`
     * Configure the amount of characters taken from a page. The default of 200 
is probably good for most people. If something other than a number is used, it 
defaults back to 200. 
 * `ogp_site_name`
-    * This is not required. Name of the site. This is displayed above the 
title.
+    * This is not required. Name of the site. This is displayed above the 
title. Defaults to the Sphinx 
[`project`](https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-project)
 config value.  Set to `False` to unset and use no default.
 * `ogp_image`
-    * This is not required. Link to image to show. Note that all relative 
paths are converted to be relative to the root of the html output as defined by 
`ogp_site_name`.
+    * This is not required. Link to image to show. Note that all relative 
paths are converted to be relative to the root of the html output as defined by 
`ogp_site_url`.
 * `ogp_image_alt`
     * This is not required. Alt text for image. Defaults to using 
`ogp_site_name` or the document's title as alt text, if available. Set to 
`False` if you want to turn off alt text completely.
 * `ogp_use_first_image`
-    * This is not required. Set to True to use each page's first image, if 
available. If set to True but no image is found, Sphinx will use `ogp_image` 
instead.
+    * This is not required. Set to `True` to use each page's first image, if 
available. If set to `True` but no image is found, Sphinx will use `ogp_image` 
instead.
 * `ogp_type`
-    * This sets the ogp type attribute, for more information on the types 
available please take a look at https://ogp.me/#types. By default it is set to 
`website`, which should be fine for most use cases.
+    * This sets the ogp type attribute, for more information on the types 
available please take a look at [https://ogp.me/#types](https://ogp.me/#types). 
By default it is set to `website`, which should be fine for most use cases.
 * `ogp_custom_meta_tags`
     * This is not required. List of custom html snippets to insert.
-    
+* `ogp_enable_meta_description`
+    * This is not required. When `True`, generates `<meta name="description" 
content="...">` from the page.
+
 ## Example Config
 
 ### Simple Config
@@ -59,27 +64,30 @@
     '<meta property="og:ignore_canonical" content="true" />',
 ]
 
+ogp_enable_meta_description = True
 ```
 
 ## Per Page Overrides
-[Field 
lists](https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html)
 are used to allow you to override certain settings on each page and set 
unsupported arbitrary OpenGraph tags.
+[Field 
lists](https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html)
 are used to allow you to override certain settings on each page and set 
unsupported arbitrary Open Graph tags.
 
 Make sure you place the fields at the very start of the document such that 
Sphinx will pick them up and also won't build them into the html.
 
 ### Overrides
-These are some overrides that can be used, you can actually override any tag 
and field lists will always take priority.
+These are some overrides that can be used on individual pages, you can 
actually override any tag and field lists will always take priority.
 
-* `:og_description_length:`
-  * Configure the amount of characters to grab for the description of the 
page. If the value isn't a number it will fall back to 
`ogp_description_length`. Note the slightly different syntax because this isn't 
directly an OpenGraph tag.
+* `:ogp_description_length:`
+  * Configure the amount of characters to grab for the description of the 
page. If the value isn't a number it will fall back to 
`ogp_description_length`. Note the slightly different syntax because this isn't 
directly an Open Graph tag.
 * `:og:description:`
   * Lets you override the description of the page.
+* `:description:` or `.. meta::\n :description:`
+  * Sets the `<meta name="description" content="...">` description.
 * `:og:title:`
   * Lets you override the title of the page.
 * `:og:type:`
   * Override the type of the page, for the list of available types take a look 
at https://ogp.me/#types.
-* `:ogp:image:`
+* `:og:image:`
   * Set the image for the page.[^1]
-* `:ogp:image:alt:`
+* `:og:image:alt:`
   * Sets the alt text. Will be ignored if there is no image set.
 
 ### Example
@@ -95,7 +103,7 @@
 ```
 
 ### Arbitrary Tags[^1]
-Additionally, you can use field lists to add any arbitrary OpenGraph tag not 
supported by the extension. The syntax for arbitrary tags is the same with 
`:og:tag: content`. For Example:
+Additionally, you can use field lists to add any arbitrary Open Graph tag not 
supported by the extension. The syntax for arbitrary tags is the same with 
`:og:tag: content`. For example:
 
 ```rst
 :og:video: http://example.org/video.mp4
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sphinxext-opengraph-0.6.3/dev-requirements.txt 
new/sphinxext-opengraph-0.7.5/dev-requirements.txt
--- old/sphinxext-opengraph-0.6.3/dev-requirements.txt  2022-03-29 
19:45:08.000000000 +0200
+++ new/sphinxext-opengraph-0.7.5/dev-requirements.txt  2023-01-03 
21:37:53.000000000 +0100
@@ -1,5 +1,5 @@
 sphinx
-wheel==0.34.2
-pytest==5.4.3
-beautifulsoup4==4.9.1
-setuptools==47.3.1
\ No newline at end of file
+wheel==0.37.1
+pytest==7.1.3
+beautifulsoup4==4.11.1
+setuptools==65.4.1
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sphinxext-opengraph-0.6.3/docs/requirements.txt 
new/sphinxext-opengraph-0.7.5/docs/requirements.txt
--- old/sphinxext-opengraph-0.6.3/docs/requirements.txt 2022-03-29 
19:45:08.000000000 +0200
+++ new/sphinxext-opengraph-0.7.5/docs/requirements.txt 2023-01-03 
21:37:53.000000000 +0100
@@ -1,4 +1,4 @@
-myst-parser==0.15.2
-furo==2021.11.12.1
-sphinx==4.2.0
+myst-parser==0.18.1
+furo==2022.9.29
+sphinx==5.2.3
 ./
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sphinxext-opengraph-0.6.3/docs/source/conf.py 
new/sphinxext-opengraph-0.7.5/docs/source/conf.py
--- old/sphinxext-opengraph-0.6.3/docs/source/conf.py   2022-03-29 
19:45:08.000000000 +0200
+++ new/sphinxext-opengraph-0.7.5/docs/source/conf.py   2023-01-03 
21:37:53.000000000 +0100
@@ -44,7 +44,6 @@
 # This pattern also affects html_static_path and html_extra_path.
 exclude_patterns = []
 
-
 # -- Options for HTML output -------------------------------------------------
 
 # The theme to use for HTML and HTML Help pages.  See the documentation for
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sphinxext-opengraph-0.6.3/setup.py 
new/sphinxext-opengraph-0.7.5/setup.py
--- old/sphinxext-opengraph-0.6.3/setup.py      2022-03-29 19:45:08.000000000 
+0200
+++ new/sphinxext-opengraph-0.7.5/setup.py      2023-01-03 21:37:53.000000000 
+0100
@@ -1,27 +1,12 @@
-import subprocess
-
 import setuptools
 
-# This will fail if something happens or if not in a git repository.
-# This is intentional.
-try:
-    ret = subprocess.run(
-        "git describe --tags --abbrev=0",
-        stdout=subprocess.PIPE,
-        stderr=subprocess.PIPE,
-        check=True,
-        shell=True,
-    )
-    version = ret.stdout.decode("utf-8").strip()
-except:
-    version = "main"
-
-with open("README.md", "r", encoding="utf-8") as readme:
+with open("README.md", encoding="utf-8") as readme:
     long_description = readme.read()
 
 setuptools.setup(
     name="sphinxext-opengraph",
-    version=version,
+    use_scm_version=True,
+    setup_requires=["setuptools_scm"],
     author="Itay Ziv",
     author_email="[email protected]",
     description="Sphinx Extension to enable OGP support",
@@ -29,7 +14,7 @@
     long_description_content_type="text/markdown",
     url="https://github.com/wpilibsuite/sphinxext-opengraph";,
     license="LICENSE.md",
-    install_requires=["sphinx>=2.0"],
+    install_requires=["sphinx>=4.0"],
     packages=["sphinxext/opengraph"],
     classifiers=[
         "Development Status :: 5 - Production/Stable",
@@ -40,10 +25,11 @@
         "License :: OSI Approved :: BSD License",
         "Natural Language :: English",
         "Operating System :: OS Independent",
-        "Programming Language :: Python :: 3.6",
         "Programming Language :: Python :: 3.7",
         "Programming Language :: Python :: 3.8",
         "Programming Language :: Python :: 3.9",
+        "Programming Language :: Python :: 3.10",
+        "Programming Language :: Python :: 3.11",
         "Programming Language :: Python",
         "Topic :: Documentation :: Sphinx",
         "Topic :: Documentation",
@@ -51,5 +37,5 @@
         "Topic :: Text Processing",
         "Topic :: Utilities",
     ],
-    python_requires=">=3.6",
+    python_requires=">=3.7",
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sphinxext-opengraph-0.6.3/sphinxext/opengraph/__init__.py 
new/sphinxext-opengraph-0.7.5/sphinxext/opengraph/__init__.py
--- old/sphinxext-opengraph-0.6.3/sphinxext/opengraph/__init__.py       
2022-03-29 19:45:08.000000000 +0200
+++ new/sphinxext-opengraph-0.7.5/sphinxext/opengraph/__init__.py       
2023-01-03 21:37:53.000000000 +0100
@@ -6,6 +6,7 @@
 from sphinx.application import Sphinx
 
 from .descriptionparser import get_description
+from .metaparser import get_meta_description
 from .titleparser import get_title
 
 import os
@@ -28,10 +29,10 @@
 }
 
 
-def make_tag(property: str, content: str) -> str:
+def make_tag(property: str, content: str, type_: str = "property") -> str:
     # Parse quotation, so they won't break html tags if smart quotes are 
disabled
     content = content.replace('"', "&quot;")
-    return f'<meta property="{property}" content="{content}" />\n  '
+    return f'<meta {type_}="{property}" content="{content}" />'
 
 
 def get_tags(
@@ -45,6 +46,7 @@
     if fields is None:
         fields = {}
     tags = {}
+    meta_tags = {}  # For non-og meta tags
 
     # Set length of description
     try:
@@ -67,12 +69,12 @@
     # type tag
     tags["og:type"] = config["ogp_type"]
 
-    if os.getenv("READTHEDOCS") and config["ogp_site_url"] is None:
+    if os.getenv("READTHEDOCS") and not config["ogp_site_url"]:
         # readthedocs uses html_baseurl for sphinx > 1.8
         parse_result = urlparse(config["html_baseurl"])
 
         if config["html_baseurl"] is None:
-            raise EnvironmentError("ReadTheDocs did not provide a valid 
canonical URL!")
+            raise OSError("ReadTheDocs did not provide a valid canonical URL!")
 
         # Grab root url from canonical url
         config["ogp_site_url"] = urlunparse(
@@ -88,16 +90,19 @@
 
     # url tag
     # Get the URL of the specific page
-    if context["builder"] == "dirhtml":
-        page_url = urljoin(config["ogp_site_url"], context["pagename"] + "/")
-    else:
-        page_url = urljoin(
-            config["ogp_site_url"], context["pagename"] + 
context["file_suffix"]
-        )
+    page_url = urljoin(
+        config["ogp_site_url"], app.builder.get_target_uri(context["pagename"])
+    )
     tags["og:url"] = page_url
 
-    # site name tag
-    site_name = config["ogp_site_name"]
+    # site name tag, False disables, default to project if ogp_site_name not
+    # set.
+    if config["ogp_site_name"] is False:
+        site_name = None
+    elif config["ogp_site_name"] is None:
+        site_name = config["project"]
+    else:
+        site_name = config["ogp_site_name"]
     if site_name:
         tags["og:site_name"] = site_name
 
@@ -105,6 +110,11 @@
     if description:
         tags["og:description"] = description
 
+        if config["ogp_enable_meta_description"] and not get_meta_description(
+            context["metatags"]
+        ):
+            meta_tags["description"] = description
+
     # image tag
     # Get basic values from config
     if "og:image" in fields:
@@ -158,8 +168,13 @@
     # arbitrary tags and overrides
     tags.update({k: v for k, v in fields.items() if k.startswith("og:")})
 
-    return "\n" + "\n".join(
-        [make_tag(p, c) for p, c in tags.items()] + 
config["ogp_custom_meta_tags"]
+    return (
+        "\n".join(
+            [make_tag(p, c) for p, c in tags.items()]
+            + [make_tag(p, c, "name") for p, c in meta_tags.items()]
+            + config["ogp_custom_meta_tags"]
+        )
+        + "\n"
     )
 
 
@@ -175,7 +190,9 @@
 
 
 def setup(app: Sphinx) -> Dict[str, Any]:
-    app.add_config_value("ogp_site_url", None, "html")
+    # ogp_site_url="" allows relative by default, even though it's not
+    # officially supported by OGP.
+    app.add_config_value("ogp_site_url", "", "html")
     app.add_config_value("ogp_description_length", DEFAULT_DESCRIPTION_LENGTH, 
"html")
     app.add_config_value("ogp_image", None, "html")
     app.add_config_value("ogp_image_alt", None, "html")
@@ -183,6 +200,7 @@
     app.add_config_value("ogp_type", "website", "html")
     app.add_config_value("ogp_site_name", None, "html")
     app.add_config_value("ogp_custom_meta_tags", [], "html")
+    app.add_config_value("ogp_enable_meta_description", True, "html")
 
     app.connect("html-page-context", html_page_context)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sphinxext-opengraph-0.6.3/sphinxext/opengraph/descriptionparser.py 
new/sphinxext-opengraph-0.7.5/sphinxext/opengraph/descriptionparser.py
--- old/sphinxext-opengraph-0.6.3/sphinxext/opengraph/descriptionparser.py      
2022-03-29 19:45:08.000000000 +0200
+++ new/sphinxext-opengraph-0.7.5/sphinxext/opengraph/descriptionparser.py      
2023-01-03 21:37:53.000000000 +0100
@@ -101,7 +101,7 @@
 
         # Separate end of list from text
         if isinstance(node, nodes.Sequential):
-            if self.description[-1] == ",":
+            if self.description and self.description[-1] == ",":
                 self.description = self.description[:-1]
             self.description += "."
             self.list_level -= 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sphinxext-opengraph-0.6.3/sphinxext/opengraph/metaparser.py 
new/sphinxext-opengraph-0.7.5/sphinxext/opengraph/metaparser.py
--- old/sphinxext-opengraph-0.6.3/sphinxext/opengraph/metaparser.py     
1970-01-01 01:00:00.000000000 +0100
+++ new/sphinxext-opengraph-0.7.5/sphinxext/opengraph/metaparser.py     
2023-01-03 21:37:53.000000000 +0100
@@ -0,0 +1,29 @@
+from html.parser import HTMLParser
+
+
+class HTMLTextParser(HTMLParser):
+    """
+    Parse HTML into text
+    """
+
+    def __init__(self):
+        super().__init__()
+        self.meta_description = None
+
+    def handle_starttag(self, tag, attrs) -> None:
+        # For example:
+        # attrs = [("content", "My manual description"), ("name", 
"description")]
+        if ("name", "description") in attrs:
+            self.meta_description = True
+            for name, value in attrs:
+                if name == "content":
+                    self.meta_description = value
+                    break
+
+
+def get_meta_description(meta_tags: str) -> bool:
+    htp = HTMLTextParser()
+    htp.feed(meta_tags)
+    htp.close()
+
+    return htp.meta_description
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sphinxext-opengraph-0.6.3/tests/roots/test-meta-name-description/conf.py 
new/sphinxext-opengraph-0.7.5/tests/roots/test-meta-name-description/conf.py
--- 
old/sphinxext-opengraph-0.6.3/tests/roots/test-meta-name-description/conf.py    
    1970-01-01 01:00:00.000000000 +0100
+++ 
new/sphinxext-opengraph-0.7.5/tests/roots/test-meta-name-description/conf.py    
    2023-01-03 21:37:53.000000000 +0100
@@ -0,0 +1,10 @@
+extensions = ["sphinxext.opengraph"]
+
+master_doc = "index"
+exclude_patterns = ["_build"]
+
+html_theme = "basic"
+
+ogp_site_url = "http://example.org/en/latest/";
+
+enable_meta_description = True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sphinxext-opengraph-0.6.3/tests/roots/test-meta-name-description/index.rst 
new/sphinxext-opengraph-0.7.5/tests/roots/test-meta-name-description/index.rst
--- 
old/sphinxext-opengraph-0.6.3/tests/roots/test-meta-name-description/index.rst  
    1970-01-01 01:00:00.000000000 +0100
+++ 
new/sphinxext-opengraph-0.7.5/tests/roots/test-meta-name-description/index.rst  
    2023-01-03 21:37:53.000000000 +0100
@@ -0,0 +1 @@
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse at lorem 
ornare, fringilla massa nec, venenatis mi. Donec erat sapien, tincidunt nec 
rhoncus nec, scelerisque id diam. Orci varius natoque penatibus et magnis dis 
parturient mauris.
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sphinxext-opengraph-0.6.3/tests/roots/test-meta-name-description-manual-description/conf.py
 
new/sphinxext-opengraph-0.7.5/tests/roots/test-meta-name-description-manual-description/conf.py
--- 
old/sphinxext-opengraph-0.6.3/tests/roots/test-meta-name-description-manual-description/conf.py
     1970-01-01 01:00:00.000000000 +0100
+++ 
new/sphinxext-opengraph-0.7.5/tests/roots/test-meta-name-description-manual-description/conf.py
     2023-01-03 21:37:53.000000000 +0100
@@ -0,0 +1,10 @@
+extensions = ["sphinxext.opengraph"]
+
+master_doc = "index"
+exclude_patterns = ["_build"]
+
+html_theme = "basic"
+
+ogp_site_url = "http://example.org/en/latest/";
+
+ogp_enable_meta_description = True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sphinxext-opengraph-0.6.3/tests/roots/test-meta-name-description-manual-description/index.rst
 
new/sphinxext-opengraph-0.7.5/tests/roots/test-meta-name-description-manual-description/index.rst
--- 
old/sphinxext-opengraph-0.6.3/tests/roots/test-meta-name-description-manual-description/index.rst
   1970-01-01 01:00:00.000000000 +0100
+++ 
new/sphinxext-opengraph-0.7.5/tests/roots/test-meta-name-description-manual-description/index.rst
   2023-01-03 21:37:53.000000000 +0100
@@ -0,0 +1,4 @@
+.. meta::
+   :description: My manual description
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse at lorem 
ornare, fringilla massa nec, venenatis mi. Donec erat sapien, tincidunt nec 
rhoncus nec, scelerisque id diam. Orci varius natoque penatibus et magnis dis 
parturient mauris.
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sphinxext-opengraph-0.6.3/tests/roots/test-meta-name-description-manual-og-description/conf.py
 
new/sphinxext-opengraph-0.7.5/tests/roots/test-meta-name-description-manual-og-description/conf.py
--- 
old/sphinxext-opengraph-0.6.3/tests/roots/test-meta-name-description-manual-og-description/conf.py
  1970-01-01 01:00:00.000000000 +0100
+++ 
new/sphinxext-opengraph-0.7.5/tests/roots/test-meta-name-description-manual-og-description/conf.py
  2023-01-03 21:37:53.000000000 +0100
@@ -0,0 +1,10 @@
+extensions = ["sphinxext.opengraph"]
+
+master_doc = "index"
+exclude_patterns = ["_build"]
+
+html_theme = "basic"
+
+ogp_site_url = "http://example.org/en/latest/";
+
+ogp_enable_meta_description = True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sphinxext-opengraph-0.6.3/tests/roots/test-meta-name-description-manual-og-description/index.rst
 
new/sphinxext-opengraph-0.7.5/tests/roots/test-meta-name-description-manual-og-description/index.rst
--- 
old/sphinxext-opengraph-0.6.3/tests/roots/test-meta-name-description-manual-og-description/index.rst
        1970-01-01 01:00:00.000000000 +0100
+++ 
new/sphinxext-opengraph-0.7.5/tests/roots/test-meta-name-description-manual-og-description/index.rst
        2023-01-03 21:37:53.000000000 +0100
@@ -0,0 +1,3 @@
+:og:description: My manual og:description
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse at lorem 
ornare, fringilla massa nec, venenatis mi. Donec erat sapien, tincidunt nec 
rhoncus nec, scelerisque id diam. Orci varius natoque penatibus et magnis dis 
parturient mauris.
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sphinxext-opengraph-0.6.3/tests/roots/test-sitename-from-project/conf.py 
new/sphinxext-opengraph-0.7.5/tests/roots/test-sitename-from-project/conf.py
--- 
old/sphinxext-opengraph-0.6.3/tests/roots/test-sitename-from-project/conf.py    
    1970-01-01 01:00:00.000000000 +0100
+++ 
new/sphinxext-opengraph-0.7.5/tests/roots/test-sitename-from-project/conf.py    
    2023-01-03 21:37:53.000000000 +0100
@@ -0,0 +1,9 @@
+extensions = ["sphinxext.opengraph"]
+
+project = "Project name"
+master_doc = "index"
+exclude_patterns = ["_build"]
+
+html_theme = "basic"
+
+ogp_site_url = "http://example.org/en/latest/";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sphinxext-opengraph-0.6.3/tests/roots/test-sitename-from-project/index.rst 
new/sphinxext-opengraph-0.7.5/tests/roots/test-sitename-from-project/index.rst
--- 
old/sphinxext-opengraph-0.6.3/tests/roots/test-sitename-from-project/index.rst  
    1970-01-01 01:00:00.000000000 +0100
+++ 
new/sphinxext-opengraph-0.7.5/tests/roots/test-sitename-from-project/index.rst  
    2023-01-03 21:37:53.000000000 +0100
@@ -0,0 +1 @@
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse at lorem 
ornare, fringilla massa nec, venenatis mi. Donec erat sapien, tincidunt nec 
rhoncus nec, scelerisque id diam. Orci varius natoque penatibus et magnis dis 
parturient mauris.
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sphinxext-opengraph-0.6.3/tests/test_options.py 
new/sphinxext-opengraph-0.7.5/tests/test_options.py
--- old/sphinxext-opengraph-0.6.3/tests/test_options.py 2022-03-29 
19:45:08.000000000 +0200
+++ new/sphinxext-opengraph-0.7.5/tests/test_options.py 2023-01-03 
21:37:53.000000000 +0100
@@ -1,11 +1,10 @@
 import pytest
 from sphinx.application import Sphinx
 import conftest
-import os
 
 
 def get_tag(tags, tag_type):
-    return [tag for tag in tags if tag.get("property") == 
"og:{}".format(tag_type)][0]
+    return [tag for tag in tags if tag.get("property") == f"og:{tag_type}"][0]
 
 
 def get_tag_content(tags, tag_type):
@@ -13,6 +12,12 @@
     return get_tag(tags, tag_type).get("content", "")
 
 
+def get_meta_description(tags):
+    return [tag for tag in tags if tag.get("name") == "description"][0].get(
+        "content", ""
+    )
+
+
 @pytest.mark.sphinx("html", testroot="simple")
 def test_simple(og_meta_tags):
     description = get_tag_content(og_meta_tags, "description")
@@ -26,6 +31,32 @@
     )
 
 
[email protected]("html", testroot="meta-name-description")
+def test_meta_name_description(meta_tags):
+    og_description = get_tag_content(meta_tags, "description")
+    description = get_meta_description(meta_tags)
+
+    assert description == og_description
+
+
[email protected]("html", 
testroot="meta-name-description-manual-description")
+def test_meta_name_description(meta_tags):
+    og_description = get_tag_content(meta_tags, "description")
+    description = get_meta_description(meta_tags)
+
+    assert description != og_description
+    assert description == "My manual description"
+
+
[email protected]("html", 
testroot="meta-name-description-manual-og-description")
+def test_meta_name_description(meta_tags):
+    og_description = get_tag_content(meta_tags, "description")
+    description = get_meta_description(meta_tags)
+
+    assert og_description != description
+    assert og_description == "My manual og:description"
+
+
 @pytest.mark.sphinx("html", testroot="simple")
 def test_site_url(og_meta_tags):
     # Uses the same directory as simple, because it already contains url for a 
minimal config
@@ -37,7 +68,7 @@
 
 @pytest.mark.sphinx("dirhtml", testroot="simple")
 def test_dirhtml_url(og_meta_tags):
-    assert get_tag_content(og_meta_tags, "url") == 
"http://example.org/en/latest/index/";
+    assert get_tag_content(og_meta_tags, "url") == 
"http://example.org/en/latest/";
 
 
 @pytest.mark.sphinx("html", testroot="image")
@@ -76,6 +107,11 @@
     assert get_tag_content(og_meta_tags, "site_name") == "Example's Docs!"
 
 
[email protected]("html", testroot="sitename-from-project")
+def test_site_name_project(og_meta_tags):
+    assert get_tag_content(og_meta_tags, "site_name") == "Project name"
+
+
 @pytest.mark.sphinx("html", testroot="first-image")
 def test_first_image(og_meta_tags):
     assert (
@@ -248,3 +284,15 @@
 
     with pytest.raises(Exception):
         app.build()
+
+
+# Test no breakage with no configuration
[email protected]("html", testroot="rtd-default")
+def test_no_configuration_html(og_meta_tags):
+    assert get_tag_content(og_meta_tags, "type") == "website"
+
+
+# Test no breakage with no configuration
[email protected]("dirhtml", testroot="rtd-default")
+def test_no_configuration_dirhtml(og_meta_tags):
+    assert get_tag_content(og_meta_tags, "type") == "website"

Reply via email to