circuitpython/shared/runtime
Damien George 40047823bc py/modsys: Append MicroPython git version and build date to sys.version.
This commit adds the git hash and build date to sys.version.  This is
allowed according to CPython docs, and is what PyPy does.  The docs state:

    A string containing the version number of the Python interpreter plus
    additional information on the build number and compiler used.

Eg on CPython:

    Python 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sys
    >>> sys.version
    '3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0]'

and PyPy:

    Python 2.7.12 (5.6.0+dfsg-4, Nov 20 2016, 10:43:30)
    [PyPy 5.6.0 with GCC 6.2.0 20161109] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>>> import sys
    >>>> sys.version
    '2.7.12 (5.6.0+dfsg-4, Nov 20 2016, 10:43:30)\n[PyPy 5.6.0 with GCC ...

With this commit on MicroPython we now have:

    MicroPython v1.18-371-g9d08eb024 on 2022-04-28; linux [GCC 11.2.0] v...
    Use Ctrl-D to exit, Ctrl-E for paste mode
    >>> import sys
    >>> sys.version
    '3.4.0; MicroPython v1.18-371-g9d08eb024 on 2022-04-28'

Note that the start of the banner is the same as the end of sys.version.
This helps to keep code size under control because the string can be reused
by the compiler.

Signed-off-by: Damien George <damien@micropython.org>
2022-04-28 15:23:17 +10:00
..
gchelper_generic.c all: Update to point to files in new shared/ directory. 2021-07-12 17:08:10 +10:00
gchelper_m0.s shared: Introduce new top-level dir and move 1st party lib code there. 2021-07-12 17:07:36 +10:00
gchelper_m3.s shared: Introduce new top-level dir and move 1st party lib code there. 2021-07-12 17:07:36 +10:00
gchelper_native.c all: Update to point to files in new shared/ directory. 2021-07-12 17:08:10 +10:00
gchelper.h shared: Introduce new top-level dir and move 1st party lib code there. 2021-07-12 17:07:36 +10:00
interrupt_char.c shared: Introduce new top-level dir and move 1st party lib code there. 2021-07-12 17:07:36 +10:00
interrupt_char.h shared: Introduce new top-level dir and move 1st party lib code there. 2021-07-12 17:07:36 +10:00
mpirq.c all: Update to point to files in new shared/ directory. 2021-07-12 17:08:10 +10:00
mpirq.h shared: Introduce new top-level dir and move 1st party lib code there. 2021-07-12 17:07:36 +10:00
pyexec.c py/modsys: Append MicroPython git version and build date to sys.version. 2022-04-28 15:23:17 +10:00
pyexec.h shared: Introduce new top-level dir and move 1st party lib code there. 2021-07-12 17:07:36 +10:00
semihosting.c shared: Introduce new top-level dir and move 1st party lib code there. 2021-07-12 17:07:36 +10:00
semihosting.h shared: Introduce new top-level dir and move 1st party lib code there. 2021-07-12 17:07:36 +10:00
stdout_helpers.c shared: Introduce new top-level dir and move 1st party lib code there. 2021-07-12 17:07:36 +10:00
sys_stdio_mphal.c shared: Introduce new top-level dir and move 1st party lib code there. 2021-07-12 17:07:36 +10:00