Commit Graph
49 Commits
Author SHA1 Message Date
Michał Górny 639e36f7af python*-r1.eclass: Check for invalid impl patterns
Check for invalid implementation patterns passed to python_gen*
functions, python_setup, etc.  Currently the functions silently ignore
pattern mismatches which is fine for patterns matching historical
implementations but also hides errors in patterns.

After this change, each pattern must match at least one current or
historical implementation.  If no match is found, the function dies
indicating developer's mistake.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-08-07 12:39:56 +02:00
Michał Górny 992e4fce31 python-single-r1.eclass: Fix eclassdoc
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-07-04 09:15:14 +02:00
Michał Górny 25852a4c58 python-single-r1.eclass: Allow using PYTHON_USEDEP again
Instead of requiring people to type PYTHON_MULTI_USEDEP, permit shorter
form of PYTHON_USEDEP.  This does not restore the old behavior
but improves consistency between eclasses that was broken
by python-single-r1 API changes.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-04-14 07:33:06 +02:00
Michał Górny e230589a0c python-utils-r1.eclass: Mark python_export private
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-03-22 06:36:57 +01:00
Michał Górny 367ac8f621 python-utils-r1.eclass: Make python_wrapper_setup private
This function was never meant to be a part of the public API.  Correct
the mistake by renaming it to _python_wrapper_setup(), and adding a QA
warning under the old name.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-03-22 06:36:55 +01:00
Michał Górny 9301087c09 python-single-r1.eclass: Report impl used by python_setup
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-03-05 08:57:40 +01:00
Michał Górny e451e66993 python*-r1.eclass, distutils-r1.eclass: Link to Python Guide
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-03-05 08:57:32 +01:00
Michał Górny 42b2157169 python-single-r1.eclass: Remove unused PYTHON_TARGETS
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-02-10 09:23:48 +01:00
Michał Górny 494b83570f python-single-r1.eclass: Remove deprecated PYTHON_USEDEP API
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2020-02-10 09:23:47 +01:00
Michał Górny ec3cf01513 python*-r1.eclass: Update examples for virtual/pypy removal
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2019-12-30 13:58:59 +01:00
Michał Górny a4d2a8bfd8 python-single-r1.eclass: Revert "Remove deprecated PYTHON_USEDEP..."
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2019-12-07 16:29:55 +01:00
Michał Górny a8e579bc93 python-single-r1.eclass: Revert "Remove unused PYTHON_TARGETS"
Pushed too many commits.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
2019-12-07 16:29:54 +01:00
Michał Górny 31f43f7851 python-single-r1.eclass: Remove unused PYTHON_TARGETS
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2019-12-07 15:36:33 +01:00
Michał Górny 6bc26eb834 python-single-r1.eclass: Remove deprecated PYTHON_USEDEP API
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2019-12-07 15:36:32 +01:00
Michał Górny 9c4fe911d0 python-single-r1.eclass: Use new-style flags for python-exec dep
Depend on PYTHON_TARGETS directly in dev-lang/python-exec dep,
instead of relying on old-style PYTHON_USEDEP.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
2019-12-07 15:36:31 +01:00
Michał Górny 4685a5f4ed python-single-r1.eclass: Introduce PYTHON_{SINGLE,MULTI}_USEDEP API
Introduce a new API that replaces PYTHON_USEDEP with
PYTHON_SINGLE_USEDEP variable and PYTHON_MULTI_USEDEP placeholder.
The former can be used directly (or via python_gen_cond_dep) when
depending on other python-single-r1 packages, the latter can be used
via python_gen_cond_dep when depending on python-r1 packages.

