On Sat, Jun 30, 2018 at 06:33:22AM -0700, Toshio Kuratomi wrote: > On Sat, Jun 30, 2018, 5:59 AM Miro Hrončok <mhron...@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": > > try: > import contextlib > except ImportError: > contextlib = False > else: > if not hasattr(contextlib, 'nullcontext'): > contextlib = False > if not contextlib: > import contextlib2 as contextlib
That's a generally useful formula if support for diverse python versions is needed. But in Fedora we know that we have python3.7 (assuming that this effort would be directed at F29+), so just the above collapses to just a single import contextlib Not appropriate as an upstream patch of course, but good enough for Fedora. > > https://pypi.org/project/contextlib2/ is a backport of the standard > > library’s contextlib module to earlier Python versions > > > > https://pypi.org/project/linecache2/ is a backport of linecache to older > > supported Pythons. > > > > https://pypi.org/project/pathlib2/ 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. > > > > https://pypi.org/project/traceback2/ is a backport of traceback to older > > supported Pythons. > > > > https://pypi.org/project/unittest2/ is a backport of the new features > > added to the unittest testing framework in Python 2.7 and onwards. > > > > https://pypi.org/project/simplejson/ 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. > > > > https://pypi.org/project/funcsigs/ is a backport of the PEP 362 function > > signature features from Python 3.3 > > > > https://pypi.org/project/mock/ 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? I think it'd be good to start with the most egregious ones (e.g. the ones that "backport" features from python 3.3), and try to kill all dependencies and then the package itself. The nice thing about this problem it can be done piecemeal. > > $ whatrequires python3-mock > > copr-keygen > > module-build-service > > python3-ara-tests > > python3-certbot > > python3-certbot-dns-* > > python3-conda > > python3-congressclient-tests > > python3-keystoneclient-tests > > python3-kubernetes-tests > > python3-magnumclient-tests > > python3-music21 > > python3-netdiff > > python3-octaviaclient-tests > > python3-osc-lib-tests > > python3-oslo-cache-tests > > python3-oslo-log-tests > > python3-oslo-middleware-tests > > python3-oslo-policy-tests > > python3-oslo-rootwrap-tests > > python3-oslo-serialization-tests > > python3-oslo-service-tests > > python3-oslo-versionedobjects > > python3-oslo-vmware-tests > > python3-oslotest > > python3-pytest-spec > > python3-pywbem > > python3-sphinx > > python3-testfixtures-tests > > python3-testify > > python3-testinfra > > python3-tinyrpc-tests > > python3-vcrpy > > waiverdb > > > > ...320 source packages buildrequire this one! For the ones that have the most deps, maybe it would be worth to add all the Provides to python3-libs package? Zbyszek _______________________________________________ python-devel mailing list -- python-devel@lists.fedoraproject.org To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/message/Q7LXDJPQSER74GUIVXCM2OXUKI3R7EXV/