public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/pkgcore/pkgcore:master commit in: doc/, /
@ 2022-11-15 11:22 Arthur Zamarin
  0 siblings, 0 replies; only message in thread
From: Arthur Zamarin @ 2022-11-15 11:22 UTC (permalink / raw
  To: gentoo-commits

commit:     efcc7f32cc73b84b9012c4de88110a9d07bbfb40
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 15 11:21:30 2022 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Tue Nov 15 11:21:30 2022 +0000
URL:        https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=efcc7f32

docs: use snakeoil.dist sphinx extension

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 Makefile       |  4 ++--
 doc/conf.py    | 65 ++++++++++++----------------------------------------------
 pyproject.toml |  4 ++--
 3 files changed, 17 insertions(+), 56 deletions(-)

diff --git a/Makefile b/Makefile
index be7a5b69e..8deca5645 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 PYTHON ?= python
-SPHINX_BUILD ?= sphinx-build
+SPHINX_BUILD ?= $(PYTHON) -m sphinx.cmd.build
 
 .PHONY: man html
 man html:
@@ -11,5 +11,5 @@ sdist wheel:
 
 .PHONY: clean
 clean:
-	$(RM) -r build/sphinx doc/api dist
+	$(RM) -r build/sphinx doc/api doc/generated dist
 	$(MAKE) -C data/lib/pkgcore/ebd clean

diff --git a/doc/conf.py b/doc/conf.py
index 6165ae916..f18382148 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -11,22 +11,6 @@
 # All configuration values have a default; values that are commented out
 # serve to show the default.
 
-import os
-import sys
-from importlib import import_module
-
-# If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute, like shown here.
-sys.path.insert(0, os.path.abspath('../src/'))
-
-os.environ['PKGDIST_REPODIR'] = os.path.abspath('..')
-from snakeoil.dist import distutils_extensions as pkgdist
-from snakeoil.dist.generate_docs import generate_man, generate_html
-
-on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
-
-
 # -- General configuration -----------------------------------------------------
 
 # If your documentation needs a minimal Sphinx version, state it here.
@@ -35,10 +19,16 @@ on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
 # Add any Sphinx extension module names here, as strings. They can be extensions
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
 extensions = [
-    'sphinx.ext.extlinks', 'sphinx.ext.autosummary',
-    'sphinx.ext.autodoc', 'sphinx.ext.doctest',
-    'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage',
-    'sphinx.ext.ifconfig', 'sphinx.ext.viewcode',
+    'sphinx.ext.extlinks',
+    'sphinx.ext.autosummary',
+    'sphinx.ext.autodoc',
+    'sphinx.ext.doctest',
+    'sphinx.ext.intersphinx',
+    'sphinx.ext.todo',
+    'sphinx.ext.coverage',
+    'sphinx.ext.ifconfig',
+    'sphinx.ext.viewcode',
+    'snakeoil.dist.sphinxext',
 ]
 
 # Add any paths that contain templates here, relative to this directory.
@@ -58,14 +48,8 @@ project = 'pkgcore'
 authors = ''
 copyright = '2006-2022, pkgcore contributors'
 
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The short X.Y version.
-version = pkgdist.module_version()
-# The full version, including alpha/beta/rc tags.
-release = 'trunk'
+# version is set by snakeoil extension
+release = 'master'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
@@ -102,9 +86,6 @@ pygments_style = 'sphinx'
 #modindex_common_prefix = []
 
 # auto-generate required files for RTD build environment
-if on_rtd:
-    pkgdist.generate_man()
-    pkgdist.generate_html()
 
 # -- Options for HTML output ---------------------------------------------------
 
@@ -226,33 +207,13 @@ latex_documents = [
 
 
 # -- Options for manual page output --------------------------------------------
-generate_man(os.path.abspath('..'), '', 'pkgcore')
-generate_html(os.path.abspath('..'), os.path.abspath('../src'), 'pkgcore')
-
-if sys.version_info >= (3, 11):
-    import tomllib
-else:
-    import tomli as tomllib
-
-with open('../pyproject.toml', 'rb') as file:
-    pyproj = tomllib.load(file)
-
-generated_man_pages = [
-    (entry.split(':')[0], name) for name, entry in pyproj['project']['scripts'].items()
-]
-authors_list = [
-    f'{author["name"]} <{author["email"]}>' for author in pyproj['project']['authors']
-]
 
 # One entry per manual page. List of tuples
 # (source start file, name, description, authors, manual section).
 man_pages = [
-    (f'man/{script}', script, import_module(module).__doc__.strip().split('\n', 1)[0], authors_list, 1)
-    for module, script in generated_man_pages
+    ('man/pkgcore', 'pkgcore', 'a framework for package management', None, 5)
 ]
 
-man_pages.append(('man/pkgcore', 'pkgcore', 'a framework for package management', authors_list, 5))
-
 # -- Options for Epub output ---------------------------------------------------
 
 # Bibliographic Dublin Core info.

diff --git a/pyproject.toml b/pyproject.toml
index 020991b5f..16c48bd22 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,7 +1,7 @@
 [build-system]
 requires = [
 	"flit_core >=3.8,<4",
-	"snakeoil",
+	"snakeoil~=0.10.3",
 ]
 build-backend = "py_build"
 backend-path = ["."]
@@ -28,7 +28,7 @@ classifiers = [
 dynamic = ["version"]
 
 dependencies = [
-	"snakeoil~=0.10.0",
+	"snakeoil~=0.10.3",
 	"lxml",
 ]
 


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-15 11:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-15 11:22 [gentoo-commits] proj/pkgcore/pkgcore:master commit in: doc/, / Arthur Zamarin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox