aboutsummaryrefslogtreecommitdiffstats
path: root/docbook
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2018-10-13 15:56:02 +0200
committerAnders Broman <a.broman58@gmail.com>2018-11-07 20:46:59 +0000
commite9f7bb512735aeb91a7a3a5fc05840fb2ee27d9e (patch)
tree2851b89e07fe3d7308276624ea9b3dde93103ffc /docbook
parent77114b721d6b8dfb085d13c83c9ef63cda4b8ec2 (diff)
Require Python 3, drop Python 2 support
Python 3 is widely available. All major Linux distributions support it. RHEL is covered via EPEL (which is already required for cmake3). Drop support for Python 2 in order to reduce maintenance costs. The main motivation is being able to simplify the tests. CMake is updated to search for Python >= 3.4 and will fail if unavailable (generating dissectors.c requires Python, so it is quite an important piece to have). The documentation is updated to reflect the Python 3.7 paths used by Chocolatey. Tested the git-review installation instructions in Windows 7 x64 without a previous Chocolatey installation. macOS brew now installs Python 3 (its dependencies are already installed by python@2 for libxml2). The macOS (non-brew variant) is updated to use the official 64-bit installer to install Python 3. Change-Id: I80b1e36957f338e0dad1bfcc173b6418682cddba Reviewed-on: https://code.wireshark.org/review/30192 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'docbook')
-rw-r--r--docbook/wsdg_src/WSDG_chapter_dissection.asciidoc5
-rw-r--r--docbook/wsdg_src/WSDG_chapter_quick_setup.asciidoc12
-rw-r--r--docbook/wsdg_src/WSDG_chapter_sources.asciidoc12
-rw-r--r--docbook/wsdg_src/WSDG_chapter_tests.asciidoc24
-rw-r--r--docbook/wsdg_src/WSDG_chapter_tools.asciidoc24
5 files changed, 33 insertions, 44 deletions
diff --git a/docbook/wsdg_src/WSDG_chapter_dissection.asciidoc b/docbook/wsdg_src/WSDG_chapter_dissection.asciidoc
index 4f6184b69e..5d8cd34f09 100644
--- a/docbook/wsdg_src/WSDG_chapter_dissection.asciidoc
+++ b/docbook/wsdg_src/WSDG_chapter_dissection.asciidoc
@@ -1181,7 +1181,7 @@ It is also COOL to work on a great Open Source project such as the case with
To use the idl2wrs to generate Wireshark dissectors, you need the following:
-* Python must be installed. See link:http://python.org/[]
+* Python must be installed. See link:https://python.org/[]
* `omniidl` from the omniORB package must be available. See link:http://omniorb.sourceforge.net/[]
@@ -1321,8 +1321,7 @@ wireshark_gen.py are residing in the current directory. This may need tweaking
if you place these files somewhere else.
If it complains about being unable to find some modules (e.g. tempfile.py), you
-may want to check if PYTHONPATH is set correctly. On my Linux box, it is
-PYTHONPATH=/usr/lib/python2.4/
+may want to check if PYTHONPATH is set correctly.
// End of WSDG Chapter Dissection
diff --git a/docbook/wsdg_src/WSDG_chapter_quick_setup.asciidoc b/docbook/wsdg_src/WSDG_chapter_quick_setup.asciidoc
index 04f464cb1b..b556b6c150 100644
--- a/docbook/wsdg_src/WSDG_chapter_quick_setup.asciidoc
+++ b/docbook/wsdg_src/WSDG_chapter_quick_setup.asciidoc
@@ -209,8 +209,8 @@ PS$>cyg-get docbook-xml45 [...]
==== Install Python
-Get the Python 3.5 or 2.7 installer from http://python.org/download/[] and
-install Python into the default location (_C:\Python35_ or _C:\Python27_).
+Get a Python 3.x installer from https://python.org/download/[] and
+install Python into the default location (_C:\Python37_).
Why is this recommended? Cygwin’s _/usr/bin/python_ is a Cygwin-specific
symbolic link which cannot be run from Windows. The native package is faster
@@ -222,13 +222,7 @@ Alternatively you can install Python using Chocolatey:
PS$>choco install -y python3
----
-or
-
-----
-PS$>choco install -y python2
-----
-
-Chocolatey installs Python in _C:\tools\python3_ and _C:\tools\python2_ by default.
+Chocolatey installs Python in _C:\Python37_ by default.
[[ChSetupGit]]
diff --git a/docbook/wsdg_src/WSDG_chapter_sources.asciidoc b/docbook/wsdg_src/WSDG_chapter_sources.asciidoc
index 3ba52dd2c7..74099c23c5 100644
--- a/docbook/wsdg_src/WSDG_chapter_sources.asciidoc
+++ b/docbook/wsdg_src/WSDG_chapter_sources.asciidoc
@@ -166,10 +166,14 @@ To install it from Chocolatey run
+
--
----
-# Make sure "Scripts" is in our path
-PS$>$env:path += ";C:\tools\python2\Scripts"
-PS$>choco install pip
-PS$>choco install git-review -source python
+# If you have not already, install Python 3 first and then *restart* the shell.
+PS$>choco install -y python3
+PS$>choco install -y git-review -source python
+# Make sure that "git-review" is present in our path (edit the version as needed).
+PS$>$userpath = [Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::User)
+PS$>$userpath += ";C:\Python37\Scripts"
+PS$>[Environment]::SetEnvironmentVariable("Path", $userpath, [EnvironmentVariableTarget]::User)
+PS$>RefreshEnv
----
--
diff --git a/docbook/wsdg_src/WSDG_chapter_tests.asciidoc b/docbook/wsdg_src/WSDG_chapter_tests.asciidoc
index 4e90809736..9b6837fbd6 100644
--- a/docbook/wsdg_src/WSDG_chapter_tests.asciidoc
+++ b/docbook/wsdg_src/WSDG_chapter_tests.asciidoc
@@ -73,7 +73,7 @@ path via the `-p` flag:
[source,sh]
----
-$ python test.py -p /path/to/wireshark-build/run
+$ python3 test.py -p /path/to/wireshark-build/run
----
You can list tests by passing one or more complete or partial names to
@@ -82,19 +82,19 @@ You can list tests by passing one or more complete or partial names to
[source,sh]
----
# List all tests
-$ python test.py -l
-$ python test.py -l all
-$ python test.py --list
-$ python test.py --list all
+$ python3 test.py -l
+$ python3 test.py -l all
+$ python3 test.py --list
+$ python3 test.py --list all
# List only tests containing "dumpcap"
-$ python test.py -l dumpcap
+$ python3 test.py -l dumpcap
# List all suites
-$ python test.py --list-suites
+$ python3 test.py --list-suites
# List all suites and cases
-$ python test.py --list-cases
+$ python3 test.py --list-cases
----
If one of the listing flags is not present, tests are run. If no names or `all` is supplied,
@@ -103,14 +103,14 @@ all tests are run. Otherwise tests that match are run.
[source,sh]
----
# Run all tests
-$ python test.py
-$ python test.py all
+$ python3 test.py
+$ python3 test.py all
# Only run tests containing "dumpcap"
-$ python test.py -l dumpcap
+$ python3 test.py -l dumpcap
# Run the "clopts" suite
-$ python test.py suite_clopts
+$ python3 test.py suite_clopts
----
=== Adding Or Modifying Tests
diff --git a/docbook/wsdg_src/WSDG_chapter_tools.asciidoc b/docbook/wsdg_src/WSDG_chapter_tools.asciidoc
index 3c22c75ff7..f834029768 100644
--- a/docbook/wsdg_src/WSDG_chapter_tools.asciidoc
+++ b/docbook/wsdg_src/WSDG_chapter_tools.asciidoc
@@ -64,8 +64,8 @@ PS:\>iex ((new-object net.webclient).DownloadString(_https://chocolatey.org/inst
Chocolatey sometimes installs packages in unexpected locations. Python
is a notable example. While it's typically installed in a top-level
-directory, e.g. _C:\Python27_ or in %PROGRAMFILES%, e.g. _C:\Program
-Files\Python36_, Chocolatey tends to install it under
+directory, e.g. _C:\Python37_ or in %PROGRAMFILES%, e.g. _C:\Program
+Files\Python37_, Chocolatey tends to install it under
_C:\ProgramData\chocolatey_ or _C:\Tools_. If you want to avoid this
behavior you'll probabaly want to install Python using the packages from
python.org.
@@ -677,13 +677,12 @@ Your version string will likely vary.
=== Python
-http://python.org/[Python] is an interpreted programming language. It is
-used to generate some source files, documenation, and other tasks.
-Python 2.5 or later (including Python 3) should work fine and Python 3 is
-recommended. It may be required in the future.
+https://python.org/[Python] is an interpreted programming language. It is
+used to generate some source files, documentation, testing and other tasks.
+Python 3.4 and later is required. Python 2.7 is no longer supported.
Python is either included or available as a package on most UNIX-like platforms.
-Windows packages and source are available at http://python.org/download/[].
+Windows packages and source are available at https://python.org/download/[].
The Cygwin Python package is *not* recommended since _/usr/bin/python_ is
a symbolic link, which causes confusion outside Cygwin.
@@ -694,19 +693,12 @@ You can also use Chocolatey to install Python:
PS:\> choco install Python3
----
-or
-
-[source,cmd]
-----
-PS:\> choco install Python2
-----
-
-Chocolatey installs Python into _C:\tools\python3_ or _C:\tools\python2_ by
+Chocolatey installs Python into _C:\Python37_ by
default. You can verify your Python version by running
[source,sh]
----
-$ python --version
+$ python3 --version
----
on UNIX-like platforms and