Drop usage of pkg_resources

The pkg_resources module was deprecated. It was removed from the core
Python and has been moved to setuptools in Python 3.12.

Replace usage of pkg_resources.declare_namespace by pbr and implicit
namespace package[1][2] which has been supported since Python 3.3.

[1] https://peps.python.org/pep-0420/
[2] https://packaging.python.org/en/latest/guides/packaging-namespace-packages/

Change-Id: I4570288ba317fbc470e2f3e3ef1168def3ed3ae6
This commit is contained in:
Takashi Kajinami 2024-11-19 01:59:53 +09:00
parent f22cde6973
commit 8b49e30700
2 changed files with 10 additions and 12 deletions

View File

@ -40,20 +40,20 @@ source_suffix = '.rst'
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
project = u'wsmeext.sphinxext Test' project = 'wsmeext.sphinxext Test'
copyright = u'2011, Christophe de Vienne' copyright = '2011, Christophe de Vienne'
# The version info for the project you're documenting, acts as replacement for # The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the # |version| and |release|, also used in various other places throughout the
# built documents. # built documents.
# #
import pkg_resources import pbr.version
dist = pkg_resources.require('WSME')[0] version_info = pbr.version.VersionInfo('WSME')
# The short X.Y version. # The short X.Y version.
version = '.'.join(dist.version[:2]) version = version_info.version_string()
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = dist.version release = version_info.version_string()
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.
@ -187,8 +187,8 @@ htmlhelp_basename = 'WebServicesMadeEasydoc'
# Grouping the document tree into LaTeX files. List of tuples # Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]). # (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [ latex_documents = [
('index', 'WebServicesMadeEasy.tex', u'Web Services Made Easy Documentation', ('index', 'WebServicesMadeEasy.tex', 'Web Services Made Easy Documentation',
u'Christophe de Vienne', 'manual'), 'Christophe de Vienne', 'manual'),
] ]
# The name of an image file (relative to this directory) to place at the top of # The name of an image file (relative to this directory) to place at the top of
@ -220,8 +220,8 @@ latex_documents = [
# One entry per manual page. List of tuples # One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section). # (source start file, name, description, authors, manual section).
man_pages = [ man_pages = [
('index', 'webservicesmadeeasy', u'Web Services Made Easy Documentation', ('index', 'webservicesmadeeasy', 'Web Services Made Easy Documentation',
[u'Christophe de Vienne'], 1) ['Christophe de Vienne'], 1)
] ]

View File

@ -1,2 +0,0 @@
import pkg_resources
pkg_resources.declare_namespace(__name__)