Skip to content

Commit

Permalink
Doc: Use python3 for executable rather than python (fixes OSGeo#7383)
Browse files Browse the repository at this point in the history
* This changes everything in doc folder
* It should be validated by maintainers to not break anything
* code blocks are unchanged since it's assumed they are all in python3

Signed-off-by: Ryan Friedman <ryan.friedman.con@avinc.com>
  • Loading branch information
Ryan Friedman committed Mar 9, 2023
1 parent 29b6d23 commit 8394cee
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 15 deletions.
6 changes: 3 additions & 3 deletions HOWTO-RELEASE
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Process :
git log --reverse -v v3.4.0..HEAD . ":(exclude)autotest" ":(exclude)doc" ":(exclude).github"

For a feature release, e.g 3.6.0, you can use scripts/generate_log_feature_release.py to generate a log without commit that went in the previous 3.5.x bugfix releases with:
python scripts/generate_log_feature_release.py
python3 scripts/generate_log_feature_release.py

- commit new version to NEWS.md file.

Expand Down Expand Up @@ -212,7 +212,7 @@ the GDAL package by one of the current owners : HowardB/FrankW/EvenR)

b) cd $BUILD_DIR/swig/python

c) python setup.py sdist
c) python3 setup.py sdist

d) Check the output:
twine check dist/GDAL-*.gz
Expand All @@ -227,7 +227,7 @@ the GDAL package by one of the current owners : HowardB/FrankW/EvenR)

a) cd $BUILD_DIR/swig/python/gdal-utils

b) python setup.py bdist_wheel
b) python3 setup.py bdist_wheel

c) Check the output:
twine check dist/gdal_utils-*.whl
Expand Down
7 changes: 4 additions & 3 deletions doc/source/api/python_bindings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ be greatly helpful for beginners with GDAL/OGR in Python.




A cookbook full of recipes for using the Python GDAL/OGR bindings : `http://pcjericks.github.io/py-gdalogr-cookbook/index.html <http://pcjericks.github.io/py-gdalogr-cookbook/index.html>`__

Examples
Expand Down Expand Up @@ -99,14 +100,14 @@ After modifying the location of gdal-config, you can build and install with the

.. code-block:: Bash
$ python setup.py build
$ python setup.py install
$ python3 setup.py build
$ python3 setup.py install
If you have setuptools installed, you can also generate an egg:

.. code-block:: Bash
$ python setup.py bdist_egg
$ python3 setup.py bdist_egg
Expand Down
6 changes: 3 additions & 3 deletions doc/source/development/building_from_source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2149,19 +2149,19 @@ the ``install`` CMake target.

This option can be specified to a directory name, to override the
``CMAKE_INSTALL_PREFIX`` option.
It is used to set the value of the ``--prefix`` option of ``python setup.py install``.
It is used to set the value of the ``--prefix`` option of ``python3 setup.py install``.

.. option:: GDAL_PYTHON_INSTALL_LAYOUT

This option can be specified to set the value of the ``--install-layout``
option of ``python setup.py install``. The install layout is by default set to
option of ``python3 setup.py install``. The install layout is by default set to
``deb`` when it is detected that the Python installation looks for
the ``site-packages`` subdirectory. Otherwise it is unspecified.

.. option:: GDAL_PYTHON_INSTALL_LIB

This option can be specified to set the value of the ``--install-lib``
option of ``python setup.py install``. It is only taken into account on
option of ``python3 setup.py install``. It is only taken into account on
MacOS systems, when the Python installation is a framework.

Java bindings options
Expand Down
2 changes: 1 addition & 1 deletion doc/source/development/dev_practices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ hooks are cloned with the repository and can be installed using

.. code-block:: bash
python -m pip install pre-commit
python3 -m pip install pre-commit
pre-commit install
Expand Down
2 changes: 1 addition & 1 deletion doc/source/drivers/raster/isis3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ For example:

::

$ python
$ python 3
from osgeo import gdal
ds = gdal.Open('../autotest/gdrivers/data/isis3_detached.lbl')
print(ds.GetMetadata_List('json:ISIS3')[0])
Expand Down
2 changes: 1 addition & 1 deletion doc/source/drivers/raster/sentinel2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ Examples

::

$ python -c "import sys; from osgeo import gdal; ds = gdal.Open(sys.argv[1]); open(sys.argv[2], 'wb').write(ds.GetMetadata('xml:VRT')[0].encode('utf-8'))" \
$ python3 -c "import sys; from osgeo import gdal; ds = gdal.Open(sys.argv[1]); open(sys.argv[2], 'wb').write(ds.GetMetadata('xml:VRT')[0].encode('utf-8'))" \
SENTINEL2_L1C:S2A_OPER_MTD_SAFL1C_PDMC_20150818T101440_R022_V20150813T102406_20150813T102406.xml:10m:EPSG_32632 10m.vrt

- Opening the 10 meters resolution bands of a L1B subdataset:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/drivers/raster/vicar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ For example:

::

$ python
$ python3
from osgeo import gdal
ds = gdal.Open('../autotest/gdrivers/data/test_vicar_truncated.bin')
print(ds.GetMetadata_List('json:VICAR')[0])
Expand Down
2 changes: 1 addition & 1 deletion doc/source/drivers/vector/gml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ to import it into PostGIS and

::

python ogr_build_junction_table.py PG:dbname=mydb
python3 ogr_build_junction_table.py PG:dbname=mydb

, a *myfeature_otherfeature* table will be created and will contain the
following content :
Expand Down
2 changes: 1 addition & 1 deletion doc/source/user/gdal_python_utilities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ In your IDE set gdal-utils as the root folder,
launch wrappers created by pip and added to PYTHONHOME/Scripts)

**./osgeo_utils/samples** - working python scripts but not typically
available in path (run them with ``python
available in path (run them with ``python3
path/to/samples/something.py``)

Improve the docs by editing the RST pages in
Expand Down

0 comments on commit 8394cee

Please sign in to comment.