Long term, the new API will enable us to remove redundant PYTHON_TARGETS
flags from python-single-r1 packages.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
2019-12-07 15:36:30 +01:00
Michał Górny c6dbe44278 python*r1.eclass: Remove python-exec:0 leftover
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2019-12-07 15:36:29 +01:00
Michał Górny 1d5b43ab21 python*r1.eclass: Reliably allow empty <pattern>s to gen funcs
Reliably allow empty pattern lists (equivalent to no restrictions)
in all pattern-based generator functions, notably python_gen_cond_dep.
Previously, only some of the functions accepted them while others
failed via _python_impl_matches function.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
2019-12-07 15:36:28 +01:00
Michał Górny 4da21ec689 python-single-r1.eclass: Restore PYTHON_SINGLE_TARGET for one impl
Undo the hack that removes PYTHON_SINGLE_TARGET (in favor of plain
PYTHON_TARGETS) when the package supports only one target.  Instead,
output both kinds of flags consistently for all packages, and use IUSE
defaults to enable them when only one interpreter is supported.

This should give similar end results without creating unnecessary
differences between ebuilds with one and multiple implementations.
It will make future API changes easier, as well as simplify tooling
used to detect eclass type.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
2019-12-07 15:36:27 +01:00
Michał Górny 26467bacc4 python*-r1.eclass: Deprecate python_gen_usedep
Deprecate python_gen_usedep() in favor of python_gen_cond_dep().
The latter is a newer API that generates full USE-conditional blocks
rather than pure USE-dependency strings.  As such, it can replace all
uses of the former, and is safer to use in general.  In particular:

  dev-python/foo[$(python_gen_usedep -2)]
  dev-python/bar[$(python_gen_usedep -2)]

