Bug 1879291 - Review Request: python-bokeh - Interactive plots and applications in the browser from Python
Summary: Review Request: python-bokeh - Interactive plots and applications in the brow...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Charalampos Stratakis
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: fedora-neuro, NeuroFedora
TreeView+ depends on / blocked
 
Reported: 2020-09-15 21:49 UTC by Ankur Sinha (FranciscoD)
Modified: 2020-09-28 00:14 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-09-28 00:14:57 UTC
Type: ---
Embargoed:
cstratak: fedora-review+


Attachments (Terms of Use)

Description Ankur Sinha (FranciscoD) 2020-09-15 21:49:35 UTC
Spec URL: https://ankursinha.fedorapeople.org/python-bokeh/python-bokeh.spec
SRPM URL: https://ankursinha.fedorapeople.org/python-bokeh/python-bokeh-2.2.1-1.fc32.src.rpm

Description: 
Bokeh is an interactive visualization library for modern web browsers. It
provides elegant, concise construction of versatile graphics, and affords
high-performance interactivity over large or streaming datasets. Bokeh can help
anyone who would like to quickly and easily make interactive plots, dashboards,
and data applications.

Fedora Account System Username: ankursinha

Comment 1 Charalampos Stratakis 2020-09-16 09:43:45 UTC
Will review this package.

Comment 2 Charalampos Stratakis 2020-09-16 09:44:19 UTC
%{?python_enable_dependency_generator} can be removed as it's enabled by default since Fedora 30

Comment 3 Charalampos Stratakis 2020-09-16 09:46:32 UTC
The %{?python_provide:%python_provide python3-%{pypi_name}} macro can be removed if the package is intended only for rawhide and/or F33. It's still required for Fedora <= 32.

Comment 4 Charalampos Stratakis 2020-09-16 09:48:45 UTC
You can use the pyproject-rpm-macros to simplify the SPEC a lot, assuming that the upstream metadata is correct.

Could you take a look at https://src.fedoraproject.org/rpms/pyproject-rpm-macros/blob/master/f/README.md ?

Here is an example of a SPEC conversion: https://src.fedoraproject.org/rpms/python-more-itertools/pull-request/7#request_diff

Comment 5 Ankur Sinha (FranciscoD) 2020-09-16 10:00:28 UTC
Thanks for the comments, Charalampos.

I've made the suggested changes now. Turns out some of the deps aren't up to date enough in F32, so bokeh can't be used on Fedora <= 32.

* Wed Sep 16 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.2.1-1
- Remove dependency generator: no longer needed since F30
- Remove python provide line: no longer needed for F33+

Spec URL: https://ankursinha.fedorapeople.org/python-bokeh/python-bokeh.spec
SRPM URL: https://ankursinha.fedorapeople.org/python-bokeh/python-bokeh-2.2.1-1.fc32.src.rpm

