From owner-freebsd-python@freebsd.org Tue Dec 31 18:01:58 2019 Return-Path: Delivered-To: freebsd-python@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5A071DA639 for ; Tue, 31 Dec 2019 18:01:58 +0000 (UTC) (envelope-from ml@netfence.it) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 47nMZG2zHGz4XxK for ; Tue, 31 Dec 2019 18:01:58 +0000 (UTC) (envelope-from ml@netfence.it) Received: by mailman.nyi.freebsd.org (Postfix) id 65FF41DA638; Tue, 31 Dec 2019 18:01:58 +0000 (UTC) Delivered-To: python@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65ADE1DA636; Tue, 31 Dec 2019 18:01:58 +0000 (UTC) (envelope-from ml@netfence.it) Received: from soth.netfence.it (net-2-44-121-52.cust.vodafonedsl.it [2.44.121.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mailserver.netfence.it", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47nMZF031sz4XxG; Tue, 31 Dec 2019 18:01:56 +0000 (UTC) (envelope-from ml@netfence.it) Received: from alamar.ventu (alamar.local.netfence.it [10.1.2.18]) (authenticated bits=0) by soth.netfence.it (8.15.2/8.15.2) with ESMTPSA id xBVI1j1d015302 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Tue, 31 Dec 2019 19:01:47 +0100 (CET) (envelope-from ml@netfence.it) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netfence.it; s=201911; t=1577815308; bh=dGpbTMHpJw2mAbsVhfIAesXJXyWfgbaqViNGQSAem7s=; h=Subject:To:References:From:Cc:Date:In-Reply-To; b=pmyHugMJ//ZucP0oh1wulvBo/sjzf9I/u4HqmuPIQiwIVq8BX7wGqJ+jzTGqcZpzA Y3jNHBq8KThIXHA4SjzlQiWL+Wi976BtAVAMGJvEso35jlLLlMNBkYDTxbum395xbU vBZ7qMAGyC3psPiBmv1xKTukTzY0vF0Wmtm8+sQc= X-Authentication-Warning: soth.netfence.it: Host alamar.local.netfence.it [10.1.2.18] claimed to be alamar.ventu Subject: Re: Help with porting Python libraries To: python References: <850bbe75-06a2-0af6-fec8-8f6d3bd7c260@FreeBSD.org> From: Andrea Venturoli Cc: koobs@FreeBSD.org, ports@freebsd.org Message-ID: <7e268a15-280b-ab38-e90e-bab23702684c@netfence.it> Date: Tue, 31 Dec 2019 19:01:45 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <850bbe75-06a2-0af6-fec8-8f6d3bd7c260@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47nMZF031sz4XxG X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=netfence.it header.s=201911 header.b=pmyHugMJ; dmarc=pass (policy=none) header.from=netfence.it; spf=pass (mx1.freebsd.org: domain of ml@netfence.it designates 2.44.121.52 as permitted sender) smtp.mailfrom=ml@netfence.it X-Spamd-Result: default: False [-4.40 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[netfence.it:s=201911]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:2.44.121.52]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; DKIM_TRACE(0.00)[netfence.it:+]; DMARC_POLICY_ALLOW(-0.50)[netfence.it,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-1.40)[ip: (-7.26), ipnet: 2.44.0.0/16(-3.63), asn: 30722(3.84), country: IT(0.03)]; ASN(0.00)[asn:30722, ipnet:2.44.0.0/16, country:IT]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Dec 2019 18:01:58 -0000 On 2019-12-30 03:26, Kubilay Kocak wrote: Thanks to all that replied. Especially the link to Python Ports Policy & Guidelines/Tips was very useful, as I hadn't found this myself :( I tried to follow all your suggestions, but I'm having some problems with it... Using CHEESESHOP I removed USE_GITHUB, GH_ACCOUNT and GH_PROJECT, and added "MASTER_SITES= CHEESESHOP". However, running make makesum I get: > # make makesum > ===> License BSD3CLAUSE accepted by the user > ===> License BSD3CLAUSE accepted by the user > ===> py36-imapclient-2.1.0 depends on file: /usr/local/sbin/pkg - found > => imapclient-2.1.0.tar.gz doesn't seem to exist in /usr/ports/distfiles/. > => Attempting to fetch https://files.pythonhosted.org/packages/source/i/imapclient/imapclient-2.1.0.tar.gz > fetch: https://files.pythonhosted.org/packages/source/i/imapclient/imapclient-2.1.0.tar.gz: Not Found > => Attempting to fetch https://pypi.org/packages/source/i/imapclient/imapclient-2.1.0.tar.gz > fetch: https://pypi.org/packages/source/i/imapclient/imapclient-2.1.0.tar.gz: Not Found > => Attempting to fetch http://distcache.FreeBSD.org/ports-distfiles/imapclient-2.1.0.tar.gz > fetch: http://distcache.FreeBSD.org/ports-distfiles/imapclient-2.1.0.tar.gz: Not Found > => Couldn't fetch it - please try to retrieve this > => port manually into /usr/ports/distfiles/ and try again. > *** Error code 1 I'm not just into it enought to understand what I have to do to solve. Tests In setup.py, I see: > test_deps = ['mock>=1.3.0; python_version < "3.4"'] I think I have to put in Makefile: > TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}mock>1.3.0:devel/py-mock@${PY_FLAVOR} However I don't know how to handle that <"3.4"... Then I wrote: > do-test: > @cd ${WRKSRC} && ${PYTHON_CMD} ${PYDISTUTILS_SETUP} test Is this correct? Finally, tests fail: > # make test > ===> Patching for py36-imapclient-2.1.0 > ===> py36-imapclient-2.1.0 depends on package: py36-setuptools>0 - found > ===> py36-imapclient-2.1.0 depends on file: /usr/local/bin/python3.6 - found > ... > test_invalid (tests.test_datetime_util.TestParsing) ... ok > test_rfc822_style (tests.test_datetime_util.TestParsing) ... ok > > ====================================================================== > FAIL: test_redacted_password (tests.test_imapclient.TestDebugLogging) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "/usr/ports/mail/py-IMAPClient/work-py36/imapclient-2.1.0/tests/test_imapclient.py", line 521, in test_redacted_password > extra={} > File "/usr/local/lib/python3.6/unittest/mock.py", line 824, in assert_called_once_with > raise AssertionError(msg) > AssertionError: Expected '_log' to be called once. Called 0 times. > > ---------------------------------------------------------------------- > Ran 254 tests in 0.115s > > FAILED (failures=1) > Test failed: > error: Test failed: > *** Error code 1 > > Stop. > make: stopped in /usr/ports/mail/py-IMAPClient Is this my fault, a problem upstream, a problem in some dependency? Docs I'm trying to learn by example, here, so I looked at a couple of ports and came up with the Makefile I'll post at the end. Troubles: _ this way, documentation files are not in the plist, and "port test" obviously complains. _ Documentation files are not versioned: do I need to use "concurrent" then? _ If I run "port test" without py36-sphinx installed, it doesn't work; shouldn't it install this as a dependency (and remove it afterwards)? bye & Thanks av. > # $FreeBSD$ > > PORTNAME= imapclient > PORTVERSION= 2.1.0 > CATEGORIES= mail python > #MASTER_SITES= CHEESESHOP > PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} > > MAINTAINER= ml@netfence.it > COMMENT= Easy-to-use, Pythonic and complete IMAP client library > > LICENSE= BSD3CLAUSE > LICENSE_FILE= ${WRKSRC}/COPYING > > RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}six>0:devel/py-six@${PY_FLAVOR} > TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}mock>1.3.0:devel/py-mock@${PY_FLAVOR} > > USES= python:2.7-3.7 > USE_GITHUB= yes > USE_PYTHON= autoplist distutils > GH_ACCOUNT= mjs > GH_PROJECT= imapclient > NO_ARCH= yes > > OPTIONS_DEFINE= DOCS > > DOCS_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}sphinx>=0:textproc/py-sphinx@${PY_FLAVOR} > DOCS_VARS= PYDISTUTILS_BUILD_TARGET+="build_sphinx -a -E" > > post-install-DOCS-on: > @${MKDIR} ${STAGEDIR}${DOCSDIR} > (cd ${WRKSRC}/doc/html && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR} "! -name .buildinfo -and ! -name objects.inv") > > do-test: > @cd ${WRKSRC} && ${PYTHON_CMD} ${PYDISTUTILS_SETUP} test > > .include