Bug 1525570 - Review Request: pew - Tool to manage multiple virtualenvs written in pure python
Summary: Review Request: pew - Tool to manage multiple virtualenvs written in pure python
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1385244 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-12-13 15:23 UTC by Michal Cyprian
Modified: 2018-02-05 16:13 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2018-02-05 16:13:17 UTC
Type: ---
Embargoed:
mhroncok: fedora-review+


Attachments (Terms of Use)

Description Michal Cyprian 2017-12-13 15:23:14 UTC
Spec URL: https://mcyprian.fedorapeople.org/python-pew.spec
SRPM URL: https://mcyprian.fedorapeople.org/python-pew-1.1.1-1.fc27.src.rpm

Description:
Python Env Wrapper is a set of commands to manage multiple [virtual environments]. Pew can create, delete and copy your environments, using a 
single command to switch to them wherever you are, while keeping them in a
single (configurable) location.

This is a dependency of Pipenv — the officially recommended Python packaging tool from Python.org.

Fedora Account System Username: mcyprian

Successful build in Copr: https://copr.fedorainfracloud.org/coprs/mcyprian/pipenv/builds/

Comment 1 Robert-André Mauchin 🐧 2017-12-13 17:47:50 UTC
 - Source0 is 404 because you made a typo. Also use a more meaningful name for your archive, with:

Source0:        https://github.com/berdario/%{pypi_name}/archive/%{version}/%{name}-%{version}.tar.gz

 - Add a comment explaining what's the patch for or link to a bug report

 - This:

export PYTHONPATH=$PYTHONPATH:%{buildroot}/usr/lib/python%{python3_version}/site-packages

   should probably be:

export PYTHONPATH=$PYTHONPATH:%{buildroot}/%{python3_sitelib}

 - Remove the shebang:

python3-pew.noarch: E: wrong-script-interpreter /usr/lib/python3.6/site-packages/pew/shell_config/complete_deploy /usr/bin/env python


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

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


===== 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: Checking patched sources after %prep for licenses. Licenses
     found: "*No copyright* MIT/X11 (BSD like)", "Unknown or generated". 49
     files have unknown license. Detailed output of licensecheck in
     /home/bob/packaging/review/python-pew/review-python-
     pew/licensecheck.txt
[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]: 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 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 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]: Binary eggs must be removed in %prep

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

Generic:
[-]: 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).
[?]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[!]: 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.
[x]: 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]: 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-pew-1.1.1-1.fc28.noarch.rpm
          python-pew-1.1.1-1.fc28.src.rpm
python3-pew.noarch: W: spelling-error Summary(en_US) virtualenvs -> virtual
python3-pew.noarch: E: wrong-script-interpreter /usr/lib/python3.6/site-packages/pew/shell_config/complete_deploy /usr/bin/env python
python3-pew.noarch: W: no-manual-page-for-binary pew
python-pew.src: W: spelling-error Summary(en_US) virtualenvs -> virtual
python-pew.src:57: E: hardcoded-library-path in %{buildroot}/usr/lib/python%{python3_version}/site-packages
2 packages and 0 specfiles checked; 2 errors, 3 warnings.

Comment 2 Felix Schwarz 2017-12-14 22:02:16 UTC
seems like bug 1385244 is a review request for the same package?

