Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1757379 - Review Request: python-pynetdicom - A Python implementation of the DICOM networking protocol
Summary: Review Request: python-pynetdicom - A Python implementation of the DICOM netw...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Ankur Sinha (FranciscoD)
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: fedora-neuro
TreeView+ depends on / blocked
 
Reported: 2019-10-01 10:48 UTC by Alessio
Modified: 2019-10-28 09:58 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-28 09:58:09 UTC
Type: ---
Embargoed:
sanjay.ankur: fedora-review+


Attachments (Terms of Use)

Description Alessio 2019-10-01 10:48:03 UTC
Spec URL: https://alciregi.fedorapeople.org/pynetdicom/python-pynetdicom.spec
SRPM URL: https://alciregi.fedorapeople.org/pynetdicom/python-pynetdicom-1.4.1-1.fc31.src.rpm
Description: pynetdicom is a pure Python package that implements the DICOM
networking protocol. Working with pydicom, it allows the easy creation of 
DICOM Service Class Users (SCUs) and Service Class Providers (SCPs).
Fedora Account System Username: alciregi

Comment 1 Ankur Sinha (FranciscoD) 2019-10-01 16:13:42 UTC
Looks very good---a few issues to be worked out. Please see below.

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

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


Issues:
=======
- Large documentation must go in a -doc subpackage. Large could be size
  (~1MB) or number of files.
  Note: Documentation size is 27453440 bytes in 1115 files.
  See: https://docs.fedoraproject.org/en-US/packaging-
  guidelines/#_documentation


^
Better to move docs to a different sub-package so that users can download it if
they want to.  It looks like you are also packaging the sources of the
documentation. You don't need to include them. Only include the generated HTML
documentation.  These appear to be in docs/_build-3/html/, so %doc
docs/_build-3/html should do it.


- You don't need `git-core` or the `-S git` in `%autosetup`. They are only
  needed when you've included patches: https://rpm.org/user_doc/autosetup.html

- The `setup.py` file already mentions that `pydicom` is required, so it should
  get picked up by the automatic dependency generators. You should not need to
  specify it as Requires manually.
  https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_automatically_generated_dependencies

- Please run the tests or document why they have not been run (Will
  BuildRequires: python3-pytest)

- rpmlint shows that some shebangs need to be removed. Something like this
  should work:
  find . -type f -name "*.py" -exec sed -i '/^#![  ]*\/usr\/bin\/env.*$/ d' {} 2>/dev/null ';'

- Please remove the other hidden file shown by rpmlint also.

A few cosmetic suggestions---not necessary and depend on your personal taste:

- Cosmetic suggestion: you don't need to use pushd/popd to build docs. You can
  simply do `make -C docs ..`:
  https://pagure.io/neuro-sig/NeuroFedora/blob/master/f/spec-templates/python.spec#_57

- Cosmetic suggestion: may be worth defining a macro for the description so you
  don't need to repeat it:
  https://pagure.io/neuro-sig/NeuroFedora/blob/master/f/spec-templates/python.spec#_10

- Cosmetic suggestion: may be better to use standardised names for Requires
  etc:
  https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_requires_and_buildrequires_with_standardized_names

- Cosmetic suggestion: list the egg info separately in the file list as done
  here:
  https://pagure.io/neuro-sig/NeuroFedora/blob/master/f/spec-templates/python.spec#_71

  This is merely for clarity. Globbing is conveninent, but sometimes abstracts
  away too much information.

===== 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.
[x]: License field in the package spec file matches the actual license.
     Note: There is no build directory. Running licensecheck on vanilla
     upstream sources. No licenses found. Please check the source files for
     licenses manually.

Looks fine:

- setup.py says MIT and the LICENSE file is MIT:
https://fedoraproject.org/wiki/Licensing:MIT?rd=Licensing/MIT#Modern_Style_with_sublicense

- The pynetdicom/_version.py file says that some part of the code there is Apache and BSD.


[x]: Package does not own files or directories owned by other packages.
[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.
[!]: Requires correct, justified where necessary.
^
The `setup.py` file already mentions that `pydicom` is required, so it should
get picked up by the automatic dependency generators. You should not need to
specify it as Requires manually.


[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]: 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]: 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 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:
[-]: 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:
[-]: Uses parallel make %{?_smp_mflags} macro.
[!]: Avoid bundling fonts in non-fonts packages.
     Note: Package contains font files
^ Not in the source, so these seem to be added by sphinx-build. In that case,
this is OK.

[-]: If the source package does not include license text(s) as a separate
     file from upstream, the packager SHOULD query upstream to include it.
[ ]: Final provides and requires are sane (see attachments).
[?]: Package functions as described.
^
I've not checked this yet.

[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.
^
Please enable tests or document why they are not being run. (This is especially
important for research/scientific software where correctness is most important)

[x]: Packages should try to preserve timestamps of original installed
     files.
[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]: 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).
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: python3-pynetdicom-1.4.1-1.fc32.noarch.rpm
          python-pynetdicom-1.4.1-1.fc32.src.rpm
