Bug 1671790 - Review Request: python-vistir - python library including utility functions
Summary: Review Request: python-vistir - python library including utility functions
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Zbigniew Jędrzejewski-Szmek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1664384 1671787 1671788
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-02-01 16:38 UTC by Patrik Kopkan
Modified: 2019-07-22 11:51 UTC (History)
4 users (show)

Fixed In Version: python-vistir-0.4.3-1.fc31
Clone Of:
Environment:
Last Closed: 2019-07-22 11:51:30 UTC
Type: ---
Embargoed:
zbyszek: fedora-review+


Attachments (Terms of Use)

Description Patrik Kopkan 2019-02-01 16:38:49 UTC
Spec URL: https://pagure.io/python-vistir/raw/master/f/python-vistir.spec
SRPM URL: https://pagure.io/python-vistir/blob/master/f/python-vistir-0.3.0-1.fc29.src.rpm
Description: python library providing utility functions.
Fedora Account System Username: pkopkan

Comment 2 Miro Hrončok 2019-02-13 09:09:08 UTC
I will not yet try to build this or assign this to me, but several notes:


    Patch0:         vistir-patch.patch

What is this? Why is it named "patch"? Please make the name as much descriptive as possible, add comment if needed.


    # setuptools>=38.2.5
    BuildRequires:  python3-setuptools

Use the version limit or don't, there is no try. The comment is useless.


    Requires:       python3dist(colorama)
    Requires:       python3dist(requests)
    Requires:       python3dist(six)

Are those not added automatically?


    # should be optional because they are bundled but doesn't work
    Requires:       python3-yaspin
    Requires:       python3-cursor

What does it actually mean that they should be optional because bundled? What does it mean it doesn't work?



    %autosetup -n %{srcname}-%{version} -p2

Try to use git-like patches (-p1) if you can. It makes work for others as easy as possible.


    PYTHONPATH=./build/lib %{__python3} -m pytest tests

Try to use the installed package for testing instead. PYTHONPATH=%{buildroot}%{python3_sitelib}.

Comment 4 Patrik Kopkan 2019-02-13 19:22:59 UTC
    # should be optional because they are bundled but doesn't work
    Requires:       python3-yaspin
    Requires:       python3-cursor

What does it actually mean that they should be optional because bundled? What does it mean it doesn't work?


I was little bit confused they are just optional. But tests from test_spinner.py fails if it is missing.

Comment 5 Miro Hrončok 2019-02-13 23:48:18 UTC
A suggestion about python_to_python3.patch:

Don't change "python" to "python3", change it to sys.executable and propose that change upstream.

You can link to https://www.python.org/dev/peps/pep-0394/#recommendation

> When reinvoking the interpreter from a Python script, querying sys.executable to avoid hardcoded assumptions regarding the interpreter location remains the preferred approach.

------

  # this is optional but tests for spinners are failing because of that so I decided to make that hard requires

It is not uncommon that tests need also optional dependencies. Reading the code in https://github.com/sarugaku/vistir/blob/master/src/vistir/spin.py I suggest you use Recommends instead of Requires.

------

Any particular reason to mix python3dist(xxx) and python3-xxx in BuildRequires? I stick to one.

Also, the #for tests comment is kinda weird, aren't others also needed for tests?

------

  # one test require internet to pass
  %bcond_without internet
  ...
  %if %{with internet}
  -k 'not test_open_file'
  %endif


This feels like a reverted logic. When I use "--without internet" the test that requires internet will run, while when I use "--with internet" the test that requires internet won't run. (Bconds are confusing.) What about this instead:

  # one test requires internet connection, we deselect it by default unless --with internet is used
  %bcond_with internet
  ...
  %if %{without internet}
  -k 'not test_open_file'
  %endif

Comment 7 Miro Hrončok 2019-02-21 16:37:41 UTC
> i made subpackage for recommends

The linked specfile is not consistent with this statement (there is no subpackage, the recommends are commented out).

Comment 9 Miro Hrončok 2019-02-22 15:37:06 UTC
What happens if the user only installs python3-vistir-spinners?

Comment 10 Miro Hrončok 2019-02-22 15:41:21 UTC
Note that there is still no subpackage: You need an (empty) %files section for it or it is not generated.

Also note that the subpackage name is now probably wrong.
I suggest you drop the overengineered "subpackage" macro and specify the subpackage name manually instead.

Comment 12 Miro Hrončok 2019-02-22 17:54:44 UTC
I recommend you to read the following guideline: https://docs.fedoraproject.org/en-US/packaging-guidelines/#_requiring_base_package

Note that the %{?_isa} part does not apply for noarch packages.

Comment 13 Miro Hrončok 2019-02-22 17:55:58 UTC
(In this case, think of the python3-vistir package as the "base package" when you read the guideline.)

Comment 15 Miro Hrončok 2019-02-27 12:50:41 UTC
Package Review
==============

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


Issues:
=======

- description-line-too-long C Miscellaneous utilities for dealing with filesystems, paths, projects, sub-processes, and more.

- dependencies are still not packaged (known)

- have you proposed your patch upstream?


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

