[v10,11/11] doc: support python3 only
Checks
Commit Message
Changed script to explicitly use python3 only to avoid maintaining python 2
and removed references to python 2 from the documentation.
The deprecation notice for python 2 support has been removed. A section
was added to the rel_notes for this patchset.
Cc: Ray Kinsella <mdr@ashroe.eu>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: John McNamara <john.mcnamara@intel.com>
Cc: Marko Kovacevic <marko.kovacevic@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
---
v10:
- changes to doc/guides/conf.py to only support python3
---
doc/guides/conf.py | 9 ++-------
doc/guides/contributing/coding_style.rst | 2 +-
doc/guides/linux_gsg/sys_reqs.rst | 2 +-
doc/guides/rel_notes/deprecation.rst | 6 ------
doc/guides/rel_notes/release_20_11.rst | 2 ++
5 files changed, 6 insertions(+), 15 deletions(-)
Comments
On Wed, Sep 30, 2020 at 1:45 PM Kevin Laatz <kevin.laatz@intel.com> wrote:
> diff --git a/doc/guides/conf.py b/doc/guides/conf.py
> index 9ebc26ed3f..ef550f68c0 100644
> --- a/doc/guides/conf.py
> +++ b/doc/guides/conf.py
> @@ -1,7 +1,7 @@
> +#!/usr/bin/env python3
> # SPDX-License-Identifier: BSD-3-Clause
> # Copyright(c) 2010-2015 Intel Corporation
>
> -from __future__ import print_function
> from docutils import nodes
> from distutils.version import LooseVersion
> from sphinx import __version__ as sphinx_version
> @@ -13,12 +13,7 @@
> from os.path import dirname
> from os.path import join as path_join
>
> -try:
> - # Python 2.
> - import ConfigParser as configparser
> -except:
> - # Python 3.
> - import configparser
> +import configparser
I am ok with dropping this part: the doc generation with python 2 / an
old sphinx is already broken since 20.02 with meson.
I can give details for people interested.
>
> try:
> import sphinx_rtd_theme
> diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst
> index 0be9546a6a..4fc010ca49 100644
> --- a/doc/guides/contributing/coding_style.rst
> +++ b/doc/guides/contributing/coding_style.rst
> @@ -765,7 +765,7 @@ specializations, run the ``app/test`` binary, and use the ``dump_log_types``
> Python Code
> -----------
>
> -All Python code should work with Python 2.7+ and 3.2+ and be compliant with
> +All Python code should work with 3.2+ and be compliant with
> `PEP8 (Style Guide for Python Code) <https://www.python.org/dev/peps/pep-0008/>`_.
I am for dropping any mention of a version here.
On current HEAD of the main branch, the requirements already ask for a
3.5 version.
I would simply ask for PEP8 compliance in this doc.
Opinion?
>
> The ``pep8`` tool can be used for testing compliance with the guidelines.
> diff --git a/doc/guides/linux_gsg/sys_reqs.rst b/doc/guides/linux_gsg/sys_reqs.rst
> index 6b9f573fce..66d9723dd6 100644
> --- a/doc/guides/linux_gsg/sys_reqs.rst
> +++ b/doc/guides/linux_gsg/sys_reqs.rst
> @@ -47,7 +47,7 @@ Compilation of the DPDK
>
> * Python v3.5+ is needed to build DPDK using meson and ninja
>
> - * Python 2.7+ or 3.2+, to use various helper scripts included in the DPDK package.
> + * Python 3.2+, to use various helper scripts included in the DPDK package.
Dropped this hunk, as it has already been updated with the "make
removal" series.
On 02/10/2020 12:01, David Marchand wrote:
> On Wed, Sep 30, 2020 at 1:45 PM Kevin Laatz <kevin.laatz@intel.com> wrote:
>
[...]
>> try:
>> import sphinx_rtd_theme
>> diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst
>> index 0be9546a6a..4fc010ca49 100644
>> --- a/doc/guides/contributing/coding_style.rst
>> +++ b/doc/guides/contributing/coding_style.rst
>> @@ -765,7 +765,7 @@ specializations, run the ``app/test`` binary, and use the ``dump_log_types``
>> Python Code
>> -----------
>>
>> -All Python code should work with Python 2.7+ and 3.2+ and be compliant with
>> +All Python code should work with 3.2+ and be compliant with
>> `PEP8 (Style Guide for Python Code) <https://www.python.org/dev/peps/pep-0008/>`_.
> I am for dropping any mention of a version here.
> On current HEAD of the main branch, the requirements already ask for a
> 3.5 version.
> I would simply ask for PEP8 compliance in this doc.
>
> Opinion?
>
+1 That was something i concidered while making the patch - saves
someone maitaining the versions here in future.
- Kevin
On Fri, Oct 02, 2020 at 01:01:13PM +0200, David Marchand wrote:
> On Wed, Sep 30, 2020 at 1:45 PM Kevin Laatz <kevin.laatz@intel.com> wrote:
> > diff --git a/doc/guides/conf.py b/doc/guides/conf.py
> > index 9ebc26ed3f..ef550f68c0 100644
> > --- a/doc/guides/conf.py
> > +++ b/doc/guides/conf.py
> > @@ -1,7 +1,7 @@
> > +#!/usr/bin/env python3
> > # SPDX-License-Identifier: BSD-3-Clause
> > # Copyright(c) 2010-2015 Intel Corporation
> >
> > -from __future__ import print_function
> > from docutils import nodes
> > from distutils.version import LooseVersion
> > from sphinx import __version__ as sphinx_version
> > @@ -13,12 +13,7 @@
> > from os.path import dirname
> > from os.path import join as path_join
> >
> > -try:
> > - # Python 2.
> > - import ConfigParser as configparser
> > -except:
> > - # Python 3.
> > - import configparser
> > +import configparser
>
> I am ok with dropping this part: the doc generation with python 2 / an
> old sphinx is already broken since 20.02 with meson.
> I can give details for people interested.
>
I'm ok with this. I suspect most non-developers of DPDK just use the
published docs on the website.
>
> >
> > try:
> > import sphinx_rtd_theme
> > diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst
> > index 0be9546a6a..4fc010ca49 100644
> > --- a/doc/guides/contributing/coding_style.rst
> > +++ b/doc/guides/contributing/coding_style.rst
> > @@ -765,7 +765,7 @@ specializations, run the ``app/test`` binary, and use the ``dump_log_types``
> > Python Code
> > -----------
> >
> > -All Python code should work with Python 2.7+ and 3.2+ and be compliant with
> > +All Python code should work with 3.2+ and be compliant with
> > `PEP8 (Style Guide for Python Code) <https://www.python.org/dev/peps/pep-0008/>`_.
>
> I am for dropping any mention of a version here.
> On current HEAD of the main branch, the requirements already ask for a
> 3.5 version.
> I would simply ask for PEP8 compliance in this doc.
>
> Opinion?
>
Ok with this too.
@@ -1,7 +1,7 @@
+#!/usr/bin/env python3
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2010-2015 Intel Corporation
-from __future__ import print_function
from docutils import nodes
from distutils.version import LooseVersion
from sphinx import __version__ as sphinx_version
@@ -13,12 +13,7 @@
from os.path import dirname
from os.path import join as path_join
-try:
- # Python 2.
- import ConfigParser as configparser
-except:
- # Python 3.
- import configparser
+import configparser
try:
import sphinx_rtd_theme
@@ -765,7 +765,7 @@ specializations, run the ``app/test`` binary, and use the ``dump_log_types``
Python Code
-----------
-All Python code should work with Python 2.7+ and 3.2+ and be compliant with
+All Python code should work with 3.2+ and be compliant with
`PEP8 (Style Guide for Python Code) <https://www.python.org/dev/peps/pep-0008/>`_.
The ``pep8`` tool can be used for testing compliance with the guidelines.
@@ -47,7 +47,7 @@ Compilation of the DPDK
* Python v3.5+ is needed to build DPDK using meson and ninja
- * Python 2.7+ or 3.2+, to use various helper scripts included in the DPDK package.
+ * Python 3.2+, to use various helper scripts included in the DPDK package.
* Meson (version 0.47.1+) and ninja
@@ -308,12 +308,6 @@ Deprecation Notices
In this case the function will return -1 unless the environment is unset first
(using ``rte_power_unset_env``). Other function usage scenarios will not change.
-* python: Since the beginning of 2020, Python 2 has officially reached
- end-of-support: https://www.python.org/doc/sunset-python-2/.
- Python 2 support will be completely removed in 20.11.
- In 20.08, explicit deprecation warnings will be displayed when running
- scripts with Python 2.
-
* dpdk-setup.sh: This old script relies on deprecated stuff, and especially
``make``. Given environments are too much variables for such a simple script,
it will be removed in DPDK 20.11.
@@ -68,6 +68,8 @@ Removed Items
Also, make sure to start the actual text at the margin.
=======================================================
+* Removed python 2 support since it was EOL'd in January 2020.
+
API Changes
-----------