python3-pynetdicom.noarch: W: spelling-error %description -l en_US pydicom -> comedic
python3-pynetdicom.noarch: E: non-executable-script /usr/lib/python3.8/site-packages/pynetdicom/tests/benchmark_script.py 644 /usr/bin/env python
python3-pynetdicom.noarch: E: non-executable-script /usr/lib/python3.8/site-packages/pynetdicom/tests/test_dimse_c.py 644 /usr/bin/env python
python3-pynetdicom.noarch: E: non-executable-script /usr/lib/python3.8/site-packages/pynetdicom/tests/test_dimse_n.py 644 /usr/bin/env python
python3-pynetdicom.noarch: E: non-executable-script /usr/lib/python3.8/site-packages/pynetdicom/tests/test_dimse_provider.py 644 /usr/bin/env python
python3-pynetdicom.noarch: E: non-executable-script /usr/lib/python3.8/site-packages/pynetdicom/tests/test_dul.py 644 /usr/bin/env python
python3-pynetdicom.noarch: E: non-executable-script /usr/lib/python3.8/site-packages/pynetdicom/tests/test_pdu_items.py 644 /usr/bin/env python
python3-pynetdicom.noarch: E: non-executable-script /usr/lib/python3.8/site-packages/pynetdicom/tests/test_primitives.py 644 /usr/bin/env python
python3-pynetdicom.noarch: E: non-executable-script /usr/lib/python3.8/site-packages/pynetdicom/tests/test_status.py 644 /usr/bin/env python
python3-pynetdicom.noarch: W: hidden-file-or-dir /usr/share/doc/python3-pynetdicom/docs/_build-3/html/.nojekyll
python3-pynetdicom.noarch: E: zero-length /usr/share/doc/python3-pynetdicom/docs/_build-3/html/.nojekyll
python-pynetdicom.src: W: spelling-error %description -l en_US pydicom -> comedic
2 packages and 0 specfiles checked; 9 errors, 3 warnings.




Rpmlint (installed packages)
----------------------------
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "C.UTF-8",
	LANG = "en_GB.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "C.UTF-8",
	LANG = "en_GB.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
python3-pynetdicom.noarch: W: spelling-error %description -l en_US pydicom -> comedic
python3-pynetdicom.noarch: W: invalid-url URL: https://github.com/pydicom/pynetdicom <urlopen error [Errno -2] Name or service not known>
python3-pynetdicom.noarch: E: non-executable-script /usr/lib/python3.8/site-packages/pynetdicom/tests/benchmark_script.py 644 /usr/bin/env python
python3-pynetdicom.noarch: E: non-executable-script /usr/lib/python3.8/site-packages/pynetdicom/tests/test_dimse_c.py 644 /usr/bin/env python
python3-pynetdicom.noarch: E: non-executable-script /usr/lib/python3.8/site-packages/pynetdicom/tests/test_dimse_n.py 644 /usr/bin/env python
python3-pynetdicom.noarch: E: non-executable-script /usr/lib/python3.8/site-packages/pynetdicom/tests/test_dimse_provider.py 644 /usr/bin/env python
python3-pynetdicom.noarch: E: non-executable-script /usr/lib/python3.8/site-packages/pynetdicom/tests/test_dul.py 644 /usr/bin/env python
python3-pynetdicom.noarch: E: non-executable-script /usr/lib/python3.8/site-packages/pynetdicom/tests/test_pdu_items.py 644 /usr/bin/env python
python3-pynetdicom.noarch: E: non-executable-script /usr/lib/python3.8/site-packages/pynetdicom/tests/test_primitives.py 644 /usr/bin/env python
python3-pynetdicom.noarch: E: non-executable-script /usr/lib/python3.8/site-packages/pynetdicom/tests/test_status.py 644 /usr/bin/env python
python3-pynetdicom.noarch: W: hidden-file-or-dir /usr/share/doc/python3-pynetdicom/docs/_build-3/html/.nojekyll
python3-pynetdicom.noarch: E: zero-length /usr/share/doc/python3-pynetdicom/docs/_build-3/html/.nojekyll
1 packages and 0 specfiles checked; 9 errors, 3 warnings.



Source checksums
----------------
https://github.com/pydicom/pynetdicom/archive/v1.4.1/pynetdicom-1.4.1.tar.gz :
  CHECKSUM(SHA256) this package     : f977f650e95ccb52dd9fbf1d012123e74c3391c09f8081da074b2a4c99fda8ab
  CHECKSUM(SHA256) upstream package : f977f650e95ccb52dd9fbf1d012123e74c3391c09f8081da074b2a4c99fda8ab


Requires
--------
python3-pynetdicom (rpmlib, GLIBC filtered):
    python(abi)
    python3-pydicom
    python3.8dist(pydicom)



Provides
--------
python3-pynetdicom:
    python-pynetdicom
    python3-pynetdicom
    python3.8dist(pynetdicom)
    python3dist(pynetdicom)



