Browse Source

Update python references to python3

Python2 is end-of-life [1] since the 1st of January 2020.

Some distributions (most notably: Debian and its derivatives) will stop
providing a `python` executable in order to encourage users to specify
the interpreter language of local scripts explicitly.  Users of such
environments will be forced to work around this in one of these ways:

* create a virtual environment or
* manipulate the shebangs of the scripts or
* install the python2 package (as long as it is provided by distributions)

All currently maintained distribution releases provide python3.
In the near future distributions will need to remove python2, since it
is not maintained anymore.

PEP-394 [2] recommends to reference a specific python version
(python2 or python3), if the script is not expected to run in a virtual
environment.

Closes: #1265

[1] https://www.python.org/dev/peps/pep-0373/#update-april-2014
[2] https://www.python.org/dev/peps/pep-0394/#for-python-script-publishers

Amended-by: Karl Palsson <karlp@tweak.net.au>
* moved lpc43xx scripts to explicitly call python2, they have not been
  ported, and are effectively unmaintained, but switching them to
  python3 unconditionally would be unhelpful.
pull/1274/head
Lars Kruse 4 years ago
committed by Karl Palsson
parent
commit
5968b8a856
  1. 6
      README.md
  2. 2
      scripts/data/lpc43xx/csv2yaml.py
  3. 2
      scripts/data/lpc43xx/gen.py
  4. 2
      scripts/gendoxylayout.py
  5. 2
      scripts/genlink.py
  6. 2
      scripts/irq2nvic_h
  7. 2
      scripts/lpcvtcksum

6
README.md

@ -62,12 +62,12 @@ Building requires Python (some code is generated).
Download and install:
- msys - http://sourceforge.net/projects/mingw/files/MSYS/Base/msys-core/msys-1.0.11/MSYS-1.0.11.exe
- Python - http://www.python.org/ftp/python/2.7/python-2.7.msi (any 2.7 release)
- Python - https://www.python.org/downloads/windows/ (any release)
- arm-none-eabi/arm-elf toolchain (for example this one https://launchpad.net/gcc-arm-embedded)
Run msys shell and set the path without standard Windows paths, so Windows programs such as 'find' won't interfere:
Run msys shell and set the path without standard Windows paths (adjusting to your version of Python), so Windows programs such as 'find' won't interfere:
export PATH="/c//Python27:/c/ARMToolchain/bin:/usr/local/bin:/usr/bin:/bin"
export PATH="/c//Program Files/Python 3.9:/c/ARMToolchain/bin:/usr/local/bin:/usr/bin:/bin"
After that you can navigate to the folder where you've extracted libopencm3 and build it.

2
scripts/data/lpc43xx/csv2yaml.py

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
import sys
import yaml

2
scripts/data/lpc43xx/gen.py

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2
import sys
import yaml

2
scripts/gendoxylayout.py

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# This python program generates parameters for the linker script generator feature.
# This file is part of the libopencm3 project.

2
scripts/genlink.py

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# This python program generates parameters for the linker script generator feature.
# This file is part of the libopencm3 project.

2
scripts/irq2nvic_h

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# This file is part of the libopencm3 project.
#

2
scripts/lpcvtcksum

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python2
#
# Compute and insert the vector table checksum required for booting the
# LPC43xx and some other NXP ARM microcontrollers.

Loading…
Cancel
Save