public inbox for gentoo-python@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-python] python-any-r1: bunch of bugfixes/improvements and dep-checking function
@ 2013-04-22 10:51 Michał Górny
  2013-04-22 10:52 ` [gentoo-python] [PATCH 1/4] Make Python checks consistent Michał Górny
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Michał Górny @ 2013-04-22 10:51 UTC (permalink / raw
  To: gentoo-python; +Cc: python

[-- Attachment #1: Type: text/plain, Size: 1668 bytes --]

Hi,

I'm submitting a batch of patches for python-any-r1. The patches:

1. improve consistency between Python impl checking code. All branches
start to check whether Python interpreter is installed.

2. improve consistency in wrapper setup. All branches now set up
wrappers.

3. error out if no Python impl matches. This will become important with
the new dep-check function.

4. add support for defining python_check_deps() function in ebuilds.
The function can be used to verify whether Python impl chosen by eclass
supports all the deps needed for the package.

For example, if a package runs a script needing dev-python/foo
and dev-python/bar, the function would look like:

  python_check_deps() {
    if ! has_version "dev-python/foo[${PYTHON_USEDEP}]"; then
      einfo "${EPYTHON}: dev-python/foo does not support the impl"
      return 1
    elif ! has_version "dev-python/bar[${PYTHON_USEDEP}]"; then
      einfo "${EPYTHON}: dev-python/bar does not support the impl"
      return 1
    else
      return 0
    fi
  }

Note that the package will need a proper dep as well:

  DEPEND="
    ${PYTHON_DEPS}
    python_targets_python2_7? (
      dev-python/foo[python_targets_python2_7]
      dev-python/bar[python_targets_python2_7]
    )
  "

Note to self: think how to improve the deps.

Please note that the new syntax will be necessary only with more
complex cases. Simpler things like package just calling 'pyfoo' script
will be handled by simple:

  DEPEND="dev-python/pyfoo"

which will enforce at least one impl for pyfoo, and pyfoo wrapper will
handle the rest.

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-04-30  5:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-22 10:51 [gentoo-python] python-any-r1: bunch of bugfixes/improvements and dep-checking function Michał Górny
2013-04-22 10:52 ` [gentoo-python] [PATCH 1/4] Make Python checks consistent Michał Górny
2013-04-22 10:52 ` [gentoo-python] [PATCH 2/4] Perform wrapper setup in all codepaths Michał Górny
2013-04-22 10:52 ` [gentoo-python] [PATCH 3/4] Report no matching Python impl properly Michał Górny
2013-04-22 10:52 ` [gentoo-python] [PATCH 4/4] Add python_check_deps() to support testing supported impls Michał Górny
2013-04-30  5:36 ` [gentoo-python] python-any-r1: bunch of bugfixes/improvements and dep-checking function Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox