From owner-freebsd-python@freebsd.org Wed Sep 2 04:47:02 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 635003CBB93 for ; Wed, 2 Sep 2020 04:47:02 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4BhBHV0n9cz4DcK for ; Wed, 2 Sep 2020 04:47:02 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mailman.nyi.freebsd.org (Postfix) id 1ABB73CB8BD; Wed, 2 Sep 2020 04:47:02 +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 1A8373CB861 for ; Wed, 2 Sep 2020 04:47:02 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BhBHT2DZMz4DWZ; Wed, 2 Sep 2020 04:47:01 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pl1-x633.google.com with SMTP id h2so1707789plr.0; Tue, 01 Sep 2020 21:47:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=yGmhiloLiDw0nwWEcSxNkNeRK4z+71MbdNqnmhEFkG8=; b=tEcw+Bd2MTup4YU7X5Jw1VADnuZUAJxg0vTZ1p2TgRodnJtMIIIc0KK8yfYqcAfQsY WQEwhYfnkxGdOyeYroZ7punlKqGzAluEYH9M5gtj0G5yb/sCiEC+HRsxGMFHBYDxTCbP /m0oxy/x5SLacGf5Yy3Yw6FIVDJsjgs/n7MOiWVPkGbpg80Qn8Eks/gfzZcphnQtp+PM gnutczLGq+ugNt+rEjY2+zpoKH1vYRItA/hrkuP+MaMyICyB1fDW8AwXANQPLYcG61xc lwEJUGt3Hl9TyUVz6n5WrNpcfZ1mG99Vkj7Z9XGir1Lic6Zt6eKtV/x/P7X3vWy/UvZ4 7U9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=yGmhiloLiDw0nwWEcSxNkNeRK4z+71MbdNqnmhEFkG8=; b=cP+F0PKWLI6M1wG4ihgL/YG4yRSl8TruredSSn+g47Xq5BIRI59wV0kuFR2e74v0Gb xeG1m0IxlVjFkzIkVXsu1TlwGQW/Uyee59yvFSk555MS/+B19ncJqmNWjYKuPeWRpcR7 LTVos2Tk31Fr1dUB8YgDbYrjKpMmoOksVg83+2ZPX0n0ottZYPdp//yRY8/+/Pgz6FwN bdxag4p0XmKoxi7BgBVgnOmUj338oABR+RuP7V2N0usRFhcT9F7gACa4eS2J4VncniyV Ge1ilV5iv09i7GikNYlHTLG6E6OELNCnuOmvxOUOUsZaJnO/CFxz2EFrImj2wjj05bYm mgtA== X-Gm-Message-State: AOAM531n//Ae0vfgh3DUsFQ0tmx5UUq5mMtuBthGIb9xerZEydA997Y0 r42hxTA1zgfoUuHXR5p9JCzgZF9aIcA= X-Google-Smtp-Source: ABdhPJyXU3+iEBFbEbdri7N6IrAoFNbROn1J5K7AU+gUgkmmx2Q9jNOYseqtGYQxbHhK/m4laUv5fw== X-Received: by 2002:a17:902:988f:: with SMTP id s15mr578958plp.26.1599022019315; Tue, 01 Sep 2020 21:46:59 -0700 (PDT) Received: from [192.168.1.100] (180-150-68-130.b49644.syd.nbn.aussiebb.net. [180.150.68.130]) by smtp.gmail.com with ESMTPSA id e7sm3804782pgn.64.2020.09.01.21.46.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Sep 2020 21:46:58 -0700 (PDT) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: How to package .pyc files To: Gleb Popov , python@freebsd.org References: From: Kubilay Kocak Message-ID: <836f4710-cfa6-911a-48be-246912c702c3@FreeBSD.org> Date: Wed, 2 Sep 2020 14:46:55 +1000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Thunderbird/81.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BhBHT2DZMz4DWZ X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=tEcw+Bd2; dmarc=none; spf=pass (mx1.freebsd.org: domain of koobsfreebsd@gmail.com designates 2607:f8b0:4864:20::633 as permitted sender) smtp.mailfrom=koobsfreebsd@gmail.com X-Spamd-Result: default: False [-2.29 / 15.00]; HAS_REPLYTO(0.00)[koobs@FreeBSD.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.14)[-0.141]; FORGED_SENDER(0.30)[koobs@FreeBSD.org,koobsfreebsd@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.93)[-0.932]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_NEQ_ENVFROM(0.00)[koobs@FreeBSD.org,koobsfreebsd@gmail.com]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.02)[-1.017]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::633:from]; RCVD_TLS_ALL(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: Wed, 02 Sep 2020 04:47:02 -0000 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) >> Thanks in advance. >> > > Inspecting ${WRKDIR}/.PLIST* files after the build revealed that all other > .pyc files are correctly added to the plist. So, there is something special > about this __modulepolicy__.py file. I'm tempted to simply remove it on > post-install. They are handled specially (see setup.py) The root cause and outcome of that special handling (overriding the default setuptools build/install classes) is that those files are not added to setuptools --record output (the list of files that a package installs), which our framework uses to produce the pkg-plist This ultimately needs to be resolved by upstream, such that those files are added to the list correctly, as they should be. See examples of "get_outputs" use in setup.py files in github, like: https://github.com/Nevisor/Client/blob/master/ScriptLib/Python-2.2/Tools/idle/setup.py#L41 > Any ideas?