installs the dependency (with no implementation match enforced) even
if there's no python2 implementation enabled, while:

  $(python_gen_cond_dep '
    dev-python/foo[${PYTHON_USEDEP}]
    dev-python/bar[${PYTHON_USEDEP}]
  ' -2)

installs it only if there's at least one implementation requiring it.

Since the functions are used in global scope only, a deprecation warning
is emitted only once, during the sourcing for pkg_setup phase.  This
avoids having it output during metadata cache regeneration.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
2019-12-07 15:36:25 +01:00
Michał Górny 6c80445912 python-single-r1.eclass: add @SUPPORTED_EAPIS 2018-08-15 09:33:07 +02:00
Michał Górny bc8e16c54c python-single-r1.eclass: Enable EAPI 7 (no changes) 2018-05-07 09:43:30 +02:00
Michał Górny e8057f03b9 python-single-r1.eclass: Document new pattern support 2017-05-16 19:11:38 +02:00
Michał Górny f6bea5ce22 python-single-r1.eclass: python_gen_impl_dep, use _python_impl_matches() 2017-05-16 19:11:37 +02:00
Michał Górny 7adf37851c python-single-r1.eclass: python_gen_cond_dep, use _python_impl_matches() 2017-05-16 19:11:36 +02:00
Michał Górny bb7c80417e python-single-r1.eclass: python_gen_useflags, use _python_impl_matches() 2017-05-16 19:11:35 +02:00
Michał Górny 35f5bf6a53 python-single-r1.eclass: python_gen_usedep, use _python_impl_matches() 2017-05-16 19:11:35 +02:00
Michał Górny a640c3d2a4 python-single-r1.eclass: Add integrity checks for globals 2017-03-08 08:35:51 +01:00
Michał Górny 9d683e6e8c python-single-r1.eclass: Refactor global setter to use locals, NFC 2017-03-08 08:35:50 +01:00
Michał Górny f71997ca03 python-single-r1.eclass: Remove stale EAPI=4 branch in globals 2017-03-08 08:35:49 +01:00
Robin H. Johnson 61b861acd7 Drop $Id$ per council decision in bug #611234.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2017-02-28 11:50:50 -08:00
Michał Górny 8d2a47de59 python-single-r1.eclass: Always output use-cond in PYTHON_DEPS
Output a USE conditional in PYTHON_DEPS even when using only a single
target. While this does not make a strict difference since the target
flag is in REQUIRED_USE anyway, it results in more unified output
and makes it easier to catch mistakes if someone plays with the eclass
in the future.
2017-02-19 14:03:52 +01:00
Michał Górny a32e57790e python-single-r1.eclass: Remove EAPI=4 exceptions 2017-02-17 21:24:40 +01:00
Sergei Trofimovich afc733af60 python-single-r1.eclass: drop stray '}' in example docstring 2016-11-05 22:28:35 +00:00
Michał Górny 7c2f42d899 python-single-r1.eclass: Add python_gen_impl_dep, alike in python-r1 2015-12-31 15:52:03 +01:00
Michał Górny 4a1560e50b python-single-r1.eclass: Support PYTHON_COMPAT_OVERRIDE 2015-12-22 23:12:23 +01:00
Michał Górny 3923a952a7 python-single-r1.eclass: Fix python_gen_* w/ single PYTHON_COMPAT impl
Fix python_gen_useflags() and python_gen_cond_dep() to output correct
flag name when only a single implementation is listed in PYTHON_COMPAT.
In this case, the PYTHON_SINGLE_TARGET flags are not emitted
and PYTHON_TARGETS are used directly instead.
2015-12-22 23:12:23 +01:00
Michał Górny 33380ad5e1 python*-r1.eclass: Commonize PYTHON_COMPAT processing, cache the result
Introduce a common _python_set_impls function in python-utils-r1.eclass
that validates and processes PYTHON_COMPAT, then stores the result in
_PYTHON_SUPPORTED_IMPLS and _PYTHON_UNSUPPORTED_IMPLS variables. Reuse
those variables in all python-r1 suite eclasses, effectively reducing
code duplication and providing cache for repeated implementation support
checks.
2015-12-22 23:12:23 +01:00
Michał Górny 01e902405d python*-r1.eclass: Replace non-portable use of 'declare -g'
Replace uses of 'declare -g -r' (bash-4.2+) with 'readonly'. Reported
by Arfrever. This time use split assignments followed by readonly calls
since combined calls work unreliably.
2015-12-11 23:42:33 +01:00
Mike Gilbert d296b5daa5 Revert "python*-r1.eclass: Replace non-portable use of 'declare -g'"
This reverts commit 44d3345d82.

This was triggering "No supported implementation in PYTHON_COMPAT.".
2015-12-11 17:26:44 -05:00
Michał Górny 44d3345d82 python*-r1.eclass: Replace non-portable use of 'declare -g'
Replace uses of 'declare -g -r' (bash-4.2+) with 'readonly'. Reported
by Arfrever.
2015-12-11 22:27:19 +01:00
Michał Górny d7c8024fd8 python-single-r1.eclass: Mark eclass-generated variables read-only 2015-12-09 21:41:16 +01:00
Michał Górny fafd13b912 python-single-r1.eclass: python_gen_cond_dep(), rename local PYTHON_USEDEP
Rename local PYTHON_USEDEP variable to avoid collisions with read-only
global variable.
2015-12-09 21:41:16 +01:00
Michał Górny 364a366877 python-single-r1.eclass: Unset global-setting function after use 2015-12-09 21:41:16 +01:00
Michał Górny 49c3bd48b8 python-single-r1.eclass: Enable EAPI=6, no changes needed 2015-11-28 20:09:06 +01:00
Mike Gilbert 4d18149d91 python-r1.eclass: Ensure that PYTHON_COMPAT is an array
As suggested by Arfrever.

Bug: https://bugs.gentoo.org/564258
2015-11-07 20:30:52 -05:00
Justin Lecher c35ee2746e eclass: Exchange obsolete and depreacted Python ABIs in documentation
Signed-off-by: Justin Lecher <jlec@gentoo.org>
2015-09-03 08:06:22 +02:00
Mike Frysinger a3dac837fc eclass: fix various doc errors #537392 2015-08-14 00:05:33 -04:00
Robin H. Johnson 56bd759df1 proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.

This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.

Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
2015-08-08 17:38:18 -07:00