Comment 3 Miro Hrončok 2017-12-15 17:10:07 UTC
(This happened to me as well sometimes, please don't forget to check next time Michal.)

What I see:

 * Michal's package is newer version, runs tests, has LICENSE file.

 * Mathieu's package has better name for an app, doesn't do the not necessary subpackages dance. (But it IMO wrongly provides python-pew and doesn't use prescribed python_provide macro).

I suggest the best way would be to merge what's better in both and make both Michal and Mathieu the maintainers (possibly with Python SIG). Would that work for both of you?

Comment 4 Michal Cyprian 2017-12-18 22:11:54 UTC
Being a co-maintainer definitely works for me. I would like to have this package in Fedora soon to be able to proceed to packaging of Pipenv. I have fixed issues listed in the review, rebased spec file to version 1.1.2 and added installation of shell completion scripts:

Spec URL: https://mcyprian.fedorapeople.org/python-pew.spec
SRPM URL: https://mcyprian.fedorapeople.org/python-pew-1.1.1-1.fc27.src.rpm

Comment 5 Mathieu Bridon 2017-12-19 08:09:47 UTC
As Miro said, please try harder to find if someone had already sent a review request. We probably would already have pew in Fedora had you just reviewed mine. (I submitted it more than a year ago!) I recommend this URL if you don't know it:

  https://fedoraproject.org/PackageReviewStatus/

---

Now, to be honest, I'm happy to leave the package to someone else. I don't actually love packaging things (I've done too much of it I guess), I only do it when I need it.

So if you want to maintain pew, please have at it. :) And I'm also happy to give you its dependencies, since I don't care about them outside of needing them for pew:

  https://bugzilla.redhat.com/showdependencytree.cgi?id=1385244&hide_resolved=0

---

If I may though, the way you split the *-completion packages is just unnecessarily annoying for users. Those files are fine to put in the main package, it provides a much better UX to have them installed with pew.

In addition, those completion files aren't enough to make things work. You also need to source /usr/lib/pythonX.Y/site-packages/pew/shell_config/init.$SHELL.

But that file tries to source the completion file, so the latter ends up being sourced twice, which could lead to all sorts of undesired behaviours.

I've talked about it with upstream there:

  https://github.com/berdario/pew/issues/142

(you'd have found that issue had you searched for the existing review request ;) )

My conclusion was that it's just easier to leave those files as they are, and rely on the upstream mechanism when launching pew for the first time. (it asks whether you want to source the appropriate file in your shell rc file)

If you really want to install the completion files in the right places, then this would need some upstream work to drop init.$SHELL.

You probably want to also `rm pew/shell_config/complete_deploy` in your %prep to fix the rpmlint issue (that script is completely unnecessary in the context of an RPM, see issue 142 upstream)

I really think this should be named `pew`, not `python3-pew`, because this is primarily a cli application rather than a Python module. At the very least, if you want to stay with the `python3-pew` name, please make it provide `pew` to make it easier to install.

Finally, what's up with bcond_without for the tests? Sure, I forgot to add the tests in my spec, it's great you added them. :) But what's the point of conditionally running them? That's not even possible in mock/Koji anyway.

Comment 6 Michal Cyprian 2017-12-19 13:56:58 UTC
Thanks for sharing your experience with completion scripts Mathieu. I have renamed package to pew and got rid of completion subpackages. 

I want to keep condition to skip test suite. It takes quite a long time to run pew's tests and I sometimes find it useful to disable it temporarily. The official builds will of course always run the tests.

Updated files are here:
Spec URL: https://mcyprian.fedorapeople.org/pew.spec
SRPM URL: https://mcyprian.fedorapeople.org/pew-1.1.2-1.fc27.src.rpm

Comment 7 Petr Viktorin (pviktori) 2017-12-19 14:26:36 UTC
> Finally, what's up with bcond_without for the tests? Sure, I forgot to add the
> tests in my spec, it's great you added them. :) But what's the point of
> conditionally running them? That's not even possible in mock/Koji anyway.

In mock it is! Both `mock` and recent versions of `fedpkg mockbuild` have --with and --without options.

Comment 8 Mathieu Bridon 2017-12-19 14:35:50 UTC
@Michal: If you keep the with_check condition, you probably want to conditionalize this BR then, afaik it's only needed at runtime and for the tests:

BuildRequires:  python3dist(pythonz-bd) >= 1.10.2

The setup.py script has an explicit requirement on "virtualenv >= 1.11". Maybe add it explicitly as a BR/R? (it gets dragged in implicitly by virtualenv-clone with your spec file)

Other than that, it's so close to the spec I had submitted that I'll let Miro finish the review he started. :)

Do you want python-rangehttpserver, python-pythonz-bd and python-resumable-urlretrieve? I really only added them for Pew, I don't particularly care about them, so I'd be happier if they had a more interested maintainer.

Comment 9 Petr Viktorin (pviktori) 2017-12-19 16:00:18 UTC
> @Michal: If you keep the with_check condition, you probably want to conditionalize this BR

When skipping tests in mock you'd probably also use --no-clean, so the extra BuildRequire doesn't hurt. (And, no need to make the spec more complex for what's just there for maintainers' convenience.)

> Do you want python-rangehttpserver, python-pythonz-bd and python-resumable-urlretrieve?

Please take them, Michal; it's only fair :)

Comment 10 Miro Hrončok 2017-12-19 16:18:56 UTC
> > Do you want python-rangehttpserver, python-pythonz-bd and python-resumable-urlretrieve?
> 
> Please take them, Michal; it's only fair :)


Also, I think Python SIG might be interested in co-maintaining those packages.

Thanks Mathieu for all the info, I'll go ahead with the review soon.(In reply to

Comment 11 Miro Hrončok 2017-12-19 16:19:19 UTC
*** Bug 1385244 has been marked as a duplicate of this bug. ***

Comment 12 Michal Cyprian 2017-12-20 11:53:32 UTC
Alright Mathieu I will take those packages.

Comment 13 Miro Hrončok 2018-01-18 12:40:35 UTC
> Tool to manage multiple virtualenvs written in pure python

Please use uppercase P for Python.


> # Add pytest marker to test requiring connection
> Patch0:         0001-tests-connection-marker-fix.patch

Is this posted upstream?



Package is APPROVED.


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

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



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

Generic:
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
     https://koji.fedoraproject.org/koji/taskinfo?taskID=24266546
[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]: 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]: 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 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 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]: Binary eggs must be removed in %prep

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

