From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2C556139694 for ; Sat, 20 May 2017 13:31:09 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A355321C08B; Sat, 20 May 2017 13:30:54 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5E824E0E87 for ; Sat, 20 May 2017 13:30:54 +0000 (UTC) Received: from localhost.localdomain (d202-252.icpnet.pl [109.173.202.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 375683416B5; Sat, 20 May 2017 13:30:52 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: python@gentoo.org Subject: [gentoo-dev] [PATCHES] python-r1.eclass: any-of dep API support Date: Sat, 20 May 2017 15:30:37 +0200 Message-Id: <20170520133044.9692-1-mgorny@gentoo.org> X-Mailer: git-send-email 2.13.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: dc921d54-8248-42e3-8e8d-427ca6f8604e X-Archives-Hash: 16f1b673762bbec3de22e1da79568434 Hi, everyone. Here's a set of patches inspired by the recent Sphinx dependency discussion. They make python-r1 (and therefore distutils-r1) capable of any-of dependency logic similar to the one used in python-any-r1. The basic goal is relatively simple -- to improve handling of pure build-time dependencies in the eclass. It solves two common problems: a. dependencies on packages that support only a subset of PYTHON_COMPAT, b. dependencies that need to be implementation-bound between themselves (e.g. Sphinx plugins). The new API improves both of those cases significantly. For the former, we no longer force user to select additional targets via REQUIRED_USE -- instead, we just any-of dependencies + python_check_deps() to select implementation independently of whether it is enabled or not. For the latter, we no longer have to force all targets of the package on all the involved dependencies. Again, using any-of dep and appropriate python_check_deps() we can enforce a single (any) target throughout all the packages and use it. The first three patches do some code refactoring that makes the change easier and possibly improves maintainability of the code. The next two patches add support for python_check_deps() and python_gen_any_dep() respectively. The last two patches provide examples for both use cases mentioned. Please review. -- Best regards, Michał Górny