Bug 226290 - [NEW PORT] devel/py-python-gitlab: Python package providing access to the GitLab server API
Summary: [NEW PORT] devel/py-python-gitlab: Python package providing access to the Git...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Steve Wills
URL: https://reviews.freebsd.org/D14560
Keywords: feature, needs-patch, needs-qa
Depends on: 227194
Blocks:
  Show dependency treegraph
 
Reported: 2018-03-02 04:13 UTC by Derek Schrock
Modified: 2018-04-17 04:18 UTC (History)
4 users (show)

See Also:
koobs: maintainer-feedback? (dereks)


Attachments
add new port devel/py-python-gitlab (3.08 KB, patch)
2018-03-02 04:13 UTC, Derek Schrock
dereks: maintainer-approval+
Details | Diff
testport output (30.24 KB, text/plain)
2018-03-02 04:14 UTC, Derek Schrock
no flags Details
Add new port devel/py-python-gitlab (3.04 KB, patch)
2018-03-03 20:10 UTC, Derek Schrock
no flags Details | Diff
testport port output of default python version 2.7 (30.56 KB, text/plain)
2018-03-03 20:18 UTC, Derek Schrock
no flags Details
poudriere bulk building multiple default flavors (2.7 and 3.6) of devel/py-python-gitlab with pkg install output (4.33 KB, text/plain)
2018-03-03 20:21 UTC, Derek Schrock
no flags Details
Sample output of 2.7 (including symlink) and 3.6 /usr/local/bin/gitlab{,2.7,3.6} working (108.19 KB, text/plain)
2018-03-03 20:23 UTC, Derek Schrock
no flags Details
Add new port devel/py-python-gitlab (3.65 KB, patch)
2018-04-02 02:33 UTC, Derek Schrock
no flags Details | Diff
testport port output of default python version 2.7 with test (276.50 KB, text/plain)
2018-04-02 02:35 UTC, Derek Schrock
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Derek Schrock 2018-03-02 04:13:52 UTC
Created attachment 191123 [details]
add new port devel/py-python-gitlab

python-gitlab is a Python package providing access to the GitLab server API.

It supports the v3 and v4 APIs of GitLab, and provides a CLI tool (gitlab).

https://github.com/python-gitlab/python-gitlab

Installs python-gitlab to the flavored python and bin/gitlab CLI utility
Comment 1 Derek Schrock 2018-03-02 04:14:14 UTC
Created attachment 191124 [details]
testport output
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2018-03-02 04:26:36 UTC
Thank you for your new port contribution

Review item(s):

- Default to MASTER_SITES=CHEESESHOP for packages that are distributed/released there. Use alternative sources (Eg: GitHub) only if there is a (temporary) compelling case to use them, eg if important test or data files have not been correctly included in the source distribution (sdist). Submit upstream PR's issues in these cases

- Use the verbatim upstream setup.py:description/short_description where possible, modified to comply with portlint if necessary. "Interact with GitLab API". Submit upstream issues/pr's where the description should/could be improved.

- Add TEST_DEPENDS and a test target where available (even if they cannot be automatically run without user intervention)

