#3 Fix incorrect splitting of Python files into subpackages.
Merged 5 years ago by lholecek. Opened 5 years ago by qulogic.
rpms/ qulogic/waiverdb master  into  master

file modified
+15 -4
@@ -10,7 +10,7 @@ 

  

  Name:           waiverdb

  Version:        0.13.0

- Release:        1%{?dist}

+ Release:        2%{?dist}

  Summary:        Service for waiving results in ResultsDB

  License:        GPLv2+

  URL:            https://pagure.io/waiverdb
@@ -152,7 +152,10 @@ 

  %if %{with server}

  %files

  %{python3_sitelib}/%{name}

- %{python3_sitelib}/%{name}*.egg-info

+ %exclude %{python3_sitelib}/%{name}/__init__.py

+ %exclude %{python3_sitelib}/%{name}/__pycache__/__init__.*pyc

+ %exclude %{python3_sitelib}/%{name}/cli.py

+ %exclude %{python3_sitelib}/%{name}/__pycache__/cli.*.pyc

  %attr(755,root,root) %{_bindir}/waiverdb

  %endif

  
@@ -161,9 +164,13 @@ 

  %doc README.md conf

  %if 0%{?fedora} || 0%{?rhel} > 7

  %doc docs/_build/html docs/_build/text

- %{python3_sitelib}/%{name}/__init__.py*

+ %dir %{python3_sitelib}/%{name}

+ %dir %{python3_sitelib}/%{name}/__pycache__

+ %{python3_sitelib}/%{name}/__init__.py

+ %{python3_sitelib}/%{name}/__pycache__/__init__.*pyc

  %{python3_sitelib}/%{name}*.egg-info

  %else

+ %dir %{python2_sitelib}/%{name}

  %{python2_sitelib}/%{name}/__init__.py*

  %{python2_sitelib}/%{name}*.egg-info

  %endif
@@ -171,7 +178,8 @@ 

  %files cli

  %license COPYING

  %if 0%{?fedora} || 0%{?rhel} > 7

- %{python3_sitelib}/%{name}/cli.py*

+ %{python3_sitelib}/%{name}/cli.py

+ %{python3_sitelib}/%{name}/__pycache__/cli.*.pyc

  %else

  %{python2_sitelib}/%{name}/cli.py*

  %endif
@@ -185,6 +193,9 @@ 

  %endif

  

  %changelog

+ * Sun Jan 27 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.13.0-2

+ - Fix incorrect splitting of Python files into subpackages

+ 

  * Mon Jan 14 2019 Matt Prahl <mprahl@redhat.com> - 0.13.0-1

  - Stop validating subject types against a hard-coded list. Since Greenwave

    now supports arbitrary subject types, this list of valid subject types

Since the -common subpackage installs files in %{python3_sitelib}/%{name}, it should also own that directory instead of the main package. Also, exclude files that are in subpackages from the main package. Finally, byte-compiled files were not specified correctly for Python 3. This was hidden in the main package glob, instead of being in the subpackages.

@gnaponie, @lucarval, @mprahl Can you help review this?

Found relevant section in packaging docs but still unsure whether the paths are correct.

BTW, it doesn't like Python 2 is supported for waiverdb anymore -- it was removed from upstream tox.ini so I guess it's untested.

Looks good in general, but yes - since the py2 support is dropped upstream we should just simplify this and remove the python2 subpackaging (and the common subpackage) entirely.

Furthermore, the "true" specfile lives upstream. We should modify it there and copy it downstream here. https://pagure.io/waiverdb/blob/master/f/waiverdb.spec

I recommend closing this PR. Thanks for submitting it @qulogic!

Oh! Correction - we need to maintain py2 support in the specfile for people who use waiverdb-cli on epel7. My mistake.

I'd be in favor of accepting @qulogic's proposal here, but we should do it upstream first and then copy it here.

+1 I'm OK to merge this PR and then merge and resolve any conflicts upstream ourselves.

Ah, OK, you're too fast Ralph. :) +1 to everything.

FYI, I've already verified that the produced RPMs correctly install and uninstall. This was the main reason for the PR (installing and uninstalling waiverdb-cli leaves behind a directory that it didn't own).

Pull-Request has been merged by lholecek

5 years ago