Bug 2233128 - Review Request: python-flasgger - Easy OpenAPI specs and Swagger UI for your Flask API
Summary: Review Request: python-flasgger - Easy OpenAPI specs and Swagger UI for your ...
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Adam Williamson
QA Contact: Fedora Extras Quality Assurance
URL: https://github.com/flasgger/flasgger
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-08-21 14:25 UTC by Mikel Olasagasti Uranga
Modified: 2024-03-01 17:20 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:
awilliam: fedora-review?


Attachments (Terms of Use)
The .spec file difference from Copr build 6326863 to 6327194 (271 bytes, patch)
2023-08-21 15:21 UTC, Fedora Review Service
no flags Details | Diff
The .spec file difference from Copr build 6327194 to 6350490 (1.16 KB, patch)
2023-08-28 22:15 UTC, Fedora Review Service
no flags Details | Diff

Description Mikel Olasagasti Uranga 2023-08-21 14:25:35 UTC
Spec URL: https://mikel.olasagasti.info/tmp/fedora/python-flasgger.spec
SRPM URL: https://mikel.olasagasti.info/tmp/fedora/python-flasgger-0.9.7.1-1.fc38.src.rpm
Description: Easy OpenAPI specs and Swagger UI for your Flask API.
Fedora Account System Username: mikelo2

Comment 1 Fedora Review Service 2023-08-21 14:38:16 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6326863
(failed)

Build log:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2233128-python-flasgger/fedora-rawhide-x86_64/06326863-python-flasgger/builder-live.log.gz

Please make sure the package builds successfully at least for Fedora Rawhide.

- If the build failed for unrelated reasons (e.g. temporary network
  unavailability), please ignore it.
- If the build failed because of missing BuildRequires, please make sure they
  are listed in the "Depends On" field


---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 3 Fedora Review Service 2023-08-21 15:21:11 UTC
Created attachment 1984362 [details]
The .spec file difference from Copr build 6326863 to 6327194

Comment 4 Fedora Review Service 2023-08-21 15:21:13 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6327194
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2233128-python-flasgger/fedora-rawhide-x86_64/06327194-python-flasgger/fedora-review/review.txt

Please take a look if any issues were found.

---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 5 Adam Williamson 2023-08-23 23:58:07 UTC
Package Review
==============

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


Issues:
=======

* The Droid Sans font is bundled (in /usr/lib/python3.12/site-packages/flasgger/ui2/static/fonts). This affects the licensing - Droid Sans is licensed under the Apache License 2.0, not MIT - and is against the guidelines. It may be best to drop the bundled files, add a dep on google-droid-sans-fonts , and symlink the files from that package into the locations where flasgger expects them to be (this would also resolve the licensing qualm, I guess). Note, I'm not sure what's up with all the 'droid-sans-v6-latin-700' and 'droid-sans-v6-latin-regular' files, especially the eot, svg, and woff files - can you look into that and figure out what they are and why they're needed?

* Please check the rpmlint output...looks like upstream issues, if anything, but would be nice to know why there's a zero-length file and a pair of duplicate files.

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

Generic:
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
     Note: Using prebuilt packages
