Bug 1241944 - Review Request: python-importmagic - Python library to auto-magically add, remove and manage imports
Summary: Review Request: python-importmagic - Python library to auto-magically add, re...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: William Moreno
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-10 13:13 UTC by Jonathan Underwood
Modified: 2015-07-30 01:13 UTC (History)
3 users (show)

Fixed In Version: python-importmagic-0.1.3-3.fc21
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-07-30 00:50:58 UTC
Type: ---
Embargoed:
williamjmorenor: fedora-review+
gwync: fedora-cvs+


Attachments (Terms of Use)

Description Jonathan Underwood 2015-07-10 13:13:50 UTC
Spec URL: https://jgu.fedorapeople.org/python-importmagic.spec
SRPM URL: https://jgu.fedorapeople.org/python-importmagic-0.1.3-1.fc22.src.rpm
Description: The goal of this package is to be able to automatically manage imports in Python. To that end it can:

o Build an index of all known symbols in all packages.

o Find unresolved references in source, and resolve them against the
  index, effectively automating imports.

o Automatically arrange imports according to PEP8.

It was originally written for the Sublime Text 2 Python Import Magic
plugin.

Fedora Account System Username: jgu

Comment 1 Marcin Haba 2015-07-11 18:17:32 UTC
Hello,

During build your package I received following traceback:

/usr/bin/python2 setup.py build
Traceback (most recent call last):
  File "setup.py", line 2, in <module>
    from setuptools import Command, find_packages, setup
ImportError: No module named setuptools


It looks that you need to define in Spec file as build requires python-setuptools package.

Comment 2 Jonathan Underwood 2015-07-11 21:47:08 UTC
Spec URL: https://jgu.fedorapeople.org/python-importmagic.spec
SRPM URL: https://jgu.fedorapeople.org/python-importmagic-0.1.3-2.fc22.src.rpm

* Sat Jul 11 2015 Jonathan Underwood <jonathan.underwood> - 0.1.3-2
- Add BuildRequires for python-setuptools and python3-setuptools

Comment 3 William Moreno 2015-07-12 02:51:35 UTC
Please check this rpmlint message:

python-importmagic.src:33: W: mixed-use-of-spaces-and-tabs (spaces: line 33, tab: line 17)

Also will be good if you use the full link to upstream website, this way it is easyier to visit upstream website with only copying the provided link.

This package build fine in all soported releases:

https://copr.fedoraproject.org/coprs/williamjmorenor/ERPNext/monitor/

Comment 4 William Moreno 2015-07-12 03:06:23 UTC
Here is a typo:

%if %{with python3}
pushd python3
%{__python2} setup.py test
popd
%endif

You are testing with Python2 the Python3 build

Comment 5 Marcin Haba 2015-07-12 03:33:56 UTC
Hello,

It is unofficial review because I am not packages maintainer.

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

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

===== 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.
[-]: 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: "MIT/X11 (BSD like)", "Unknown or generated". 22 files have
     unknown license. Detailed output of licensecheck in /home/gani/1241944
     -python-importmagic/licensecheck.txt
[-]: License file installed when any subpackage combination is installed.
[!]: 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.
[x]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 20480 bytes in 4 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]: 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]: All build dependencies are listed in BuildRequires, except for any
     that are listed in the exceptions section of Packaging Guidelines.
[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:
[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.
[ ]: Package meets the Packaging Guidelines::Python
[x]: Package contains BR: python2-devel or python3-devel
[x]: Binary eggs must be removed in %prep

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

Generic:
[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.
     Note: No Requires: %{name}%{?_isa} = %{version}-%{release} in
     python3-importmagic
[x]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[-]: 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]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Sources can be downloaded from URI in Source: tag
[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]: 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.


Additional information:

1) It is nice that you encourage upstream to include LICENSE file (I saw your note in GitHub importmagic project).

2) Your package contains six.py file which is also provided by python-six Fedora package.

# dnf search python-six
python-six.noarch : Python 2 and 3 compatibility utilities

From this reason I marked:
[!]: Package contains no bundled libraries without FPC exception.

Please replace this six.py file by not including it in RPM package and add following requirement definition in Spec:

Requires: python-six

BTW: I do not know why fedora-review marked below field as valid:

[x]: Package does not own files or directories owned by other packages.

I leave this point as is below and when I confirm that it is bug then I report the bug to fedora-review package.

3) I did not mark field:

[ ]: Package complies to the Packaging Guidelines
[ ]: Package meets the Packaging Guidelines::Python

because I am still learning these guidlines, so I am not 100% sure.

Thanks for this feature request. I believe that Python users will appreciate your input in importmagic package process.

Comment 6 Marcin Haba 2015-07-12 04:23:41 UTC
About automatically marked point:

[x]: Package does not own files or directories owned by other packages.

I found in fedora-review's generic plugin class description:

"Packages must not own files or directories already owned by
other packages.  The rule of thumb here is that the first package
to be installed should own the files or directories that other
packages may rely upon.  This means, for example, that no package
in Fedora should ever share ownership with any of the files or
directories owned by the filesystem or man package."

So, it is not a bug, but it is my misunderstanding this point meaning.

Comment 7 Jonathan Underwood 2015-07-12 09:47:08 UTC
Spec URL: https://jgu.fedorapeople.org/python-importmagic.spec
SRPM URL: https://jgu.fedorapeople.org/python-importmagic-0.1.3-3.fc22.src.rpm


* Sun Jul 12 2015 Jonathan Underwood <jonathan.underwood> - 0.1.3-3
- Fix typo in %%check
- Remove macro from URL
- Unbundle python-six files
- Require and BuildRequire (for %%check) python[3]-six
- Remove tabs from spec file

Comment 8 Jonathan Underwood 2015-07-12 09:50:17 UTC
@Marcin - good catch on the six.py bundling, and thanks for the informal review, very helpful.

@William Thanks for the %%check catch, good eyes! I've changed the URL to not use the macro. However, please do note that's not required by any packaging guidelines, and using macros in the URL is a very common thing in packages. I don't have strong feelings either way so was happy with changing it, but you might meet push-back from other package maintainers if you raise that in other reviews.

Comment 9 Marcin Haba 2015-07-12 10:47:08 UTC
Thanks for kind words and Spec update.

I checked your latest package 0.1.3-3. RPMs packages install well and work for me, at least in interactive python and python.3.4 mode the module imports successfully. It is basic check only, not QA phase.

I also have seen you request to upstream about using python-six from outside importmagic project.

Comment 10 Jonathan Underwood 2015-07-12 11:42:15 UTC
(In reply to Marcin Haba from comment #9)
> Thanks for kind words and Spec update.
> 
> I checked your latest package 0.1.3-3. RPMs packages install well and work
> for me, at least in interactive python and python.3.4 mode the module
> imports successfully. It is basic check only, not QA phase.
> 


Yup, thanks for that. Note also that during package building upstream's test harness is ran for both py2 and py3 in %check, and that passes all tests. Of course the test suite may not have 100% coverage, but it's a good sign.

> I also have seen you request to upstream about using python-six from outside
> importmagic project.

Yup. I wonder how many other existing fedora packages have a bundled six.py ... it'd be interesting to spin up a virtual machine and install python* and then use find to locate any instances of six.py.

Comment 11 William Moreno 2015-07-12 21:31:13 UTC
Thanks @Marcin great job in the review, I have not aditional comments to the spec, very nice tool this to be included in Fedora and EPEL @Jonathan.

=================
PACKAGE APPROVED
=================

Comment 12 Jonathan Underwood 2015-07-13 09:52:02 UTC
Great, thanks toy you both for the reviews and works you put into this, much appreciated.

Comment 13 Jonathan Underwood 2015-07-13 09:53:54 UTC
New Package SCM Request
=======================
Package Name: python-importmagic
Short Description: Python library to auto-magically add, remove and manage imports
Upstream URL: http://github.com/alecthomas/importmagic
Owners: jgu
Branches: f21 f22
InitialCC:

Comment 14 Jonathan Underwood 2015-07-14 10:58:33 UTC
New Package SCM Request
=======================
Package Name: python-importmagic
Short Description: Python library to auto-magically add, remove and manage imports
Upstream URL: http://github.com/alecthomas/importmagic
Owners: jgu
Branches: f21 f22 f23
InitialCC:

Comment 15 Gwyn Ciesla 2015-07-15 17:40:44 UTC
Git done (by process-git-requests).

Comment 16 Fedora Update System 2015-07-15 20:04:43 UTC
python-importmagic-0.1.3-3.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/python-importmagic-0.1.3-3.fc21

Comment 17 Fedora Update System 2015-07-15 20:05:37 UTC
python-importmagic-0.1.3-3.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/python-importmagic-0.1.3-3.fc22

Comment 18 Fedora Update System 2015-07-18 02:02:52 UTC
python-importmagic-0.1.3-3.fc22 has been pushed to the Fedora 22 testing repository.

Comment 19 Fedora Update System 2015-07-30 00:50:58 UTC
python-importmagic-0.1.3-3.fc22 has been pushed to the Fedora 22 stable repository.

Comment 20 Fedora Update System 2015-07-30 01:13:55 UTC
python-importmagic-0.1.3-3.fc21 has been pushed to the Fedora 21 stable repository.


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