Generic:
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[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.
[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.
[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 30720 bytes in 1 files.
[x]: Package complies to the Packaging Guidelines
[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]: Binary eggs must be removed in %prep

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

Generic:
[x]: Reviewer should test that the package builds in mock.
[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).
[x]: Fully versioned dependency in subpackages if applicable.
[?]: Package functions as described.
[?]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[x]: Patches link to upstream bugs/comments/lists or are otherwise
     justified.
[-]: 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.
[x]: %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]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: python3-vistir-0.3.0-1.fc30.noarch.rpm
          python3-vistir-spinners-0.3.0-1.fc30.noarch.rpm
          python-vistir-0.3.0-1.fc30.src.rpm
python3-vistir.noarch: E: description-line-too-long C Miscellaneous utilities for dealing with filesystems, paths, projects, sub-processes, and more.
python3-vistir-spinners.noarch: W: no-documentation
3 packages and 0 specfiles checked; 1 errors, 1 warnings.




Requires
--------
python3-vistir-spinners (rpmlib, GLIBC filtered):
    python3-cursor
    python3-vistir
    python3-yaspin

python3-vistir (rpmlib, GLIBC filtered):
    python(abi)
    python3.7dist(colorama)
    python3.7dist(requests)
    python3.7dist(six)



Provides
--------
python3-vistir-spinners:
    python3-vistir-spinners

python3-vistir:
    python3-vistir
    python3.7dist(vistir)
    python3dist(vistir)



Source checksums
----------------
https://github.com/sarugaku/vistir/archive/0.3.0.tar.gz :
  CHECKSUM(SHA256) this package     : e41ce20300edc7656e7d7cba16dacfe0ee833df6f1c14e98feae2938afeb472c
  CHECKSUM(SHA256) upstream package : e41ce20300edc7656e7d7cba16dacfe0ee833df6f1c14e98feae2938afeb472c

Comment 18 Miro Hrončok 2019-03-08 10:07:25 UTC
What changed in the specfile?

If upstream merges a patch (or even when it is proposed) it is good to add a link to the comment. Liek this:

# https://github.com/sarugaku/vistir/issues/59
Patch0:         python_to_sys.executable.patch

Also, have you tested the upstream's patch instead of yours? I remember there were a lot of little changes.

Comment 19 Patrik Kopkan 2019-03-11 15:36:11 UTC
Spec URL: https://copr-be.cloud.fedoraproject.org/results/pkopkan/python-vistir/fedora-rawhide-x86_64/00866815-python-vistir/python-vistir.spec
SRPM URL: https://copr-be.cloud.fedoraproject.org/results/pkopkan/python-vistir/fedora-rawhide-x86_64/00866815-python-vistir/python-vistir-0.3.1-1.fc31.src.rpm

Test passed. I deleted patch0 and build require for python-cursor. Interesting difference could be bumped version of setuptools because of that it won't be build successfully in fedora 29.

Comment 20 Miro Hrončok 2019-03-11 15:49:00 UTC
>  Interesting difference could be bumped version of setuptools because of that it won't be build successfully in fedora 29.

The version in Fedora 29 is too low? See https://bodhi.fedoraproject.org/updates/FEDORA-2019-0bf6b7eaf9

Comment 21 Patrik Kopkan 2019-03-15 10:26:40 UTC
No, it is actually not. I didn't check bodhi for newer versions. 

https://copr.fedorainfracloud.org/coprs/pkopkan/python-vistir/build/868138/

Comment 22 Zbigniew Jędrzejewski-Szmek 2019-04-21 10:18:36 UTC
Looking at https://copr-be.cloud.fedoraproject.org/results/pkopkan/python-vistir/fedora-29-x86_64/00868138-python-vistir/:
things look OK, but the -spinners subpackage is uninstallable:
Error: 
 Problem: conflicting requests
  - nothing provides python3-cursor needed by python3-vistir-spinners-0.3.1-1.fc31.noarch

Comment 23 Zbigniew Jędrzejewski-Szmek 2019-04-21 10:20:26 UTC
It look like 1671787 needs to be revived.

Comment 25 Robert-André Mauchin 🐧 2019-07-11 21:15:16 UTC

 - python3-vistir-spinners has no files? That doesn't seem right

 - use %{py3_dist for your BR/RR if you can 

 - python3-vistir-spinners should probably need a python provide too:

%{?python_provide:%python_provide python3-%{srcname}-spinners}

 - Capitalize and add a dot at the end of description:

package which contains requires for spinners in vistir

 - Bump to 0.4.3

Comment 26 Miro Hrončok 2019-07-11 22:14:36 UTC
spinners is a metapackage.

Comment 28 Zbigniew Jędrzejewski-Szmek 2019-07-17 14:39:00 UTC
> Anyway the metapackage is not necessary so if you think is more confusing than helpfull, I'll change it.

What is the goal of this metapackage? Why not just use Recommends: ?

Comment 29 Robert-André Mauchin 🐧 2019-07-17 17:18:43 UTC
I don't get why you need a metapackage only to depend on python3-yaspin, as Zbigniew said, a Recommends zould do the same thing.

Comment 30 Patrik Kopkan 2019-07-17 17:27:25 UTC
It give to user info that there is some not strictly required dependency for spinners in vistir. I find that more saying than yaspin. I copied idea from setup.cfg https://github.com/sarugaku/vistir/blob/798a4ecbb528cd160e0d8f8322098c45542ce06c/setup.cfg#L48

It is just little detail on which I don't care much.

Comment 31 Zbigniew Jędrzejewski-Szmek 2019-07-17 20:55:15 UTC
Then please drop that metapackage and add Recommends; python3-yaspin.

Comment 33 Zbigniew Jędrzejewski-Szmek 2019-07-18 15:51:18 UTC
Looks good now.

Three minor things:
- The version in the changelog entry should be adjusted to match
- The description text shouldn't be duplicated. Use the following:

%global _description %{expand:
Miscellaneous utilities for dealing with filesystems,
paths, projects, sub-processes, and more.}

%description %_description

...

%description -n python3-%{srcname} %_description

- Move BuildRequires to the top.

+ package name is OK
+ license is acceptable (ISC)
+ license is specified correctly
+ normal python spec file template is used...

Package is APPROVED.

Comment 34 Mohan Boddu 2019-07-19 14:09:06 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/python-vistir


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