On Sat, Jun 30, 2018, 5:59 AM Miro Hrončok <mhroncok(a)redhat.com> wrote:
During the 3.7 boostrapping of the interstitial sequence of Python 3
packages, I have noticed it includes a lot of packages that are only
intended as Python 3 stdlib backports for older Pythons.
In general, I think this is a good effort however, it's not always
straightforward and not always about python3. There's also at least one
item on your list (simplejson) which should remain packaged in Fedora
because it is useful as more than forwards compatibility.
Here's an example of how you might need to replace "import contextlib2":
contextlib = False
if not hasattr(contextlib, 'nullcontext'):
contextlib = False
if not contextlib:
import contextlib2 as contextlib
For each of these libraries and usages you'll have to:
* identify what facilities of the library are being used by the dependent
* Figure out if those facilities are present in all versions of the stdlib
* Figure out whether the library in question is truly a backport. I'd be
hesitant to replace anything that isn't truly a backport (simplejson
definitely shouldn't be treated as a backport, for instance. mock and
unittest2 maybe shouldn't be treated as backports... If all Michael foord
for his input)
For the latter, the goal is to identify if there's a reason to use the
library for more than just it's API compatibility with newer versions of
python 3. For simplejson, I know that it is faster than the stdlib json
library. It may also have additional API; the stdlib has not pulled the
changes from simplejson back into itself (and, iirc, is now best considered
a fork of simplejson rather than just a copy).
Also, be careful about how you phrase your requests to upstream to merge
your changes. We don't want to annoy upstreams with requests to use
python3 stdlib modules when the backport works just as well for their code
for now as too much of that will turn upstream off of python3 altogether.
is a backport of the standard
library’s contextlib module to earlier Python versions
is a backport of linecache to older
The goal of pathlib2 is to provide a
backport of standard pathlib module which tracks the standard library
module, so all the newest features of the standard pathlib can be used
also on older Python versions.
is a backport of traceback to older
is a backport of the new features
added to the unittest testing framework in Python 2.7 and onwards.
is the externally maintained
development version of the json library included with Python 2.6 and
Python 3.0, but maintains backwards compatibility with Python 2.5.
is a backport of the PEP 362 function
signature features from Python 3.3
is now part of the Python standard
library, available as unittest.mock in Python 3.3 onwards.
Now I see fairly no real reason to have python3-contextlib2,
python3-linecache2 etc. packaged and maintained in Fedora. The only
reason there is that other packages actually depend on them.
I think we should actively change the packages not to depend on those
and eventually get rid of them. This involves changing how upstreams are
using those. Thoughts?
Here is some dependency info:
$ whatrequires python3-contextlib2
$ whatrequires python3-linecache2
$ whatrequires python3-pathlib2
$ whatrequires python3-traceback2
$ whatrequires python3-unittest2
$ whatrequires python3-simplejson
$ whatrequires python3-funcsigs
$ whatrequires python3-mock
...320 source packages buildrequire this one!
python-devel mailing list -- python-devel(a)lists.fedoraproject.org
To unsubscribe send an email to python-devel-leave(a)lists.fedoraproject.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines