Bug 221889 - [NEW PORT] www/py-treq: Requests-like API built on top of twisted.web's Agent
Summary: [NEW PORT] www/py-treq: Requests-like API built on top of twisted.web's Agent
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: Alan Somers
URL:
Keywords: feature
Depends on:
Blocks: 220564
  Show dependency treegraph
 
Reported: 2017-08-29 03:07 UTC by Alan Somers
Modified: 2017-09-18 15:17 UTC (History)
3 users (show)

See Also:


Attachments
Adds port for py-treq (3.11 KB, patch)
2017-08-29 03:07 UTC, Alan Somers
no flags Details | Diff
Address koob's feedback (3.28 KB, patch)
2017-09-09 22:40 UTC, Alan Somers
koobs: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Somers freebsd_committer 2017-08-29 03:07:31 UTC
Created attachment 185857 [details]
Adds port for py-treq

An HTTP library inspired by requests but written on top of Twisted's Agents.

It provides a simple, higher level API for making HTTP requests when using
Twisted.

WWW: https://github.com/twisted/treq
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2017-09-08 03:28:04 UTC
Looks OK, a few considerations:

- Ideally, MAINTAINER for new ports should be author unless compelling reason not to be. python is happy to be a fallback in the case of maintainers falling away over time however.

- Consider invoking trial via "${PYTHON_CMD} -m <something.trial|trial.something>"  rather than localbase scripts, which cannot be relied upon to point to the same/expected version of Python over time (users can change 'default' version of python at any time).

- Add LICENSE_FILE if one exists (or is provided by) in WKRSRC (extracted tarball). One is provided (named LICENSE)

- Upstream 'Trove classifiers' specify 2.7+ support (2.7,3.3+ precisely), but USES=python is limited to -2.7:

    "Programming Language :: Python :: 2.7",
    "Programming Language :: Python :: 3.3",
    "Programming Language :: Python :: 3.4",
    "Programming Language :: Python :: 3.5",

- install_requires depends explicitly on "Twisted[tls] >= 16.4.0", you may want this port to depend 'explicitly' on those optional 'tls' python packages to ensure they're installed (the twisted port may or may not install them, as they're, well, optional)

Confirmation of QA also not provided
Comment 2 Alan Somers freebsd_committer 2017-09-09 22:40:21 UTC
Created attachment 186213 [details]
Address koob's feedback

This should address all of your concerns:
1) changed maintainer to myself
2) Invoke trial the way you suggest
3) Add LICENSE_FILE
4) Change the python dependency to 2.7+.  I couldn't find a way to do 2.7+,3.3+, but hopefully nobody still has 3.0-3.2 lying around.
5) Made the twisted[tls] dependencies into mandatory dependencies of py-treq, even though not all py-treq consumers use them (buildbot, for example, does not).  But setup.py considers Twisted TLS support to be mandatory.

Tested it by:
1) Building in Poudriere
2) Running Buildbot on a jail with py-treq installed instead of py-txrequests
3) Running "make test" in an interactive Poudriere session.  Some tests fail, but they look like code problems, beyond the ken of a packager like myself.  This step did reveal a separate problem, though, addressed in PR 222181.
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2017-09-17 03:52:40 UTC
I might split out the twisted[tls] dependencies [1] into a separate/additional RUN_DEPENDS section with a comment, so our future selves know the context/special treatment of those deps:

# Depend directly on twisted[tls] dependencies
# As Twisted port may not (optionally) install them
RUN_DEPENDS+=
  ${PYTHON_PKGNAMEPREFIX}openssl>=16.0.0:security/py-openssl \
  ${PYTHON_PKGNAMEPREFIX}service_identity>=16.0.0:security/py-service_identity \
  ${PYTHON_PKGNAMEPREFIX}idna>=2.4:dns/py-idna

[1] https://github.com/twisted/twisted/blob/trunk/src/twisted/python/_setup.py#L93

Other than that the change looks OK.
Comment 4 commit-hook freebsd_committer 2017-09-17 04:14:31 UTC
A commit references this bug:

Author: asomers
Date: Sun Sep 17 04:13:50 UTC 2017
New revision: 449983
URL: https://svnweb.freebsd.org/changeset/ports/449983

Log:
  new port: www/py-treq

  Requests-like API built on top of twisted.web's Agent

  PR:		221889
  Reviewed by:	koobs
  Approved by:	koobs (portmgr)

Changes:
  head/www/Makefile
  head/www/py-treq/
  head/www/py-treq/Makefile
  head/www/py-treq/distinfo
  head/www/py-treq/pkg-descr
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2017-09-17 04:20:29 UTC
Comment on attachment 186213 [details]
Address koob's feedback

Clearly/correctly document approval:

Approved by: koobs (ports)