Generated by fedora-review 0.7.3 (44b83c7) last change: 2019-09-18
Command line :/usr/bin/fedora-review -b 1757379
Buildroot used: fedora-rawhide-{{ target_arch }}
Active plugins: Generic, Shell-api, Python
Disabled plugins: fonts, SugarActivity, C/C++, Ocaml, Haskell, Perl, PHP, Java, R
Disabled flags: EPEL6, EPEL7, DISTTAG, BATCH, EXARCH

Comment 2 Alessio 2019-10-02 09:34:23 UTC
Thank you for the review.

What if enabling tests, some of them fail?

Comment 3 Ankur Sinha (FranciscoD) 2019-10-02 10:17:33 UTC
Most test managers (nose/pytest) allow you to disable individual tests. So the failing tests can be temporarily disabled. These should be reported upstream, and a comment added in the spec to explain why they are disabled and a link to the upstream issue.

It also depends on why the tests fail, though. For imaging libraries, tests often try to fetch data from the internet and so fail (since koji does not have internet access). In this case, one can run the build in mock enabling network to confirm that the tests pass, and then disable them in the committed spec. You can use macros for conditional builds to make this easier: https://rpm.org/user_doc/conditional_builds.html

We've made this note in the spec template here: https://pagure.io/neuro-sig/NeuroFedora/blob/master/f/spec-templates/python.spec#_2

Comment 4 Alessio 2019-10-02 13:34:37 UTC
(In reply to Ankur Sinha (FranciscoD) from comment #1)
> [x]: License field in the package spec file matches the actual license.
> ...
> - setup.py says MIT and the LICENSE file is MIT:
> ...
> - The pynetdicom/_version.py file says that some part of the code there is
> Apache and BSD.

So, what is the right license?
License:        MIT and ASL 2.0 and BSD

Comment 5 Alessio 2019-10-02 14:41:30 UTC
Another question.
Is it better to use the source stuff from pupi or from github?
As far as I can see, pypi stuff doesn't contain docs.

Comment 6 Ankur Sinha (FranciscoD) 2019-10-02 15:23:08 UTC
(In reply to Alessio from comment #4)
> (In reply to Ankur Sinha (FranciscoD) from comment #1)
> > [x]: License field in the package spec file matches the actual license.
> > ...
> > - setup.py says MIT and the LICENSE file is MIT:
> > ...
> > - The pynetdicom/_version.py file says that some part of the code there is
> > Apache and BSD.
> 
> So, what is the right license?
> License:        MIT and ASL 2.0 and BSD

No, MIT should be enough. The comment merely states that they've picked code from projects that are ASL and BSD---the file itself is not ASL/BSD. You could/should e-mail the -devel list to confirm :)



(In reply to Alessio from comment #5)
> Another question.
> Is it better to use the source stuff from pupi or from github?
> As far as I can see, pypi stuff doesn't contain docs.

This is up to you and doesn't usually make too much of a difference. Using pypi is easier, you can then use the %pypi_source macro, for example. Mostly, upstream does not include docs in the pypi tar, though. Quite a few don't even include tests in the pypi tar. So, in such scenarios, using the Github tar is the only way.

Comment 7 Alessio 2019-10-03 15:15:12 UTC
Ok. Enabling tests (%check), there are two of them that fail. Upstream is aware of that.

So I disabled them for now.

%check
# test_tls_yes_server_yes_client and test_tls_transfer are disabled. Upstream is investigating.
# https://github.com/pydicom/pynetdicom/issues/406 and https://github.com/pydicom/pynetdicom/issues/364
# test_associate_max_pdu disabled, it doesnt work in podman or vagrant vm, it works on bare metal, need investigation
%{__python3} -m pytest -k "not test_tls_yes_server_yes_client and not test_tls_transfer and not test_associate_max_pdu"

Comment 8 Alessio 2019-10-03 17:05:21 UTC
You can find the new SPEC file and the new SRPM here
https://alciregi.fedorapeople.org/pynetdicom/

This is the koji build: https://koji.fedoraproject.org/koji/taskinfo?taskID=38022921

Comment 9 Ankur Sinha (FranciscoD) 2019-10-11 09:47:16 UTC
Looking at this now. For future reference, please paste the complete URLs to the spec/srpm like you did in the initial comment. Only then can fedora-review pick them up.

Comment 10 Ankur Sinha (FranciscoD) 2019-10-11 09:51:13 UTC
Looks good XXX APPROVED XXX

Please proceed with requesting SCM repos:
Step 7 here: https://fedoraproject.org/wiki/New_package_process_for_existing_contributors

Please remember to give the "neuro-sig" commit access to the repo too.

Cheers,
Ankur

Comment 11 Gwyn Ciesla 2019-10-11 13:37:21 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/python-pynetdicom

Comment 12 Ankur Sinha (FranciscoD) 2019-10-28 09:58:09 UTC
This package is now available. Alessio, please mention the review ticket in the bodhi update---that way the bug gets updated by bodhi, and closed when the packages hit stable too.


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