Bug 1858503 - Review Request: python-sphinx_ansible_theme - A reusable Ansible Sphinx Theme
Summary: Review Request: python-sphinx_ansible_theme - A reusable Ansible Sphinx Theme
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Andy Mender
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-18 13:44 UTC by chedi toueiti
Modified: 2020-07-24 12:21 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-07-24 12:21:28 UTC
Type: ---
Embargoed:
andymenderunix: fedora-review+


Attachments (Terms of Use)

Description chedi toueiti 2020-07-18 13:44:06 UTC
Spec URL: https://chedi.fedorapeople.org/python-sphinx_ansible_theme.spec
SRPM URL: https://chedi.fedorapeople.org/python-sphinx_ansible_theme-0.3.1-1.fc32.src.rpm

Description: 
A reusable Ansible Sphinx Theme. This theme is building on top
of RTD Theme and adds customizations needed for building projects
which are part of Ansible ecosystem

Fedora Account System Username: chedi

Comment 1 Andy Mender 2020-07-18 17:20:27 UTC
> %global srcname sphinx_ansible_theme

Is the package not actually called "sphinx-ansible-theme"?

> URL:            https://github.com/ansible-community/sphinx_ansible_theme

You can use the %{srcname} macro in the URL block if it matches the name of the GitHub repo.

> License:        MIT

`licensecheck` shows that:
sphinx_ansible_theme/ext/pygments_lexer.py: BSD 2-clause "Simplified" License

You can include that file in a comment above the License block like so:
# Main program: MIT
# ext/pygments_lexer.py: BSD
License:       MIT and BSD

> BuildRequires:  python3-devel
> BuildRequires:  python3-setuptools
> BuildRequires:  python-sphinx_rtd_theme

Should be python3-sphinx_rtd_theme, I think.

