%global _empty_manifest_terminate_build 0 Name: python-sphinx-last-updated-by-git Version: 0.3.4 Release: 1 Summary: Get the "last updated" time for each Sphinx page from Git License: BSD-2-Clause URL: https://github.com/mgeier/sphinx-last-updated-by-git/ Source0: https://mirrors.nju.edu.cn/pypi/web/packages/7c/19/73a2d88e9aa8d89c9961905cdd0dfcd48f8efaee47228a2446d5436960a2/sphinx-last-updated-by-git-0.3.4.tar.gz BuildArch: noarch Requires: python3-sphinx %description This is a little Sphinx_ extension that does exactly that. It also checks for included files and other dependencies and uses their "last updated" time if it's more recent. For each file, the "author date" of the Git commit where it was last changed is taken to be its "last updated" time. Uncommitted changes are ignored. If a page doesn't have a source file, its last_updated_ time is set to ``None``. The default value for html_last_updated_fmt_ is changed from ``None`` to the empty string. Usage #. Install the Python package ``sphinx-last-updated-by-git`` #. Add ``'sphinx_last_updated_by_git'`` to ``extensions`` in your ``conf.py`` #. Run Sphinx! Options * If a source file is not tracked by Git (e.g. because it has been auto-generated on demand by autosummary_generate_) but its dependencies are, the last_updated_ time is taken from them. If you don't want this to happen, use ``git_untracked_check_dependencies = False``. * If a source file is not tracked by Git, its HTML page doesn't get a source link. If you do want those pages to have a sourcelink, set ``git_untracked_show_sourcelink = True``. Of course, in this case html_copy_source_ and html_show_sourcelink_ must also be ``True``, and the theme you are using must support source links in the first place. * By default, timestamps are displayed using the local time zone. You can specify a datetime.timezone_ object (or any ``tzinfo`` subclass instance) with the configuration option ``git_last_updated_timezone``. You can also use any string recognized by babel_, e.g. ``git_last_updated_timezone = 'NZ'``. * By default, the "last updated" timestamp is added as an HTML ```` tag. This can be disabled by setting the configuration option ``git_last_updated_metatags`` to ``False``. * Files can be excluded from the last updated date calculation by passing a list of exclusion patterns to the configuration option ``git_exclude_patterns``. These patterns are checked on both source files and dependencies and are treated the same way as Sphinx's exclude_patterns_. * Individual commits can be excluded from the last updated date calculation by passing a list of commit hashes to the configuration option ``git_exclude_commits``. Caveats * When using a "Git shallow clone" (with the ``--depth`` option), the "last updated" commit for a long-unchanged file might not have been checked out. In this case, the last_updated_ time is set to ``None`` (and a warning is shown during the build). This might happen on https://readthedocs.org/ because they use shallow clones by default. The ``DONT_SHALLOW_CLONE`` `feature flag`_ should fix this. If you want to get rid of the warning, use this in your ``conf.py``:: suppress_warnings = ['git.too_shallow'] * When a project on https://readthedocs.org/ using their default theme ``sphinx_rtd_theme`` was created before October 20th 2020, the date will not be displayed in the footer. One work-around is to enable the (undocumented) `feature flag`_ ``USE_SPHINX_LATEST``. Another work-around is to override the defaults by means of a ``requirements.txt`` file containing something like this:: sphinx>=2 sphinx_rtd_theme>=0.5 See also `issue #1`_. * Starting with Sphinx version 5.0, there has been a (most likely unintentional) change in how dependencies are determined. This may lead to spurious dependencies which means that some "last changed" dates might be wrong. This will hopefully be fixed in a future Sphinx version. In the meantime, Sphinx version 4.5.0 (with docutils 0.17.1) can be used. See also `issue #40`_. License BSD-2-Clause (same as Sphinx itself), for more information take a look at the ``LICENSE`` file. Similar stuff | https://github.com/jdillard/sphinx-gitstamp | https://github.com/OddBloke/sphinx-git | https://github.com/MestreLion/git-tools (``git-restore-mtime``) | https://github.com/TYPO3-Documentation/sphinxcontrib-gitloginfo templating.html#last_updated configuration.html#confval-exclude_patterns usage/extensions/autosummary.html#confval-autosummary_generate usage/configuration.html#confval-html_copy_source usage/configuration.html#confval-html_show_sourcelink usage/configuration.html#confval-html_last_updated_fmt datetime.html#timezone-objects guides/feature-flags.html %package -n python3-sphinx-last-updated-by-git Summary: Get the "last updated" time for each Sphinx page from Git Provides: python-sphinx-last-updated-by-git BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-sphinx-last-updated-by-git This is a little Sphinx_ extension that does exactly that. It also checks for included files and other dependencies and uses their "last updated" time if it's more recent. For each file, the "author date" of the Git commit where it was last changed is taken to be its "last updated" time. Uncommitted changes are ignored. If a page doesn't have a source file, its last_updated_ time is set to ``None``. The default value for html_last_updated_fmt_ is changed from ``None`` to the empty string. Usage #. Install the Python package ``sphinx-last-updated-by-git`` #. Add ``'sphinx_last_updated_by_git'`` to ``extensions`` in your ``conf.py`` #. Run Sphinx! Options * If a source file is not tracked by Git (e.g. because it has been auto-generated on demand by autosummary_generate_) but its dependencies are, the last_updated_ time is taken from them. If you don't want this to happen, use ``git_untracked_check_dependencies = False``. * If a source file is not tracked by Git, its HTML page doesn't get a source link. If you do want those pages to have a sourcelink, set ``git_untracked_show_sourcelink = True``. Of course, in this case html_copy_source_ and html_show_sourcelink_ must also be ``True``, and the theme you are using must support source links in the first place. * By default, timestamps are displayed using the local time zone. You can specify a datetime.timezone_ object (or any ``tzinfo`` subclass instance) with the configuration option ``git_last_updated_timezone``. You can also use any string recognized by babel_, e.g. ``git_last_updated_timezone = 'NZ'``. * By default, the "last updated" timestamp is added as an HTML ```` tag. This can be disabled by setting the configuration option ``git_last_updated_metatags`` to ``False``. * Files can be excluded from the last updated date calculation by passing a list of exclusion patterns to the configuration option ``git_exclude_patterns``. These patterns are checked on both source files and dependencies and are treated the same way as Sphinx's exclude_patterns_. * Individual commits can be excluded from the last updated date calculation by passing a list of commit hashes to the configuration option ``git_exclude_commits``. Caveats * When using a "Git shallow clone" (with the ``--depth`` option), the "last updated" commit for a long-unchanged file might not have been checked out. In this case, the last_updated_ time is set to ``None`` (and a warning is shown during the build). This might happen on https://readthedocs.org/ because they use shallow clones by default. The ``DONT_SHALLOW_CLONE`` `feature flag`_ should fix this. If you want to get rid of the warning, use this in your ``conf.py``:: suppress_warnings = ['git.too_shallow'] * When a project on https://readthedocs.org/ using their default theme ``sphinx_rtd_theme`` was created before October 20th 2020, the date will not be displayed in the footer. One work-around is to enable the (undocumented) `feature flag`_ ``USE_SPHINX_LATEST``. Another work-around is to override the defaults by means of a ``requirements.txt`` file containing something like this:: sphinx>=2 sphinx_rtd_theme>=0.5 See also `issue #1`_. * Starting with Sphinx version 5.0, there has been a (most likely unintentional) change in how dependencies are determined. This may lead to spurious dependencies which means that some "last changed" dates might be wrong. This will hopefully be fixed in a future Sphinx version. In the meantime, Sphinx version 4.5.0 (with docutils 0.17.1) can be used. See also `issue #40`_. License BSD-2-Clause (same as Sphinx itself), for more information take a look at the ``LICENSE`` file. Similar stuff | https://github.com/jdillard/sphinx-gitstamp | https://github.com/OddBloke/sphinx-git | https://github.com/MestreLion/git-tools (``git-restore-mtime``) | https://github.com/TYPO3-Documentation/sphinxcontrib-gitloginfo templating.html#last_updated configuration.html#confval-exclude_patterns usage/extensions/autosummary.html#confval-autosummary_generate usage/configuration.html#confval-html_copy_source usage/configuration.html#confval-html_show_sourcelink usage/configuration.html#confval-html_last_updated_fmt datetime.html#timezone-objects guides/feature-flags.html %package help Summary: Development documents and examples for sphinx-last-updated-by-git Provides: python3-sphinx-last-updated-by-git-doc %description help This is a little Sphinx_ extension that does exactly that. It also checks for included files and other dependencies and uses their "last updated" time if it's more recent. For each file, the "author date" of the Git commit where it was last changed is taken to be its "last updated" time. Uncommitted changes are ignored. If a page doesn't have a source file, its last_updated_ time is set to ``None``. The default value for html_last_updated_fmt_ is changed from ``None`` to the empty string. Usage #. Install the Python package ``sphinx-last-updated-by-git`` #. Add ``'sphinx_last_updated_by_git'`` to ``extensions`` in your ``conf.py`` #. Run Sphinx! Options * If a source file is not tracked by Git (e.g. because it has been auto-generated on demand by autosummary_generate_) but its dependencies are, the last_updated_ time is taken from them. If you don't want this to happen, use ``git_untracked_check_dependencies = False``. * If a source file is not tracked by Git, its HTML page doesn't get a source link. If you do want those pages to have a sourcelink, set ``git_untracked_show_sourcelink = True``. Of course, in this case html_copy_source_ and html_show_sourcelink_ must also be ``True``, and the theme you are using must support source links in the first place. * By default, timestamps are displayed using the local time zone. You can specify a datetime.timezone_ object (or any ``tzinfo`` subclass instance) with the configuration option ``git_last_updated_timezone``. You can also use any string recognized by babel_, e.g. ``git_last_updated_timezone = 'NZ'``. * By default, the "last updated" timestamp is added as an HTML ```` tag. This can be disabled by setting the configuration option ``git_last_updated_metatags`` to ``False``. * Files can be excluded from the last updated date calculation by passing a list of exclusion patterns to the configuration option ``git_exclude_patterns``. These patterns are checked on both source files and dependencies and are treated the same way as Sphinx's exclude_patterns_. * Individual commits can be excluded from the last updated date calculation by passing a list of commit hashes to the configuration option ``git_exclude_commits``. Caveats * When using a "Git shallow clone" (with the ``--depth`` option), the "last updated" commit for a long-unchanged file might not have been checked out. In this case, the last_updated_ time is set to ``None`` (and a warning is shown during the build). This might happen on https://readthedocs.org/ because they use shallow clones by default. The ``DONT_SHALLOW_CLONE`` `feature flag`_ should fix this. If you want to get rid of the warning, use this in your ``conf.py``:: suppress_warnings = ['git.too_shallow'] * When a project on https://readthedocs.org/ using their default theme ``sphinx_rtd_theme`` was created before October 20th 2020, the date will not be displayed in the footer. One work-around is to enable the (undocumented) `feature flag`_ ``USE_SPHINX_LATEST``. Another work-around is to override the defaults by means of a ``requirements.txt`` file containing something like this:: sphinx>=2 sphinx_rtd_theme>=0.5 See also `issue #1`_. * Starting with Sphinx version 5.0, there has been a (most likely unintentional) change in how dependencies are determined. This may lead to spurious dependencies which means that some "last changed" dates might be wrong. This will hopefully be fixed in a future Sphinx version. In the meantime, Sphinx version 4.5.0 (with docutils 0.17.1) can be used. See also `issue #40`_. License BSD-2-Clause (same as Sphinx itself), for more information take a look at the ``LICENSE`` file. Similar stuff | https://github.com/jdillard/sphinx-gitstamp | https://github.com/OddBloke/sphinx-git | https://github.com/MestreLion/git-tools (``git-restore-mtime``) | https://github.com/TYPO3-Documentation/sphinxcontrib-gitloginfo templating.html#last_updated configuration.html#confval-exclude_patterns usage/extensions/autosummary.html#confval-autosummary_generate usage/configuration.html#confval-html_copy_source usage/configuration.html#confval-html_show_sourcelink usage/configuration.html#confval-html_last_updated_fmt datetime.html#timezone-objects guides/feature-flags.html %prep %autosetup -n sphinx-last-updated-by-git-0.3.4 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-sphinx-last-updated-by-git -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Thu Mar 09 2023 Python_Bot - 0.3.4-1 - Package Spec generated