[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. No licenses
     found. Please check the source files for licenses manually.
[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.
[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 40960 bytes in 2 files.
[x]: Package complies to the Packaging Guidelines
[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 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:
[-]: Binary eggs must be removed in %prep
     Note: Cannot find any build in BUILD directory (--prebuilt option?)
[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

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

Generic:
[x]: Reviewer should test that the package builds in mock.
[!]: Avoid bundling fonts in non-fonts packages.
[-]: 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).
[?]: 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.
[-]: Package should compile and build into binary rpms on all supported
     architectures.
[x]: %check is present and all tests pass.
[?]: Packages should try to preserve timestamps of original installed
     files.
[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).


Rpmlint
-------
Checking: python3-flasgger-0.9.7.1-1.fc40.noarch.rpm
          python-flasgger-0.9.7.1-1.fc40.src.rpm
============================ rpmlint session starts ============================
rpmlint: 2.4.0
configuration:
    /usr/lib/python3.11/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-legacy-licenses.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
rpmlintrc: [PosixPath('/tmp/tmpcrzu0tok')]
checks: 31, packages: 2

python3-flasgger.noarch: E: zero-length /usr/lib/python3.12/site-packages/flasgger/ui2/static/css/typography.css
python3-flasgger.noarch: W: files-duplicate /usr/lib/python3.12/site-packages/flasgger/ui2/templates/flasgger/o2c.html /usr/lib/python3.12/site-packages/flasgger/ui2/static/o2c.html
 2 packages and 0 specfiles checked; 1 errors, 1 warnings, 1 badness; has taken 0.2 s 




Rpmlint (installed packages)
----------------------------
============================ rpmlint session starts ============================
rpmlint: 2.4.0
configuration:
    /usr/lib/python3.12/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-legacy-licenses.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
checks: 31, packages: 1

python3-flasgger.noarch: E: zero-length /usr/lib/python3.12/site-packages/flasgger/ui2/static/css/typography.css
python3-flasgger.noarch: W: files-duplicate /usr/lib/python3.12/site-packages/flasgger/ui2/templates/flasgger/o2c.html /usr/lib/python3.12/site-packages/flasgger/ui2/static/o2c.html
 1 packages and 0 specfiles checked; 1 errors, 1 warnings, 1 badness; has taken 0.1 s 



Source checksums
----------------
https://github.com/flasgger/flasgger/archive/refs/tags/v0.9.7.1.tar.gz :
  CHECKSUM(SHA256) this package     : da0034532e8e0c21d097dc1de4df3e48b69ebba79650c813f6c8188591790d5a
  CHECKSUM(SHA256) upstream package : da0034532e8e0c21d097dc1de4df3e48b69ebba79650c813f6c8188591790d5a


Requires
--------
python3-flasgger (rpmlib, GLIBC filtered):
    python(abi)
    python3.12dist(flask)
    python3.12dist(jsonschema)
    python3.12dist(mistune)
    python3.12dist(packaging)
    python3.12dist(pyyaml)
    python3.12dist(six)



Provides
--------
python3-flasgger:
    python-flasgger
    python3-flasgger
    python3.12-flasgger
    python3.12dist(flasgger)
    python3dist(flasgger)

Comment 6 Mikel Olasagasti Uranga 2023-08-28 22:11:50 UTC
Spec URL: https://mikel.olasagasti.info/tmp/fedora/python-flasgger.spec
SRPM URL: https://mikel.olasagasti.info/tmp/fedora/python-flasgger-0.9.7.1-1.fc38.src.rpm

> python3-flasgger.noarch: E: zero-length /usr/lib/python3.12/site-packages/flasgger/ui2/static/css/typography.css

Removed

> python3-flasgger.noarch: W: files-duplicate /usr/lib/python3.12/site-packages/flasgger/ui2/templates/flasgger/o2c.html /usr/lib/python3.12/site-packages/flasgger/ui2/static/o2c.html

flasgger offers a template in case the user wants to edit the UI. I would leave it as is.

> * The Droid Sans font is bundled (in /usr/lib/python3.12/site-packages/flasgger/ui2/static/fonts). This affects the licensing - Droid Sans is licensed under the Apache License 2.0, not MIT - and is against the guidelines. It may be best to drop the bundled files, add a dep on google-droid-sans-fonts , and symlink the files from that package into the locations where flasgger expects them to be (this would also resolve the licensing qualm, I guess). Note, I'm not sure what's up with all the 'droid-sans-v6-latin-700' and 'droid-sans-v6-latin-regular' files, especially the eot, svg, and woff files - can you look into that and figure out what they are and why they're needed?

ui2 uses droid as part of the css (font-family:Droid Sans). Wouldn't just requiring the google-droid-sans-fonts package be enough in this case? I created the link in the spec, but could be removed.

Now I realize that UI has mulitple js files:

static/lib/jquery-1.8.0.min.js
static/lib/es5-shim.js
static/lib/js-yaml.min.js
static/lib/handlebars-4.0.5.js
static/lib/jsoneditor.min.js
static/lib/swagger-oauth.js
static/lib/sanitize-html.min.js
static/lib/object-assign-pollyfill.js
static/lib/highlight.9.1.0.pack.js
static/lib/lodash.min.js
static/lib/jquery.slideto.min.js
static/lib/jquery.ba-bbq.min.js
static/lib/jquery.wiggle.min.js
static/lib/backbone-min.js
static/lib/marked.js
static/lib/highlight.9.1.0.pack_extended.js
static/swagger-ui.min.js

As shipping this is not allowed, I think it's quite complex to package flasgger.

Comment 7 Fedora Review Service 2023-08-28 22:15:18 UTC
Created attachment 1985725 [details]
The .spec file difference from Copr build 6327194 to 6350490

Comment 8 Fedora Review Service 2023-08-28 22:15:20 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/6350490
(failed)

Build log:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2233128-python-flasgger/fedora-rawhide-x86_64/06350490-python-flasgger/builder-live.log.gz

Please make sure the package builds successfully at least for Fedora Rawhide.

- If the build failed for unrelated reasons (e.g. temporary network
  unavailability), please ignore it.
- If the build failed because of missing BuildRequires, please make sure they
  are listed in the "Depends On" field


---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 9 Adam Williamson 2023-08-28 22:25:47 UTC
Yeah...I'm not entirely an expert in the domain, but I think you're right, shipping minified JS without the minification happening during the build violates https://docs.fedoraproject.org/en-US/packaging-guidelines/JavaScript/#_compilationminification . Apologies for not spotting that during review.

It might be worth asking someone with more experience in packaging this kind of thing...

I do note most of those are in the ui2/ tree. ui3 has only a minified jquery (2.2.4). httpbin uses ui3. So we might be able to handle this at least enough for httpbin...we can not ship ui2, and provide jquery in a compliant way? Unfortunately, js-jquery is jquery 3.x, and js-jquery2 was retired long ago, but we might at least be able to bundle a non-minified original jquery2 and minify it at build time, or just *not* minify it since httpbin isn't really meant for use over networks at all?

Another option would be to make httpbin's use of flasgger optional. It's not really *necessary*, is it? It's just for generating API docs. We might be able to send a PR upstream for httpbin that skips the flasgger stuff if it's not present?

Comment 10 Adam Williamson 2023-08-28 22:31:54 UTC
Filed https://github.com/psf/httpbin/issues/26 to hopefully get some input from upstream on the flasgger question.

Comment 11 Adam Williamson 2023-10-18 00:40:06 UTC
I went ahead and sent a PR upstream to make flasgger optional for httpbin: https://github.com/psf/httpbin/pull/32 . I'll test if backporting that lets us get the latest httpbin into Rawhide.


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