Bug 227894 - mail/py-afew: support both Python 2 and 3
Summary: mail/py-afew: support both Python 2 and 3
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Po-Chuan Hsieh
URL:
Keywords:
Depends on: 227893
Blocks:
  Show dependency treegraph
 
Reported: 2018-05-01 11:13 UTC by Sebastian Schwarz
Modified: 2018-07-26 22:44 UTC (History)
1 user (show)

See Also:
seschwar: maintainer-feedback+


Attachments
py-afew-1.3.0_1.diff (572 bytes, patch)
2018-05-01 11:13 UTC, Sebastian Schwarz
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Schwarz 2018-05-01 11:13:36 UTC
Created attachment 192963 [details]
py-afew-1.3.0_1.diff

Once bug #227893 is addressed mail/py-afew can be built for both Python 2 and 3 as well.
Comment 1 Po-Chuan Hsieh freebsd_committer freebsd_triage 2018-05-01 15:34:14 UTC
This port installs ${PREFIX}/bin/afew. You probably want to add USE_PYTHON=concurrent to allow coexistence of py27 and py36 flavors.
Comment 2 Sebastian Schwarz 2018-05-01 16:57:13 UTC
Is there actually a use case for installing both flavors of the port at the same time? 

afew is an application not a library.  From the user's perspective it shouldn't make much of a difference in which version of a programming language the application is implemented in.  They can just pick the one which matches the rest of their system well.  For example sysutils/py-ranger (a file manager) doesn't have USE_PYTHON=concurrent either.

mail/py-afew is intended to be run from a hook of mail/notmuch or from a cronjob to automatically tag incoming e-mail.  USE_PYTHON=concurrent would change the name of the executable and therefore break users' setups without them noticing immediately.  As I don't see any advantages of USE_PYTHON=concurrent (you may convince me otherwise) I'd rather avoid that scenario.
Comment 3 Po-Chuan Hsieh freebsd_committer freebsd_triage 2018-05-01 18:15:03 UTC
USE_PYTHON=concurrent is used to solve the conflicting file(s) from different flavors.
Since afew is an application, it's fine to keep "USE_PYTHON=noflavors".
Comment 4 Sebastian Schwarz 2018-05-01 18:39:59 UTC
> USE_PYTHON=concurrent is used to solve the conflicting file(s) from different flavors.

I know.  But the conflict is not a problem.  The user just needs to make a decision which one they want to install.  They don't need both.

> Since afew is an application, it's fine to keep "USE_PYTHON=noflavors".

Python 2's end of life is not too far off.  I would like mail/py-afew to be available for Python 3 as well.  So we don't have to convert all Python ports at the last minute.
Comment 5 Po-Chuan Hsieh freebsd_committer freebsd_triage 2018-05-02 17:57:27 UTC
I guess you got USES=python and USE_PYTHON=noflavors mixed.

USES=python means you could build the port with your default python, 2 or 3.
Assume you have DEFAULT_VERSIONS=python=3.6 in /etc/make.conf, you'll get py36-foo.

USE_PYTHON=noflavors means we do not build the port with multiple flavors (py27 and py36 currently) but only the default flavor.

Back to this port.
If you want to support both python 2 and 3, it's done in bug #227893.
You get py36-afew if you use python 3.6 as the default.

BTW, before bug #227893 lands, this port should be marked as USES=python:2.7 because you cannot build this port with python 3.x due to nonexistent py3x-dkimpy. It wasn't a problem because USE_PYTHON=noflavors excluded the py36 flavor.
Comment 6 Sebastian Schwarz 2018-05-11 16:01:28 UTC
> If you want to support both python 2 and 3, it's done in bug #227893.
> You get py36-afew if you use python 3.6 as the default.

Maybe I didn't express myself well enough.  I'd like for mail/py-afew not only to be buildable with Python 2 and 3 (which indeed was achieved by bug #227893), but also to be readily installable with pkg from the official repositories in Python 2 and 3 variants (which is the goal of this PR).

For the latter the port needs to be built with multiple Python flavors, which is what the attached patch implements.

Is not desirable to have?
Comment 7 Steve Wills freebsd_committer freebsd_triage 2018-07-26 21:32:09 UTC
Seems this was done in r466282, closing.
Comment 8 Steve Wills freebsd_committer freebsd_triage 2018-07-26 21:35:05 UTC
Oops, braino, sorry.
Comment 9 commit-hook freebsd_committer freebsd_triage 2018-07-26 22:43:46 UTC
A commit references this bug:

Author: swills
Date: Thu Jul 26 22:43:41 UTC 2018
New revision: 475403
URL: https://svnweb.freebsd.org/changeset/ports/475403

Log:
  mail/py-afew: support both Python 2 and 3

  PR:		227894
  Submitted by:	Sebastian Schwarz <seschwar@gmail.com> (maintainer)

Changes:
  head/mail/py-afew/Makefile
Comment 10 Steve Wills freebsd_committer freebsd_triage 2018-07-26 22:44:05 UTC
Committed, thanks!