Generic:
[x]: Reviewer should test that the package builds in mock. (I've checked Koji, had some local troubles)
[-]: 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).
[?]: Package functions as described.
[?]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[ ]: Patches link to upstream bugs/comments/lists or are otherwise
     justified. Unsure here.
[-]: 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.
[?]: 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:
[!]: Spec file according to URL is the same as in SRPM.
     Note: Spec file as given by url is not the same as in SRPM (see
     attached diff).
     See: (this test has no URL)
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).


Rpmlint
-------
Checking: pew-1.1.2-1.fc28.noarch.rpm
          pew-1.1.2-1.fc27.src.rpm
pew.noarch: W: spelling-error Summary(en_US) virtualenvs -> virtual
pew.noarch: W: no-manual-page-for-binary pew
pew.src: W: spelling-error Summary(en_US) virtualenvs -> virtual
2 packages and 0 specfiles checked; 0 errors, 3 warnings.

Bogus.


Rpmlint (installed packages)
----------------------------
sh: /usr/bin/python: No such file or directory
pew.noarch: W: spelling-error Summary(en_US) virtualenvs -> virtual
pew.noarch: W: invalid-url URL: https://github.com/berdario/pew <urlopen error [Errno -2] Name or service not known>
pew.noarch: W: no-manual-page-for-binary pew
1 packages and 0 specfiles checked; 0 errors, 3 warnings.

Bogus. Manpage maybe, but nobody cares.


Diff spec file in url and in SRPM
---------------------------------
--- /home/churchyard/rpmbuild/FedoraReview/pew/pew.spec	2018-01-18 12:36:02.445037000 +0100
+++ /home/churchyard/rpmbuild/FedoraReview/pew/review-pew/srpm-unpacked/pew.spec	2017-12-20 12:48:53.000000000 +0100
@@ -26,8 +26,8 @@
 
 %{?python_provide:%python_provide python3-%{name}}
+Requires:       python3dist(pythonz-bd) >= 1.10.2
 Requires:       python3dist(setuptools) >= 17.1
 Requires:       python3dist(virtualenv) >= 1.11
 Requires:       python3dist(virtualenv-clone) >= 0.2.5
-Requires:       python3dist(pythonz-bd) >= 1.10.2
 
 %description


Not bad. Whatever order you prefer.

Requires
--------
pew (rpmlib, GLIBC filtered):
    /usr/bin/python3
    python(abi) = 3.6
    python3dist(pythonz-bd) >= 1.10.2
    python3dist(setuptools) >= 17.1
    python3dist(virtualenv) >= 1.11
    python3dist(virtualenv-clone) >= 0.2.5




Provides
--------
pew:
    pew = 1.1.2-1.fc28
    python3.6dist(pew) = 1.1.2
    python3dist(pew) = 1.1.2



Source checksums
----------------
https://github.com/berdario/pew/archive/1.1.2/pew-1.1.2.tar.gz :
  CHECKSUM(SHA256) this package     : 5e8c14523b81e37a0a856103705cdbdd8592656018baa2a4b69f8cfdfc738d42
  CHECKSUM(SHA256) upstream package : 5e8c14523b81e37a0a856103705cdbdd8592656018baa2a4b69f8cfdfc738d42

Comment 14 Gwyn Ciesla 2018-01-23 16:12:18 UTC
(fedrepo-req-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/pew. You may commit to the branch "f28" in about 10 minutes.

Comment 15 Fedora Update System 2018-01-25 09:56:46 UTC
pew-1.1.2-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-5ecbcbff22

Comment 16 Fedora Update System 2018-01-26 19:49:05 UTC
pew-1.1.2-1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-5ecbcbff22

Comment 17 Mathieu Bridon 2018-01-28 10:31:08 UTC
> Alright Mathieu I will take those packages.

I just made you admin for those 3 packages.

Somehow I can't find how to remove myself, though. :-/

>> Please take them, Michal; it's only fair :)
> 
> Also, I think Python SIG might be interested in co-maintaining those packages.

The Python SIG already had commit permissions on all 3 packages.

Comment 18 Mathieu Bridon 2018-01-28 12:14:50 UTC
>> Alright Mathieu I will take those packages.
> 
> I just made you admin for those 3 packages.
> 
> Somehow I can't find how to remove myself, though. :-/

And I just found it, thanks to Pierre-Yves.

They are all yours now, take good care of them. :)

Comment 19 Fedora Update System 2018-02-05 16:13:17 UTC
pew-1.1.2-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.


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