From owner-freebsd-python@freebsd.org Sat Sep 5 10:23:37 2020 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 39AAB3E7C58 for ; Sat, 5 Sep 2020 10:23:37 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4Bk9cT0B53z4KkN for ; Sat, 5 Sep 2020 10:23:37 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: by mailman.nyi.freebsd.org (Postfix) id 063FC3E7C57; Sat, 5 Sep 2020 10:23:37 +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 060C43E7C56 for ; Sat, 5 Sep 2020 10:23:37 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: from router10G.digiware.nl (smtp.digiware.nl [176.74.240.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bk9cR3CPXz4KVg; Sat, 5 Sep 2020 10:23:35 +0000 (UTC) (envelope-from wjw@digiware.nl) Received: from router10g.digiware.nl (localhost.digiware.nl [127.0.0.1]) by router10G.digiware.nl (Postfix) with ESMTP id 780E86C3F5; Sat, 5 Sep 2020 12:23:33 +0200 (CEST) X-Virus-Scanned: amavisd-new at digiware.com Received: from router10G.digiware.nl ([127.0.0.1]) by router10g.digiware.nl (router10g.digiware.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id juxxx8hKmtbR; Sat, 5 Sep 2020 12:23:32 +0200 (CEST) Received: from [192.168.10.9] (vaio [192.168.10.9]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by router10G.digiware.nl (Postfix) with ESMTPSA id 8B9186C3F4; Sat, 5 Sep 2020 12:23:32 +0200 (CEST) Subject: Re: How to package .pyc files From: Willem Jan Withagen To: koobs@FreeBSD.org, Gleb Popov , python@freebsd.org References: <836f4710-cfa6-911a-48be-246912c702c3@FreeBSD.org> <9e886f31-e196-43c0-a59d-f506d3e7e620@digiware.nl> Message-ID: Date: Sat, 5 Sep 2020 12:23:31 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Firefox/68.0 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <9e886f31-e196-43c0-a59d-f506d3e7e620@digiware.nl> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-Rspamd-Queue-Id: 4Bk9cR3CPXz4KVg X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of wjw@digiware.nl designates 176.74.240.9 as permitted sender) smtp.mailfrom=wjw@digiware.nl X-Spamd-Result: default: False [-1.32 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HFILTER_HELO_IP_A(1.00)[router10g.digiware.nl]; HFILTER_HELO_NORES_A_OR_MX(0.30)[router10g.digiware.nl]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-0.98)[-0.984]; RCVD_COUNT_THREE(0.00)[4]; DMARC_NA(0.00)[digiware.nl]; NEURAL_HAM_SHORT(-0.32)[-0.319]; RCVD_IN_DNSWL_NONE(0.00)[176.74.240.9:from]; NEURAL_HAM_MEDIUM(-1.02)[-1.016]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:28878, ipnet:176.74.224.0/19, country:NL]; RCVD_TLS_LAST(0.00)[]; MAILMAN_DEST(0.00)[python] X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Sep 2020 10:23:37 -0000 On 2-9-2020 11:14, Willem Jan Withagen wrote: > On 2-9-2020 06:46, Kubilay Kocak wrote: >> On 1/09/2020 4:46 am, Gleb Popov wrote: >>> On Mon, Aug 31, 2020 at 9:45 PM Gleb Popov wrote: >>> >>>> Hello. I'm fiddling with the devel/mercurial port ( >>>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242463 ). The >>>> current >>>> Makefile results in >>>> >>>> Error: Orphaned: %%PYTHON_SITELIBDIR%%/mercurial/__modulepolicy__.py >>>> Error: Orphaned: >>>> %%PYTHON_SITELIBDIR%%/mercurial/__pycache__/__modulepolicy__.cpython-37.opt-1.pyc >>>> >>>> Error: Orphaned: >>>> %%PYTHON_SITELIBDIR%%/mercurial/__pycache__/__modulepolicy__.cpython-37.pyc >>>> >>>> >>>> errors. However, adding these files into pkg-plist seems a bit hard >>>> - it >>>> requires %%PYTHON_VER%% subst and a special treatment for python2 >>>> case. >>>> Which made me wonder - should these files be packaged at all? If >>>> yes, maybe >>>> there is some simple solution I'm missing? >> >> >> Yes, just add them to pkg-plist (while using USE_PYTHON=autoplist to >> handle the rest automatically) >> > I read that it also requires distutils, which overrules do-build and > do-install. > But I'm wondering how that works together with CMake building. > Fixing the works with python using the options would be nice, since it > is quite a hassle atm. > > Guess I'll have to try it to find out. Have now: USE_PYTHON=     cython py3kplist autoplist The magic seems to work.... Nice work. The only (wierd) thing is that there is a lot of cython files named something like: %%PYTHON_SITELIBDIR%%/ceph/deployment/__pycache__/drive_group.cpython-37.pyc And replacing the 37 with %%PYTHON_VER%% does not seem to work, although those things are closely matched to the python version. --WjW