Bug 1389695 - Review Request: python-wcsaxes - A Python framework for plotting astronomical and geospatial data
Summary: Review Request: python-wcsaxes - A Python framework for plotting astronomical...
Keywords:
Status: CLOSED DUPLICATE of bug 1395273
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nobody's working on this, feel free to take it
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-28 09:19 UTC by Sergio Pascual
Modified: 2016-11-21 12:06 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-18 09:41:35 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Sergio Pascual 2016-10-28 09:19:55 UTC
Spec URL: https://guaix.fis.ucm.es/~spr/fedora/python-wcsaxes.spec
SRPM URL: https://guaix.fis.ucm.es/~spr/fedora/python-wcsaxes-0.9-1.fc24.src.rpm
Description: WCSAxes is a framework for making plots of Astronomical data 
in Matplotlib.
Fedora Account System Username: sergiopr

Comment 1 Iryna Shcherbina 2016-11-08 11:19:27 UTC
Hi Sergio,

the spec file looks good, but I have a couple of suggestions you might consider:

* Please use the %{srcname} macro you have defined in the `SourceO` tag:

> Source0: https://pypi.io/packages/source/w/wcsaxes/wcsaxes-%{version}.tar.gz

change to

`Source0: https://pypi.io/packages/source/w/%{srcname}/%{srcname}-%{version}.tar.gz`


* To improve readability please use multiple lines for `BuildRequires` tag:

> BuildRequires: python2-devel python3-devel xorg-x11-server-Xvfb


* You can use macro %{summary}, which will contain content of the Summary tag (it's generated automatically, you do not have to define it). Just keep the first Summary tag as it is and in python2/3- subpackages you can use `Summary:   %{summary}`.


* It is better to avoid using wildcards in the %files section to have an idea what is installed with the package. Doing the following change would make it more safe (same for python3- subpackage):

> %{python2_sitelib}/*

change to

%{python2_sitelib}/%{srcname}
%{python2_sitelib}/%{srcname}-%{version}-py?.?.egg-info


* Due to the above, the following file gets to the generated RPMs. It is generated during tests and does not belong in the package:

/usr/lib/python3.5/site-packages/test.png
/usr/lib/python2.7/site-packages/test.png

----
Another issue is that I believe you are running tests in %{buildroot} to avoid the problem with pytest-mpl dependency (https://github.com/astrofrog/wcsaxes/commit/83fec6e82bbae751f0241da6933ae425c0e9664b#diff-8b1c3fd0d4a6765c16dfd18509182f9dR8) and ignore wcsaxes/setup.cfg settings. However, when installing the package and running tests with wcsaxes.test() (as it is stated in the documentation), I am running into multiple errors:

import file mismatch:
imported module 'wcsaxes.tests.test_coordinate_helpers' has this __file__ attribute:
  /builddir/build/BUILDROOT/python-wcsaxes-0.9-1.fc24.x86_64/usr/lib/python3.5/site-packages/wcsaxes/tests/test_coordinate_helpers.py
  which is not the same as the test file we want to collect:
    /usr/lib/python3.5/site-packages/wcsaxes/tests/test_coordinate_helpers.py
    HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules

That happens because running tests in the %{buildroot} generates files, e.g. /usr/lib/python3.5/site-packages/test.png (mentioned above).
Instead of changing the directory, try specifying another config when running tests (with a -c option) or ignoring it, to fix the above issues. Another option would be to clean up after tests.

Apart from a couple of small suggestions above, everything looks fine.
Note, that it is an informal package review, as I am not sponsored yet, but I can do a formal one once I am.

Comment 2 Sergio Pascual 2016-11-09 13:09:15 UTC
Thanks for the review Iryna, wcsaxes.test() definitively doesn't work with this spec file

Comment 3 Iryna Shcherbina 2016-11-15 16:58:45 UTC
Hi Sergio,

Is there still an interest in adding this package to Fedora?
Let me know if you need any help.

Comment 4 Sergio Pascual 2016-11-15 21:47:27 UTC
I'm considering to package pytest-mpl before this one

Comment 5 Iryna Shcherbina 2016-11-18 09:41:35 UTC
Hi Sergio, python-wcsaxes is already in Fedora.

*** This bug has been marked as a duplicate of bug 1395273 ***

Comment 6 Sergio Pascual 2016-11-21 12:06:13 UTC
Great, thank you for the review anyway


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