- Packages that support multiple python versions that also provide console scripts  [this one does [1]), must be concurrent safe (ie; USE_PYTHON=concurrent added, and QA'd with multiple python versions, confirmed not to produce conflicting filenames)

[1] https://github.com/python-gitlab/python-gitlab/blob/master/setup.py#L26
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2018-03-02 04:27:40 UTC
(In reply to Kubilay Kocak from comment #2)

See Also: https://wiki.freebsd.org/Python/PortsPolicy
Comment 4 Derek Schrock 2018-03-03 02:02:56 UTC
(In reply to Kubilay Kocak from comment #2)

- Locally I've switched CHEESESHOP from GitHub.

- setup.py:description/short_description does this include pkg-descr?

- TEST_DEPENDS will be a little harder since most of test requirements are not in the ports tree.  They seem straight forward python ports though.  I'll work on those this weekend.

- I believe I have this building properly with poudriere now such that only 2.7 is symlinked and all other flavors don't produce conflicting file names:

$ ls -l /usr/local/bin/gitlab*
lrwxr-xr-x  1 root  wheel   10 Mar  2 19:33 /usr/local/bin/gitlab@ -> gitlab-2.7
-rwxr-xr-x  1 root  wheel  406 Mar  2 19:33 /usr/local/bin/gitlab-2.7*
-rwxr-xr-x  1 root  wheel  406 Mar  2 19:43 /usr/local/bin/gitlab-3.6*

$ pkg info -x python-gitlab
py27-python-gitlab-1.3.0
py36-python-gitlab-1.3.0


$ gitlab project list
...
$ gitlab-2.7 project list
...
$ gitlab-3.6 project list
...

All produce the expected output.

However, what I haven't figured out is how to get this to build with poudriere and the other two versions of python (3.4 and 3.5) without DEFAULT_VERSIONS.  Using DEFAULT_VERSION will result in a package that symlinks scripts which isn't what I want when testing.

- Based off Python/PortsPolicy should the small post-patch: on gitlab/config.py be upstreamed such that upstream should use a different location based off base install location?
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2018-03-03 07:26:10 UTC
(In reply to dereks from comment #4)

pkg-descr: long_description, formatted well, if there is one. otherwise some upstream source that provides a nice initial summary, formatted nicely if necessary. if no upstream source exists, creative license/common sense and send them a PR to add it :)

TEST_DEPENDS: These dont block landing your changes, but its good to get into the habit of adding test framework bits (TEST_DEPENDS/test: target) early.

conflicts/conncurrency: USE_PYTHON=concurrent should handle most if not all of it. It definitely handles stuff installed in LOCALBASE/bin.

Re testing/building with other python versions:

- In LOCALBASE/etc/poudriere.d/py36.conf
- Add DEFAULT_VERSIONS=python=x.y
- poudriere testport -o <origin> -z py36

You can create as many *.conf's as you want, and use them in -z <set> args.

Ignore the symlinks in those cases, the framework does the right thing for the (ports) users DEFAULT_VERSIONN, and for package users, we only produce packages for the default default_Version (2.7), so 3.x packages (if they were built), wont contain them.

patches: Generally, ideally yes, less maintenance long term, relationship++ with upstreams. In this patches case, its a hardcoded default. The package could support some form of configuration that can be set at build time so the right (custom) path is set wherever it needs to be. The post-patch is fine for now. The upstream issue summary might look something like "Provide mechanism to replace hardcoded /etc dir" or similar
Comment 6 Derek Schrock 2018-03-03 20:10:38 UTC
Created attachment 191181 [details]
Add new port devel/py-python-gitlab

Updated patch to add devel/py-python-gitlab

- Reword COMMENT based off setup.py:short_description
- Use USE_PYTHON's concurrent
- Switch to CHEESESHOP from USE_GITHUB
- Small rewording of pkg-descr

Over the next weeks I plan to add all supported ports required for TEST_DEPENDS and do-test: target
Comment 7 Derek Schrock 2018-03-03 20:18:04 UTC
Created attachment 191182 [details]
testport port output of default python version 2.7
Comment 8 Derek Schrock 2018-03-03 20:21:52 UTC
Created attachment 191183 [details]
poudriere bulk building multiple default flavors (2.7 and 3.6) of devel/py-python-gitlab with pkg install output

poudriere bulk building multiple default flavors (2.7 and 3.6) of devel/py-python-gitlab with pkg install allowing multiple versions of devel/py-python-gitlab be install without conflicting files.
Comment 9 Derek Schrock 2018-03-03 20:23:50 UTC
Created attachment 191184 [details]
Sample output of 2.7 (including symlink) and 3.6 /usr/local/bin/gitlab{,2.7,3.6} working
Comment 10 Derek Schrock 2018-04-02 02:33:33 UTC
Created attachment 192089 [details]
Add new port devel/py-python-gitlab

Add tests depending on www/py-httmock (bug 227194) and DOCS option
Comment 11 Derek Schrock 2018-04-02 02:35:10 UTC
Created attachment 192090 [details]
testport port output of default python version 2.7 with test

testport port output of default python version 2.7 with 'make test' inside poudriere testport jail.
Comment 12 commit-hook freebsd_committer 2018-04-17 04:17:51 UTC
A commit references this bug:

Author: swills
Date: Tue Apr 17 04:17:14 UTC 2018
New revision: 467558
URL: https://svnweb.freebsd.org/changeset/ports/467558

Log:
  devel/py-python-gitlab: create port

  python-gitlab is a Python package providing access to the GitLab server API.

  It supports the v3 and v4 APIs of GitLab, and provides a CLI tool (gitlab).

  WWW: https://github.com/python-gitlab/python-gitlab

  PR:		226290
  Submitted by:	dereks@lifeofadishwasher.com

Changes:
  head/devel/Makefile
  head/devel/py-python-gitlab/
  head/devel/py-python-gitlab/Makefile
  head/devel/py-python-gitlab/distinfo
  head/devel/py-python-gitlab/files/
  head/devel/py-python-gitlab/files/pkg-message.in
  head/devel/py-python-gitlab/pkg-descr
Comment 13 Steve Wills freebsd_committer 2018-04-17 04:18:20 UTC
Committed, thanks!