From owner-freebsd-python@FreeBSD.ORG Sun Jan 26 12:33:16 2014 Return-Path: Delivered-To: freebsd-python@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4BF2E876 for ; Sun, 26 Jan 2014 12:33:16 +0000 (UTC) Received: from forward10l.mail.yandex.net (forward10l.mail.yandex.net [IPv6:2a02:6b8:0:1819::a]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D1B3712BF for ; Sun, 26 Jan 2014 12:33:15 +0000 (UTC) Received: from smtp13.mail.yandex.net (smtp13.mail.yandex.net [95.108.130.68]) by forward10l.mail.yandex.net (Yandex) with ESMTP id 8FE5FBA0D4B for ; Sun, 26 Jan 2014 16:33:13 +0400 (MSK) Received: from smtp13.mail.yandex.net (localhost [127.0.0.1]) by smtp13.mail.yandex.net (Yandex) with ESMTP id 50F63E400CF for ; Sun, 26 Jan 2014 16:33:13 +0400 (MSK) Received: from unknown (unknown [178.76.234.16]) by smtp13.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id WmF1ARSZV1-XCJOq2dV; Sun, 26 Jan 2014 16:33:12 +0400 (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (Client certificate not present) X-Yandex-Uniq: 44db1e0b-abe4-4b1b-9445-d1ce86918165 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1390739592; bh=N3x7OiJMSbkQuEW27+8YP/eootkDBDS+Oau4waA4Zb4=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=O7+aLTBuLmqx91wMYSKfshS+zu/aQ3Q8kY+0irIBCEYNb376p2zB/JdD6luW8whJu M/Rg2P8mK4WSegLnmchSquHRybyqGtqJEUR5jxYQW1oK7F5U1uIooWCOb9Eisc3bWP pk/7r/EK/aWF2oyOXuqZtC+yfWUvyFxnK6d4nPJE= Authentication-Results: smtp13.mail.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: <52E5007C.8060805@yandex.ru> Date: Sun, 26 Jan 2014 16:33:00 +0400 From: Ruslan Makhmatkhanov User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: freebsd-python@freebsd.org Subject: Re: PYDISTUTILS_AUTOPLIST question References: <52E4BCF4.3070507@yandex.ru> <20140126113022.GA1394@medusa.sysfault.org> In-Reply-To: <20140126113022.GA1394@medusa.sysfault.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jan 2014 12:33:16 -0000 Marcus von Appen wrote on 26.01.2014 15:30: > On, Sun Jan 26, 2014, Ruslan Makhmatkhanov wrote: > >> Hi, >> >> while PYDISTUTILS_AUTOPLIST works smoothly for majority of ports, there >> is the problem with some of them I come across yesterday. For example, >> there is the port devel/py-Products.PasswordResetTool. If I set there >> PYDISTUTILS_AUTOPLIST, and try to build, I got packaging error, because >> some of the files, that port provides, cannot be compiled (by design). >> While they are python code files, they are not supposed to be executed >> with python interpreter directly (they are kind of templates). >> >> So, is there any possibility to: >> a) Do not add compiled/optimized filenames to packing list, if the >> actual file fails to compile? >> b) Make a hook, that allows to list file, that should not have >> corresponding *.pyc/*.pyo entries in the packing list? > > If the port uses distutils, it should not matter, if you do not mess around in > the post-install targets yourself, since the file list will be taken from what > distutils records - we do not implement magic ourselves for distutils-aware > ports (well, a bit :-). > If this does not work properly for you, upstream might do something that > breaks the intended behaviour of distutils. > > So, before fixing the symptom, I actually would like to find out, what exactly > they do on installation. Are all files properly recorded in ${_PYTHONPKGLIST}? > What errors do you get, what does the install target complain about, etc.etc.? > > Cheers > Marcus For example at install stage it fails with pwreset_constructURL.py file: byte-compiling /usr/local/poudriere/ports/default/devel/py-Products.PasswordResetTool/work/stage/usr/local/lib/python2.7/site-packages/Products/PasswordResetTool/skins/PasswordReset/pwreset_constructURL.py to pwreset_constructURL.pyc File "/usr/local/lib/python2.7/site-packages/Products/PasswordResetTool/skins/PasswordReset/pwreset_constructURL.py", line 14 return "%s/passwordreset/%s" % (host, randomstring) SyntaxError: 'return' outside function writing byte-compilation script '/tmp/tmpqmG0z8.py' /usr/local/bin/python2.7 -O /tmp/tmpqmG0z8.py File "/usr/local/lib/python2.7/site-packages/Products/PasswordResetTool/skins/PasswordReset/pwreset_constructURL.py", line 14 return "%s/passwordreset/%s" % (host, randomstring) SyntaxError: 'return' outside function removing /tmp/tmpqmG0z8.py And here is what on package stage: ===> Building package for py27-Products.PasswordResetTool-2.0.15_1 pkg-static: lstat(/usr/local/poudriere/ports/default/devel/py-Products.PasswordResetTool/work/stage/usr/local/lib/python2.7/site-packages/Products/PasswordResetTool/skins/PasswordReset/pwreset_constructURL.pyc): No such file or directory pkg-static: lstat(/usr/local/poudriere/ports/default/devel/py-Products.PasswordResetTool/work/stage/usr/local/lib/python2.7/site-packages/Products/PasswordResetTool/skins/PasswordReset/pwreset_constructURL.pyo): No such file or directory *** Error code 1 Stop. make: stopped in /usr/local/poudriere/ports/default/devel/py-Products.PasswordResetTool As we can see *.pyc/*.pyo pkg-plist entries were generated for pwreset_constructURL.py despite the fact that byte-compiling had failed. -- Regards, Ruslan T.O.S. Of Reality