Index: head/devel/py-phabricator/Makefile =================================================================== --- head/devel/py-phabricator/Makefile +++ head/devel/py-phabricator/Makefile @@ -3,6 +3,7 @@ PORTNAME= phabricator PORTVERSION= 0.4.0 +PORTREVISION= 1 CATEGORIES= devel python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -13,19 +14,19 @@ LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE -USES= python -USE_PYTHON= distutils autoplist - -OPTIONS_DEFINE= TESTS - TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}nose>0:${PORTSDIR}/devel/py-nose \ ${PYTHON_PKGNAMEPREFIX}mock>0:${PORTSDIR}/devel/py-mock \ ${PYTHON_PKGNAMEPREFIX}unittest2>0:${PORTSDIR}/devel/py-unittest2 +USES= python +USE_PYTHON= autoplist distutils + +OPTIONS_DEFINE= TESTS + TESTS_DESC= Include test suite requirements TESTS_BUILD_DEPENDS= ${TEST_DEPENDS} regression-test: build - @cd ${WRKSRC} && ${PYTHON_CMD} ${PYSETUP} test + @cd ${WRKSRC} && ${PYTHON_CMD} ${PYDISTUTILS_SETUP} test .include Index: head/devel/py-phabricator/files/patch-phabricator_____init____.py =================================================================== --- head/devel/py-phabricator/files/patch-phabricator_____init____.py +++ head/devel/py-phabricator/files/patch-phabricator_____init____.py @@ -0,0 +1,38 @@ +--- phabricator/__init__.py.orig 2013-11-26 21:00:52 UTC ++++ phabricator/__init__.py +@@ -288,15 +288,19 @@ class Phabricator(Resource): + } + + def __init__(self, username=None, certificate=None, host=None, +- timeout=5, response_format='json', **kwargs): ++ timeout=5, response_format='json', token=None, **kwargs): + + # Set values in ~/.arcrc as defaults + if ARCRC: + self.host = host if host else ARCRC['hosts'].keys()[0] +- self.username = username if username else ARCRC['hosts'][self.host]['user'] +- self.certificate = certificate if certificate else ARCRC['hosts'][self.host]['cert'] ++ if token or ARCRC['hosts'][self.host].has_key('token'): ++ self.token = token if token else ARCRC['hosts'][self.host]['token'] ++ else: ++ self.username = username if username else ARCRC['hosts'][self.host]['user'] ++ self.certificate = certificate if certificate else ARCRC['hosts'][self.host]['cert'] + else: + self.host = host ++ self.token = token + self.username = username + self.certificate = certificate + +@@ -313,6 +317,12 @@ class Phabricator(Resource): + raise SyntaxError('You cannot call the Conduit API without a resource.') + + def connect(self): ++ if self.token: ++ self.conduit = { ++ 'token': self.token ++ } ++ return ++ + auth = Resource(api=self, method='conduit', endpoint='connect') + + response = auth(user=self.username, host=self.host, Index: head/devel/py-phabricator/files/patch-phabricator_tests.py =================================================================== --- head/devel/py-phabricator/files/patch-phabricator_tests.py +++ head/devel/py-phabricator/files/patch-phabricator_tests.py @@ -0,0 +1,12 @@ +--- phabricator/tests.py.orig 2013-11-23 04:51:16 UTC ++++ phabricator/tests.py +@@ -9,6 +9,9 @@ RESPONSES = { + 'maniphest.find': '{"result":{"PHID-TASK-4cgpskv6zzys6rp5rvrc":{"id":"722","phid":"PHID-TASK-4cgpskv6zzys6rp5rvrc","authorPHID":"PHID-USER-5022a9389121884ab9db","ownerPHID":"PHID-USER-5022a9389121884ab9db","ccPHIDs":["PHID-USER-5022a9389121884ab9db","PHID-USER-ba8aeea1b3fe2853d6bb"],"status":"3","priority":"Needs Triage","title":"Relations should be two-way","description":"When adding a differential revision you can specify Maniphest Tickets to add the relation. However, this doesnt add the relation from the ticket -> the differently.(This was added via the commit message)","projectPHIDs":["PHID-PROJ-358dbc2e601f7e619232","PHID-PROJ-f58a9ac58c333f106a69"],"uri":"https:\/\/secure.phabricator.com\/T722","auxiliary":[],"objectName":"T722","dateCreated":"1325553508","dateModified":"1325618490"}},"error_code":null,"error_info":null}' + } + ++# Protect against local user's .arcrc interference. ++phabricator.ARCRC = {} ++ + class PhabricatorTest(unittest.TestCase): + def setUp(self): + self.api = phabricator.Phabricator(username='test', certificate='test', host='http://localhost')