Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 628378

Summary: dev-python/typing - provide virtual/python-typing package
Product: Gentoo Linux Reporter: Coacher <itumaykin+gentoo>
Component: Current packagesAssignee: Alex Brandt (RETIRED) <alunduil>
Status: RESOLVED FIXED    
Severity: normal CC: mgorny, python
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://github.com/gentoo/gentoo/pull/5708
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 628380    

Description Coacher 2017-08-20 14:00:43 UTC
Hello.

AFAIU dev-python/typing is a backport of built-in functionality from Python-3.5 and onwards to older Python versions. Without virtual one has to create rather complex dependencies in packages that support multiple Python versions, e.g. 2.7, 3.4 and 3.5.

Please provide virtual/python-typing similarly how we have virtual/python-pathlib, virtual/python-futures, etc.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-08-20 16:06:48 UTC
Could you do the background check on it and elaborate how it's supposed to be used? In particular:

a. whether the module is useful for all versions of Python or only <3.5,

b. whether packages can just 'import foo' that works with any version of Python, or if they need to do some magical conditionals to support both the backport and core Python.
Comment 2 Coacher 2017-08-20 23:00:51 UTC
(In reply to Michał Górny from comment #1)
> a. whether the module is useful for all versions of Python or only <3.5,
Only for python<3.5. It's a part of standard library in python>=3.5:
https://docs.python.org/3/library/typing.html
https://www.python.org/dev/peps/pep-0484/

> b. whether packages can just 'import foo' that works with any version of
> Python, or if they need to do some magical conditionals to support both the
> backport and core Python.
I can confirm `import typing' works on 2.7 and 3.4 with dev-python/typing installed. You can confirm yourself whether `import typing' works without dev-python/typing in unstable pythons 3.5 and 3.6.
Comment 3 Larry the Git Cow gentoo-dev 2017-09-29 09:20:59 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e0282a7a71e2dc0d35f67f7381b672d8f379581b

commit e0282a7a71e2dc0d35f67f7381b672d8f379581b
Author:     Ilya Tumaykin <itumaykin@gmail.com>
AuthorDate: 2017-09-15 16:21:51 +0000
Commit:     Patrice Clement <monsieurp@gentoo.org>
CommitDate: 2017-09-29 09:20:51 +0000

    virtual/python-typing: new virtual for the Python typing module.
    
    This module is shipped with >=dev-lang/python-3.5.
    dev-python/typing provides a backport for Pythons that don't have it.
    KEYWORDS are intersection of dev-python/typing and dev-lang/python.
    
    Closes: https://bugs.gentoo.org/628378
    Package-Manager: Portage-2.3.8, Repoman-2.3.3

 virtual/python-typing/metadata.xml           |  8 ++++++++
 virtual/python-typing/python-typing-0.ebuild | 17 +++++++++++++++++
 2 files changed, 25 insertions(+)