From 1104018911833e33b0d78b1bb90e8b5d22ffd4b3 Mon Sep 17 00:00:00 2001 From: Rick Elrod Date: Nov 11 2019 16:34:09 +0000 Subject: Make the package installable for python 3.8+ Signed-off-by: Rick Elrod --- diff --git a/importlib_metadata_py38.patch b/importlib_metadata_py38.patch new file mode 100644 index 0000000..3e4ddb4 --- /dev/null +++ b/importlib_metadata_py38.patch @@ -0,0 +1,30 @@ +diff --git a/setup.cfg b/setup.cfg +index 10fdda8..20ba0d7 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -38,7 +38,7 @@ package_dir = + include_package_data = true + python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.* + install_requires = +- importlib-metadata ++ importlib-metadata;python_version<"3.8" + packaging + Sphinx + +diff --git a/src/pallets_sphinx_themes/__init__.py b/src/pallets_sphinx_themes/__init__.py +index d16359e..9a3bbd5 100644 +--- a/src/pallets_sphinx_themes/__init__.py ++++ b/src/pallets_sphinx_themes/__init__.py +@@ -5,7 +5,11 @@ import sys + import textwrap + from collections import namedtuple + +-import importlib_metadata ++if sys.version_info >= (3, 8): ++ from importlib import metadata as importlib_metadata ++else: ++ import importlib_metadata ++ + from sphinx.builders._epub_base import EpubBuilder + from sphinx.errors import ExtensionError + diff --git a/python-Pallets-Sphinx-Themes.spec b/python-Pallets-Sphinx-Themes.spec index 19b599b..c8f99c1 100644 --- a/python-Pallets-Sphinx-Themes.spec +++ b/python-Pallets-Sphinx-Themes.spec @@ -2,12 +2,13 @@ Name: python-%{pypi_name} Version: 1.2.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Sphinx themes for Pallets and related projects License: BSD URL: https://github.com/pallets/pallets-sphinx-themes/ Source0: https://files.pythonhosted.org/packages/source/P/%{pypi_name}/%{pypi_name}-%{version}.tar.gz +Patch0: importlib_metadata_py38.patch BuildArch: noarch BuildRequires: python3-devel @@ -30,7 +31,7 @@ Pallets Sphinx Themes Themes for the Pallets projects. %prep -%autosetup -n %{pypi_name}-%{version} +%autosetup -n %{pypi_name}-%{version} -p1 # Remove bundled egg-info rm -rf %{pypi_name}.egg-info @@ -47,6 +48,9 @@ rm -rf %{pypi_name}.egg-info %{python3_sitelib}/Pallets_Sphinx_Themes-*.egg-info/ %changelog +* Mon Nov 11 2019 Rick Elrod - 1.2.2-3 +- Fix dependency issue for python >=3.8 + * Mon Nov 4 2019 Rick Elrod - 1.2.2-2 - Fix files section for python >=3.10