From the sources I see this package bundles the following font files:
sphinx_ansible_theme/static/fonts/FontAwesome.otf
sphinx_ansible_theme/static/fonts/fontawesome-webfont.eot
sphinx_ansible_theme/static/fonts/fontawesome-webfont.svg
sphinx_ansible_theme/static/fonts/fontawesome-webfont.ttf
sphinx_ansible_theme/static/fonts/fontawesome-webfont.woff
sphinx_ansible_theme/static/fonts/fontawesome-webfont.woff2
Font Awesome seems to have a permissive license (https://github.com/FortAwesome/Font-Awesome/blob/master/LICENSE.txt), but font files should not be bundled together with non-font libraries.

Package Review
==============

Legend:
[x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated
[ ] = Manual review needed


Issues:
=======
- Packages MUST NOT have dependencies (either build-time or runtime) on
  packages named with the unversioned python- prefix unless no properly
  versioned package exists. Dependencies on Python packages instead MUST
  use names beginning with python2- or python3- as appropriate.
  Note: Unversionned Python dependency found.
  See: https://docs.fedoraproject.org/en-US/packaging-
  guidelines/Python/#_dependencies
- Python packages must not contain %{pythonX_site(lib|arch)}/* in %files
  Note: Package contains %{pythonX_site(lib|arch)}/* in %files
  See: https://pagure.io/packaging-committee/issue/782


===== MUST items =====

Generic:
[x]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[!]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses
     found: "Unknown or generated", "Expat License", "BSD 2-clause
     "Simplified" License". 51 files have unknown license. Detailed output
     of licensecheck in /home/amender/1858503-python-
     sphinx_ansible_theme/licensecheck.txt
[x]: License file installed when any subpackage combination is installed.
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[-]: Package contains desktop file if it is a GUI application.
[-]: Development files must be in a -devel package
[x]: Package uses nothing in %doc for runtime.
[x]: Package consistently uses macros (instead of hard-coded directory
     names).
[x]: Package is named according to the Package Naming Guidelines.
[x]: Package does not generate any conflict.
[x]: Package obeys FHS, except libexecdir and /usr/target.
[-]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[!]: Requires correct, justified where necessary.
[x]: Spec file is legible and written in American English.
[-]: Package contains systemd file(s) if in need.
[x]: Package is not known to require an ExcludeArch tag.
[x]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 10240 bytes in 1 files.
[!]: Package complies to the Packaging Guidelines
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[x]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[x]: If (and only if) the source package includes the text of the
     license(s) in its own file, then that file, containing the text of the
     license(s) for the package is included in %license.
[x]: Package requires other packages for directories it uses.
[x]: Package must own all directories that it creates.
[x]: Package does not own files or directories owned by other packages.
[-]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Dist tag is present.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package must not depend on deprecated() packages.
[-]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: Package does not use a name that already exists.
[x]: Package is not relocatable.
[x]: Sources used to build the package match the upstream source, as
     provided in the spec URL.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: File names are valid UTF-8.
[x]: Packages must not store files under /srv, /opt or /usr/local

Python:
[x]: Python eggs must not download any dependencies during the build
     process.
[-]: A package which is used by another package via an egg interface should
     provide egg info.
[!]: Package meets the Packaging Guidelines::Python
[x]: Package contains BR: python2-devel or python3-devel
[-]: Binary eggs must be removed in %prep

===== SHOULD items =====

Generic:
[!]: Avoid bundling fonts in non-fonts packages.
     Note: Package contains font files
[x]: If the source package does not include license text(s) as a separate
     file from upstream, the packager SHOULD query upstream to include it.
[x]: Final provides and requires are sane (see attachments).
[!]: Fully versioned dependency in subpackages if applicable.
     Note: No Requires: %{name}%{?_isa} = %{version}-%{release} in
     python3-sphinx_ansible_theme
[-]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[-]: Sources are verified with gpgverify first in %prep if upstream
     publishes signatures.
     Note: gpgverify is not used.
[-]: Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[-]: Package should compile and build into binary rpms on all supported
     architectures.
[!]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed
     files.
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Sources can be downloaded from URI in Source: tag
[x]: SourceX is a working URL.
[x]: Spec use %global instead of %define unless justified.

===== EXTRA items =====

Generic:
[!]: Spec file according to URL is the same as in SRPM.
     Note: Spec file as given by url is not the same as in SRPM (see
     attached diff).
     See: (this test has no URL)
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).


Rpmlint
-------
Checking: python-sphinx_ansible_theme-doc-0.3.1-1.fc33.noarch.rpm
          python3-sphinx_ansible_theme-0.3.1-1.fc33.noarch.rpm
          python-sphinx_ansible_theme-0.3.1-1.fc33.src.rpm
python-sphinx_ansible_theme-doc.noarch: W: summary-ended-with-dot C A reusable Ansible Sphinx Theme.
python-sphinx_ansible_theme-doc.noarch: W: spelling-error %description -l en_US ansible -> expansible, sensible
python3-sphinx_ansible_theme.noarch: W: summary-ended-with-dot C A reusable Ansible Sphinx Theme.
python3-sphinx_ansible_theme.noarch: W: spelling-error %description -l en_US customizations -> customization, customization's, customization s
python-sphinx_ansible_theme.src: W: summary-ended-with-dot C A reusable Ansible Sphinx Theme.
python-sphinx_ansible_theme.src: W: spelling-error %description -l en_US customizations -> customization, customization's, customization s
3 packages and 0 specfiles checked; 0 errors, 6 warnings.




Rpmlint (installed packages)
----------------------------
warning: Found bdb Packages database while attempting sqlite backend: using bdb backend.
warning: Found bdb Packages database while attempting sqlite backend: using bdb backend.
python-sphinx_ansible_theme-doc.noarch: W: summary-ended-with-dot C A reusable Ansible Sphinx Theme.
python-sphinx_ansible_theme-doc.noarch: W: spelling-error %description -l en_US ansible -> expansible, sensible
python-sphinx_ansible_theme-doc.noarch: W: invalid-url URL: https://github.com/ansible-community/sphinx_ansible_theme <urlopen error [Errno -2] Name or service not known>
warning: Found bdb Packages database while attempting sqlite backend: using bdb backend.
python3-sphinx_ansible_theme.noarch: W: summary-ended-with-dot C A reusable Ansible Sphinx Theme.
python3-sphinx_ansible_theme.noarch: W: spelling-error %description -l en_US customizations -> customization, customization's, customization s
python3-sphinx_ansible_theme.noarch: W: invalid-url URL: https://github.com/ansible-community/sphinx_ansible_theme <urlopen error [Errno -2] Name or service not known>
2 packages and 0 specfiles checked; 0 errors, 6 warnings.



Source checksums
----------------
https://files.pythonhosted.org/packages/source/s/sphinx_ansible_theme/sphinx_ansible_theme-0.3.1.tar.gz :
  CHECKSUM(SHA256) this package     : 173c57c7d78f08b88b3eca2c71afc6806d64739959cab5faef69ac37fcdba22c
  CHECKSUM(SHA256) upstream package : 173c57c7d78f08b88b3eca2c71afc6806d64739959cab5faef69ac37fcdba22c


Requires
--------
python-sphinx_ansible_theme-doc (rpmlib, GLIBC filtered):

python3-sphinx_ansible_theme (rpmlib, GLIBC filtered):
    python(abi)
    python3.9dist(sphinx-notfound-page)
    python3.9dist(sphinx-rtd-theme)



Provides
--------
python-sphinx_ansible_theme-doc:
    python-sphinx_ansible_theme-doc

python3-sphinx_ansible_theme:
    python-sphinx_ansible_theme
    python3-sphinx_ansible_theme
    python3.9-sphinx_ansible_theme
    python3.9dist(sphinx-ansible-theme)
    python3dist(sphinx-ansible-theme)

Comment 2 chedi toueiti 2020-07-18 18:29:04 UTC
@Andy

Thanks for your feedback, I updated the spec file accordingly and linked the fonts to the ones from fontsawesome/fontawesome-web packages
 (this is the way the python-sphinx_rtd_theme did it).

updated files: (same link different content)

Spec URL: https://chedi.fedorapeople.org/python-sphinx_ansible_theme.spec
SRPM URL: https://chedi.fedorapeople.org/python-sphinx_ansible_theme-0.3.1-1.fc32.src.rpm

Comment 3 Andy Mender 2020-07-18 19:50:52 UTC
> Thanks for your feedback, I updated the spec file accordingly and linked the fonts to the ones from fontsawesome/fontawesome-web packages
> (this is the way the python-sphinx_rtd_theme did it).

Looks good :)

`rpmbuild` complaints about absolute symlinks, but since python-sphinx_rtd_theme does that, I think it's okay (can't think of a better way):
warning: absolute symlink: /usr/lib/python3.8/site-packages/sphinx_ansible_theme/static/fonts/FontAwesome.otf -> /usr/share/fonts/fontawesome/FontAwesome.otf
warning: absolute symlink: /usr/lib/python3.8/site-packages/sphinx_ansible_theme/static/fonts/fontawesome-webfont.eot -> /usr/share/fonts/fontawesome/fontawesome-webfont.eot
warning: absolute symlink: /usr/lib/python3.8/site-packages/sphinx_ansible_theme/static/fonts/fontawesome-webfont.svg -> /usr/share/fonts/fontawesome/fontawesome-webfont.svg
warning: absolute symlink: /usr/lib/python3.8/site-packages/sphinx_ansible_theme/static/fonts/fontawesome-webfont.ttf -> /usr/share/fonts/fontawesome/fontawesome-webfont.ttf
warning: absolute symlink: /usr/lib/python3.8/site-packages/sphinx_ansible_theme/static/fonts/fontawesome-webfont.woff -> /usr/share/fonts/fontawesome/fontawesome-webfont.woff
warning: absolute symlink: /usr/lib/python3.8/site-packages/sphinx_ansible_theme/static/fonts/fontawesome-webfont.woff2 -> /usr/share/fonts/fontawesome/fontawesome-webfont.woff2

Could you try building the package in COPR or Koji to see if everything goes well? When running a local mock build I see that the build process is trying to access the Internet:
+ sphinx-build-3 docs html
Running Sphinx v2.2.2
making output directory... done
loading intersphinx inventory from https://docs.python.org/2/objects.inv...
loading intersphinx inventory from ../python2.inv...
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
WARNING: failed to reach any of the inventories with the following issues:
intersphinx inventory 'https://docs.python.org/2/objects.inv' not fetchable due to <class 'requests.exceptions.ConnectionError'>: HTTPSConnectionPool(host='docs.python.org', port=443): Max retries exceeded with url: /2/objects.inv (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f8fd1e8e400>: Failed to establish a new connection: [Errno -2] Name or service not known'))
intersphinx inventory '../python2.inv' not fetchable due to <class 'FileNotFoundError'>: [Errno 2] No such file or directory: '/builddir/build/BUILD/sphinx_ansible_theme-0.3.1/docs/../python2.inv'
loading intersphinx inventory from ../python3.inv...
WARNING: failed to reach any of the inventories with the following issues:
intersphinx inventory 'https://docs.python.org/3/objects.inv' not fetchable due to <class 'requests.exceptions.ConnectionError'>: HTTPSConnectionPool(host='docs.python.org', port=443): Max retries exceeded with url: /3/objects.inv (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f8fd1e8e580>: Failed to establish a new connection: [Errno -2] Name or service not known'))
intersphinx inventory '../python3.inv' not fetchable due to <class 'FileNotFoundError'>: [Errno 2] No such file or directory: '/builddir/build/BUILD/sphinx_ansible_theme-0.3.1/docs/../python3.inv'
loading intersphinx inventory from http://jinja.palletsprojects.com/objects.inv...
loading intersphinx inventory from ../jinja2.inv...
loading intersphinx inventory from https://docs.ansible.com/ansible/2.9/objects.inv...
WARNING: failed to reach any of the inventories with the following issues:
intersphinx inventory 'http://jinja.palletsprojects.com/objects.inv' not fetchable due to <class 'requests.exceptions.ConnectionError'>: HTTPConnectionPool(host='jinja.palletsprojects.com', port=80): Max retries exceeded with url: /objects.inv (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f8fd1e8e0d0>: Failed to establish a new connection: [Errno -2] Name or service not known'))
intersphinx inventory '../jinja2.inv' not fetchable due to <class 'FileNotFoundError'>: [Errno 2] No such file or directory: '/builddir/build/BUILD/sphinx_ansible_theme-0.3.1/docs/../jinja2.inv'

It completes "successfully", but if the package ends up being incomplete, that's also not good.

Comment 4 chedi toueiti 2020-07-18 21:24:22 UTC
The same thing happens when building with koji

https://koji.fedoraproject.org/koji/taskinfo?taskID=47396069
and 
https://koji.fedoraproject.org/koji/taskinfo?taskID=47397719

but not from my machine, it seems there is some network issue between the build server and docs.python.org

I didn't also have these issues when using copr

https://copr.fedorainfracloud.org/coprs/chedi/python-packages/build/1559500/

Comment 5 chedi toueiti 2020-07-18 22:26:59 UTC
@andy,

Could you please confirm the review as I think the last point is really not that detrimental to the package core 
functionality (it's part of the documentation generation process and I cannot really influence it in any way other 
that signalling the connectivity issue to the infrastructure team)

and thanks again for taking the time to help with this review.

Comment 6 Andy Mender 2020-07-19 13:18:50 UTC
Approved! :)

Comment 7 Gwyn Ciesla 2020-07-20 13:52:13 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/python-sphinx_ansible_theme

Comment 8 Ken Dreyer 2020-07-21 23:04:55 UTC
Koji builders are firewalled from the internet so that builds are secure and deterministic, and the HTTPS requests will always time out.

We could probably delete the intersphinx_mapping settings entirely. https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#confval-intersphinx_mapping  There are references in docs/conf.py to cached inventory files, but it's not clear to me where those live or how they're updated: https://github.com/ansible-community/sphinx_ansible_theme/issues/22


Note You need to log in before you can comment on or make changes to this bug.