Bug 1889104 - Review Request: python-googletrans - Google Translate API for Python
Summary: Review Request: python-googletrans - Google Translate API for Python
Keywords:
Status: CLOSED ERRATA
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: 1889105
TreeView+ depends on / blocked
 
Reported: 2020-10-17 20:58 UTC by Lyes Saadi
Modified: 2020-10-31 01:53 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-31 01:53:19 UTC
Type: ---
Embargoed:
andymenderunix: fedora-review+


Attachments (Terms of Use)

Description Lyes Saadi 2020-10-17 20:58:37 UTC
Spec URL: https://lyessaadi.fedorapeople.org/dialect/python-googletrans.spec
SRPM URL: https://lyessaadi.fedorapeople.org/dialect/python-googletrans-3.0.0-1.fc33.src.rpm

Copr Build: https://copr.fedorainfracloud.org/coprs/lyessaadi/dialect/build/1708802/

Description:
Googletrans is a free and unlimited python library that implemented Google
Translate API. This uses the Google Translate Ajax API to make calls to such
methods as detect and translate.

Fedora Account System Username: lyessaadi

Note: I am unretiring this package.
Note 2: Won't work on f32/31 because of #1887012.

Comment 1 Andy Mender 2020-10-17 21:44:47 UTC
> BuildArch:      noarch
> 
> BuildRequires:  python3-devel
> BuildRequires:  python3-httpx

Python dependencies other than "python3-devel" should be declared following the format "python3dist(foo)".

> %package -n python3-%{pypi_name}
> Summary:        Google Translate API for Python
> 
> Requires:       python3-httpx

Same here.

> %{?python_disable_dependency_generator}
> 
> %{?python_provide:%python_provide python3-%{pypi_name}}

Please, switch to the %py_provides macro: https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_the_py_provides_macro

> %prep
> %autosetup -n %{pypi_name}-%{version}

The PyPi package bundles its own egg info, but that should not be added to the Fedora package. Please, remove it by adding the following line after the %autosetup call:
> rm -rf %{pypi_name}.egg-info

More info here: https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_packaging_eggs

> %files -n python3-%{pypi_name}
> %doc README.rst
> %{python3_sitelib}/%{pypi_name}*
> %{_bindir}/%{pypi_name}

Missing license file. I see it's not in the PyPi package. Please, check if it's possible to contact upstream and add a license file.

Also, if this package is to be used by another package, it should provide egg info, by adding the following line at the end of the %files section:
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info/

Full review below:
Package Review
==============

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


Issues:
=======
- Package does not use a name that already exists.
  Note: A package with this name already exists. Please check
  https://src.fedoraproject.org/rpms/python-googletrans
  See: https://docs.fedoraproject.org/en-US/packaging-
  guidelines/Naming/#_conflicting_package_names
  Review: That's fine. It's a unretirement request.


===== 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.
[!]: 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.
[ ]: 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". 15 files have unknown
     license. Detailed output of licensecheck in
     /home/amender/rpmbuild/SPECS/python-googletrans/copr-
     build-1708802/review-python-googletrans/licensecheck.txt
[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 20480 bytes in 1 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]: 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 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
[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:
[x]: Reviewer should test that the package builds in mock.
[!]: 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.
     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]: 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: No rpmlint messages.
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: python3-googletrans-3.0.0-1.fc34.noarch.rpm
          python-googletrans-3.0.0-1.fc34.src.rpm
python3-googletrans.noarch: W: no-manual-page-for-binary googletrans
2 packages and 0 specfiles checked; 0 errors, 1 warnings.




Rpmlint (installed packages)
----------------------------
(none): E: no installed packages by name python3-googletrans
0 packages and 0 specfiles checked; 0 errors, 0 warnings.



Source checksums
----------------
https://files.pythonhosted.org/packages/source/g/googletrans/googletrans-3.0.0.tar.gz :
  CHECKSUM(SHA256) this package     : 44caeea42d91ff6ead5c2d49db2b88de66c45c2fe874c8ec03eb9b4ceb3a533d
  CHECKSUM(SHA256) upstream package : 44caeea42d91ff6ead5c2d49db2b88de66c45c2fe874c8ec03eb9b4ceb3a533d