Since all members of the Neuro SIG need to be able to work with our specs, I'd prefer to hold off on using the pyproject-rpm macros until they're in the packaging guidelines. (I've used them in projects that use the pyproject.toml specification but there it was necessary to do so).

Cheers,

Comment 6 Charalampos Stratakis 2020-09-16 11:09:00 UTC
Package Review
==============

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



===== 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.
[X]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses
     found: "Unknown or generated", "BSD 3-clause "New" or "Revised"
     License", "*No copyright* BSD 3-clause "New" or "Revised" License",
     "Apache License (v2.0)", "Expat License BSD 3-clause "New" or
     "Revised" License", "Expat License Apache License (v2.0)", "Expat
     License". 1463 files have unknown license.
[X]: If the package is under multiple licenses, the licensing breakdown
     must be documented in the spec.

Nitpick here: Licensing breakdown could be more specific.

[?]: Package contains no bundled libraries without FPC exception.

There are some files with which have a license somewhere in the middle and they mention other libraries there. For example on bokeh/server/static/js/bokeh-widgets.legacy.js I see:

535: /* flatpickr/dist/flatpickr.js */ function _(require, module, exports) {
    /* flatpickr v4.6.3, @license MIT */

I am not very familiar with javascript code. Would flatpickr in this case be considered a bundled library?

[X]: Changelog in prescribed format.

Nitpick: Increment the release or place the second changelog entry within the first. It's more for consistency and not having two changelog entries with the same version/release. But this is more of a cosmetic change, not a blocker.

[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
[-]: Package uses nothing in %doc for runtime.
[-]: Package consistently uses macros (instead of hard-coded directory
     names).
[?]: Package is named according to the Package Naming Guidelines.

The package provides a binary as well. If its primary purpose is to utilize the binary and use the package as an application, then the name 'bokeh' instead of 'python-bokeh' would be more appropriate. If its main purpose is to be used as a library then it would be the other way around. What would be then its primary usage?

[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.
[X]: 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.
[-]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 20480 bytes in 1 files.
[X]: 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.
[x]: 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.
[x]: 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.
[X]: A package which is used by another package via an egg interface should
     provide egg info.
[X]: Package meets the Packaging Guidelines::Python
[x]: Package contains BR: python2-devel or python3-devel
[x]: 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.
[x]: Python packages must not contain %{pythonX_site(lib|arch)}/* in %files
[x]: Binary eggs must be removed in %prep

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

Generic:
[-]: 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).
[X]: 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.
[X]: 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:
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: python3-bokeh-2.2.1-1.fc34.noarch.rpm
          python-bokeh-2.2.1-1.fc34.src.rpm
python3-bokeh.noarch: W: spelling-error %description -l en_US datasets -> data sets, data-sets, databases
python3-bokeh.noarch: W: hidden-file-or-dir /usr/lib/python3.9/site-packages/bokeh/server/static/.keep
python3-bokeh.noarch: E: zero-length /usr/lib/python3.9/site-packages/bokeh/server/static/.keep
python3-bokeh.noarch: W: no-manual-page-for-binary bokeh
python-bokeh.src: W: spelling-error %description -l en_US datasets -> data sets, data-sets, databases
2 packages and 0 specfiles checked; 1 errors, 4 warnings.

There is an empty .keep file for some reason



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.
python3-bokeh.noarch: W: spelling-error %description -l en_US datasets -> data sets, data-sets, databases
python3-bokeh.noarch: W: invalid-url URL: https://github.com/bokeh/bokeh <urlopen error [Errno -3] Temporary failure in name resolution>
python3-bokeh.noarch: W: hidden-file-or-dir /usr/lib/python3.9/site-packages/bokeh/server/static/.keep
python3-bokeh.noarch: E: zero-length /usr/lib/python3.9/site-packages/bokeh/server/static/.keep
python3-bokeh.noarch: W: no-manual-page-for-binary bokeh
1 packages and 0 specfiles checked; 1 errors, 4 warnings.



Source checksums
----------------
https://files.pythonhosted.org/packages/source/b/bokeh/bokeh-2.2.1.tar.gz :
  CHECKSUM(SHA256) this package     : a82e9eebd7a1e2ebb7f8fc1ead802fefd10a84daef8ec4bfc986121323948555
  CHECKSUM(SHA256) upstream package : a82e9eebd7a1e2ebb7f8fc1ead802fefd10a84daef8ec4bfc986121323948555


Requires
--------
python3-bokeh (rpmlib, GLIBC filtered):
    /usr/bin/python3
    python(abi)
    python3.9dist(jinja2)
    python3.9dist(numpy)
    python3.9dist(packaging)
    python3.9dist(pillow)
    python3.9dist(python-dateutil)
    python3.9dist(pyyaml)
    python3.9dist(setuptools)
    python3.9dist(tornado)
    python3.9dist(typing-extensions)



Provides
--------
python3-bokeh:
    python-bokeh
    python3-bokeh
    python3.9-bokeh
    python3.9dist(bokeh)
    python3dist(bokeh)



Generated by fedora-review 0.7.5 (5fa5b7e) last change: 2020-02-16
Command line :/usr/bin/fedora-review -b 1879291 -m fedora-rawhide-x86_64
Buildroot used: fedora-rawhide-x86_64
Active plugins: Generic, Python, Shell-api
Disabled plugins: fonts, Java, SugarActivity, R, Haskell, Ocaml, Perl, C/C++, PHP
Disabled flags: EPEL6, EPEL7, DISTTAG, BATCH, EXARCH


Also why is the usr/bin/env shebang removal line in the SPEC? I didn't find any python shebangs within the project. Is it for future proofing in the case they appear at some point?

Comment 7 Ankur Sinha (FranciscoD) 2020-09-17 12:06:44 UTC
(In reply to Charalampos Stratakis from comment #6)
> <snip>> 
> [?]: Package contains no bundled libraries without FPC exception.
> 
> There are some files with which have a license somewhere in the middle and
> they mention other libraries there. For example on
> bokeh/server/static/js/bokeh-widgets.legacy.js I see:
> 
> 535: /* flatpickr/dist/flatpickr.js */ function _(require, module, exports) {
>     /* flatpickr v4.6.3, @license MIT */
> 
> I am not very familiar with javascript code. Would flatpickr in this case be
> considered a bundled library?
> 

Thanks Charalampos.

I'll have to check on this too. From the looks of it, the pypi tar includes the built version of bokehjs, which bundles a bunch of node js libraries. These are included here in the package-lock.json file (the ones that aren't dev ones are what I'll have to look at):

https://github.com/bokeh/bokeh/blob/0b9526ef553d938bf5de187e2511564c648c13bd/bokehjs/package-lock.json

This is the whole dep tree, though. So are we required to include all of these as bundled(...), or do we grep the sources to see which of these are actually bundled and only include those? I think the latter perhaps, but js files are notoriously hard to go through. I'll go enquire on the -devel list.

Comment 8 Ankur Sinha (FranciscoD) 2020-09-17 20:05:41 UTC
Hello,

I updated the spec:

* Thu Sep 17 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.2.1-2
- Include detailed licensing
- Add optional requirements
- Remove commented shebang correction command
- List bundled nodejs libs with licenses
- include parse script in srpm
- Remove zero length files


The primary use case for bokeh is to be used as a python module, so I haven't changed the name of the package.

Spec URL: https://ankursinha.fedorapeople.org/python-bokeh/python-bokeh.spec
SRPM URL: https://ankursinha.fedorapeople.org/python-bokeh/python-bokeh-2.2.1-2.fc32.src.rpm

Cheers!

Comment 9 Charalampos Stratakis 2020-09-18 11:31:15 UTC
Thank you for the changes.

That's a great licensing breakdown. Some more recommendations on that.

I didn't go through the bundled code, however within https://github.com/bokeh/bokeh/blob/branch-2.3/bokehjs/LICENSE there is a breakdown of the licenses within the bundled software, so on the license field you'll need to add AFL and Unlicense and WTFPL (unless upstream has removed the software with those licenses and forgot to update the info).

Also could you provide a comment in the SPEC for the parse-deps.py script on its purpose and usage? It can be obvious by reading the code, but an explanation comment would be quite useful.

Also the shebang of the script should be changed to /usr/bin/python3 instead of the env variant.

The rest look great.

Comment 10 Charalampos Stratakis 2020-09-18 11:35:30 UTC
Ah and another thing. According to the bundling guidelines, the bundled provides naming scheme should be of the form, as if the bundled library would enter the distro as a normal package.

See: http://docs.horsefunerals.co.uk/en-US/packaging-guidelines/#bundling and http://docs.horsefunerals.co.uk/en-US/packaging-guidelines/Node.js/#_naming_guidelines

Comment 11 Charalampos Stratakis 2020-09-18 11:37:31 UTC
So e.g. the line "Provides: bundled(npm(redux)) = 4.0.5" should be changed to "Provides: bundled(nodejs-redux) = 4.0.5". You might want to adapt your python script for it.

Comment 12 Ankur Sinha (FranciscoD) 2020-09-18 19:17:06 UTC
Their license file seems to be out of date. I ran their commands and came up with the same licenses that I had manually populated:

$ npx license-checker --production --csv
"module name","license","repository"
"@bokeh/bokehjs.1","BSD-3-Clause","https://github.com/bokeh/bokeh"
"@bokeh/numbro.2","MIT","https://github.com/foretagsplatsen/numbro"
"@bokeh/slickgrid.2701","MIT","https://github.com/bokeh/SlickGrid"
"@types/jquery.1","MIT","https://github.com/DefinitelyTyped/DefinitelyTyped"
"@types/sizzle.2","MIT","https://github.com/DefinitelyTyped/DefinitelyTyped"
"@types/slickgrid.30","MIT","https://github.com/DefinitelyTyped/DefinitelyTyped"
"choices.js.1","MIT","https://github.com/jshjohnson/Choices"
"d.1","ISC","https://github.com/medikoo/d"
"deepmerge.2","MIT","https://github.com/TehShrike/deepmerge"
"es5-ext.53","ISC","https://github.com/medikoo/es5-ext"
"es6-iterator.3","MIT","https://github.com/medikoo/es6-iterator"
"es6-map.5","MIT","https://github.com/medikoo/es6-map"
"es6-promise.8","MIT","https://github.com/stefanpenner/es6-promise"
"es6-set.5","MIT","https://github.com/medikoo/es6-set"
"es6-symbol.1","MIT","https://github.com/medikoo/es6-symbol"
"es6-symbol.3","ISC","https://github.com/medikoo/es6-symbol"
"es6-weak-map.3","ISC","https://github.com/medikoo/es6-weak-map"
"event-emitter.5","MIT","https://github.com/medikoo/event-emitter"
"ext.0","ISC","https://github.com/medikoo/es5-ext/tree/ext"
"flatbush.0","ISC","https://github.com/mourner/flatbush"
"flatpickr.3","MIT","https://github.com/chmln/flatpickr"
"flatqueue.1","ISC","https://github.com/mourner/flatqueue"
"fuse.js.1","Apache-2.0","https://github.com/krisk/Fuse"
"hammerjs.8","MIT","https://github.com/hammerjs/hammer.js"
"jquery-ui.1","MIT","https://github.com/jquery/jquery-ui"
"jquery.1","MIT","https://github.com/jquery/jquery"
"js-tokens.0","MIT","https://github.com/lydell/js-tokens"
"loose-envify.0","MIT","https://github.com/zertosh/loose-envify"
"mgrs.0","MIT","https://github.com/proj4js/mgrs"
"next-tick.0","MIT","https://github.com/medikoo/next-tick"
"nouislider.0","MIT","https://github.com/leongersen/noUiSlider"
"proj4.2","MIT","https://github.com/proj4js/proj4js"
"redux.5","MIT","https://github.com/reduxjs/redux"
"sprintf-js.2","BSD-3-Clause","https://github.com/alexei/sprintf.js"
"symbol-observable.0","MIT","https://github.com/blesh/symbol-observable"
"timezone.23","MIT","https://github.com/bigeasy/timezone"
"tslib.0","0BSD","https://github.com/Microsoft/tslib"
"type.0","ISC","https://github.com/medikoo/type"
"type.0","ISC","https://github.com/medikoo/type"
"underscore.template.7","MIT","https://github.com/superRaytin/underscore.template"
"wkt-parser.4","MIT","https://github.com/proj4js/wkt-parser"


I've updated the spec/srpm:

* Fri Sep 18 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 2.2.1-3
- Update naming scheme for bundled bits, also in script
- Comment use of parse script
- Correct parse script shebang


Spec URL: https://ankursinha.fedorapeople.org/python-bokeh/python-bokeh.spec
SRPM URL: https://ankursinha.fedorapeople.org/python-bokeh/python-bokeh-2.2.1-3.fc32.src.rpm

Cheers!

Comment 13 Charalampos Stratakis 2020-09-21 11:23:03 UTC
Great, everything looks good :) Approved.

Comment 14 Ankur Sinha (FranciscoD) 2020-09-21 11:43:48 UTC
Thanks very much. SCM requested now :)

Comment 15 Fedora Update System 2020-09-23 18:52:59 UTC
FEDORA-2020-b06485eb36 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-b06485eb36

Comment 16 Fedora Update System 2020-09-24 13:33:08 UTC
FEDORA-2020-b06485eb36 has been pushed to the Fedora 33 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --advisory=FEDORA-2020-b06485eb36 \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-b06485eb36

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 17 Fedora Update System 2020-09-28 00:14:57 UTC
FEDORA-2020-b06485eb36 has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.


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