Requires
--------
python3-googletrans (rpmlib, GLIBC filtered):
    /usr/bin/python3
    python(abi)
    python3-httpx



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

Comment 2 Lyes Saadi 2020-10-17 22:25:08 UTC
Oh, well... I took the package from someone else, I haven't checked thoroughly enough for issues it seems :P. It was to be expected since the recent changes in Python packaging. Thank you for taking such a quick and precise look into it! I will check myself again for anything else missing.

> Missing license file. I see it's not in the PyPi package. Please, check if it's possible to contact upstream and add a license file.

The License is in the README.md. I know, it's a bad choice from upstream, but that's still check what Fedora considers necessary.

Anyway, thanks for the VERY QUICK review... Wow. That's honestly impressive! I am willing to do a review for you if you have one!

I will address all these issues tomorrow, since where I am, it is a bit late now :)!

Comment 3 Lyes Saadi 2020-10-18 10:23:36 UTC
All your issues were addressed (I also included the description in a `%global` instead of having it repeated twice).

Spec URL: https://lyessaadi.fedorapeople.org/dialect/python-googletrans.spec
SRPM URL: https://lyessaadi.fedorapeople.org/dialect/python-googletrans-3.0.0-2.fc33.src.rpm

---

> > %{?python_disable_dependency_generator}
> > 
> > %{?python_provide:%python_provide python3-%{pypi_name}}
> 
> Please, switch to the %py_provides macro: https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_the_py_provides_macro

I removed it entirely since the package will likely never be packaged for f32- because of #1887012.

> > %files -n python3-%{pypi_name}
> > %doc README.rst
> > %{python3_sitelib}/%{pypi_name}*
> > %{_bindir}/%{pypi_name}
> 
> [...]
> 
> Also, if this package is to be used by another package, it should provide egg info, by adding the following line at the end of the %files section:
> %{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info/

This was already covered by the glob `%{python3_sitelib}/%{pypi_name}*` but I do think that this is a bad thing to do, so I removed it and replaced it by the more traditional way to do it.

---

Sorry for all those quite silly mistakes, it's only my second time unretiring a package, and I'd thought that this package would've been in a better shape, so I haven't checked thoroughly for errors, which I should've.

Anyway, thank you again for this quick and thorough review.

Comment 4 Andy Mender 2020-10-18 10:44:57 UTC
No worries at all! Macros and SPEC requirements change over time so it's only fair to have a good, hard look at the previous SPEC and improve it when unretiring :).

Everything looks okay now. Package approved!

Comment 5 Lyes Saadi 2020-10-18 10:55:06 UTC
Thank you!

https://pagure.io/releng/issue/9813

Comment 6 Miro Hrončok 2020-10-18 22:32:17 UTC
I wonder, why %{?python_disable_dependency_generator} ?

Comment 7 Lyes Saadi 2020-10-19 18:00:08 UTC
Wow, Miro Hrončok saw me :3! Hello, I'm a big fan :P!

> I wonder, why %{?python_disable_dependency_generator} ?

setup.py requires "httpx==0.13.3", but in the repos, there's version 0.15/0.16. They work perfectly with python-googletrans and cause no issue according to what I tested. But removing %{?python_disable_dependency_generator} would require version 0.13.3 specifically, which would make python-googletrans uninstallable. Should I have done it another way?

Comment 8 Miro Hrončok 2020-10-19 22:59:59 UTC
I recommend relaxing the dependency in setup.py instead and submitting a pull request / patch upstream.

Comment 9 Lyes Saadi 2020-10-20 18:44:53 UTC
> I recommend relaxing the dependency in setup.py instead and submitting a pull request / patch upstream.

I can see why. I'll make sure to patch the setup.py to do that before importing.

We can never be sure of when a new dependency pops up :P!

Comment 10 Fedora Update System 2020-10-22 21:42:55 UTC
FEDORA-2020-938a10a9d9 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-938a10a9d9

Comment 11 Fedora Update System 2020-10-23 23:40:17 UTC
FEDORA-2020-938a10a9d9 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-938a10a9d9 \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-938a10a9d9

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

Comment 12 Fedora Update System 2020-10-31 01:53:19 UTC
FEDORA-2020-938a10a9d9 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.