summaryrefslogtreecommitdiffstatshomepage
path: root/py/makeversionhdr.py
Commit message (Collapse)AuthorAge
* py/makeversionhdr.py: Reinstate MICROPY_GIT_HASH in mpversion.h.Damien George2024-02-19
| | | | | | | | MICROPY_GIT_HASH was removed in 69e34b6b6bdf45bc1111777c46839a8b5fcb30bd but it is useful for, and used by, third-party code to tell which hash of MicroPython is used. Signed-off-by: Damien George <damien@micropython.org>
* all: Switch to new preview build versioning scheme.v1.22.0-previewJim Mussared2023-10-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See https://github.com/micropython/micropython/issues/12127 for details. Previously at the point when a release is made, we update mpconfig.h and set a git tag. i.e. the version increments at the release. Now the version increments immediately after the release. The workflow is: 1. Final commit in the cycle updates mpconfig.h to set (X, Y, 0, 0) (i.e. clear the pre-release state). 2. This commit is tagged "vX.Y.0". 3. First commit for the new cycle updates mpconfig.h to set (X, Y+1, 0, 1) (i.e. increment the minor version, set the pre-release state). 4. This commit is tagged "vX.Y+1.0-preview". The idea is that a nightly build is actually a "preview" of the _next_ release. i.e. any documentation describing the current release may not actually match the nightly build. So we use "preview" as our semver pre-release identifier. Changes in this commit: - Add MICROPY_VERSION_PRERELEASE to mpconfig.h to allow indicating that this is not a release version. - Remove unused MICROPY_VERSION integer. - Append "-preview" to MICROPY_VERSION_STRING when the pre-release state is set. - Update py/makeversionhdr.py to no longer generate MICROPY_GIT_HASH. - Remove the one place MICROPY_GIT_HASH was used (it can use MICROPY_GIT_TAG instead). - Update py/makeversionhdr.py to also understand MICROPY_VERSION_PRERELEASE in mpconfig.h. - Update py/makeversionhdr.py to convert the git-describe output into semver-compatible "X.Y.Z-preview.N.gHASH". - Update autobuild.sh to generate filenames using the new scheme. - Update remove_old_firmware.py to match new scheme. - Update mpremote's pyproject.toml to handle the "-preview" suffix in the tag. setuptools_scm maps to this "rc0" to match PEP440. - Fix docs heading where it incorrectly said "vvX.Y.Z" for release docs. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* py/makeversionhdr.py: Always add micro to version string even if it's 0.Damien George2023-03-10
| | | | | | Moving forward, tags in this repository will always have three components. Signed-off-by: Damien George <damien@micropython.org>
* py/makeversionhdr.py: Optionally get git tag and git hash from env vars.David Grayson2023-03-02
| | | | | | | This is handy when you are doing builds outside of the Git repository but still want to record that information. Signed-off-by: David Grayson <davidegrayson@gmail.com>
* py/makeversionhdr.py: Allow running outside of repo.Jim Mussared2022-11-22
| | | | | | | | | | | | | | | If a CMake-build is run with `make BUILD=/outside/path` then makeversionheader.py is run with the CWD set to the build directory, which means the git version lookup will fail and silently fall back to the mpconfig.h mode (giving the wrong result). This commit: - Uses the location of makeversionheader.py to find the repo path. - Allows overriding this path via --repo-path. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* py/makeversionhdr: Fall back to py/mpconfig.h instead of docs/conf.py.Damien George2022-10-27
| | | | | | | | Commit 64af916c111b61bce82c00f356a6b1cb81946d87 removed the version string from docs/conf.py. py/mpconfig.h is a better place to get the version from, so use that (when there is no git repository). Signed-off-by: Damien George <damien@micropython.org>
* py/makeversionhdr: Add --tags arg to git describe.David Lechner2021-07-05
| | | | | | | | | This adds the --tags argument to the git describe command that is used to define the MICROPY_GIT_TAG macro. This makes it match non-annotated tags. This is useful for MicroPython derivatives that don't use annotated tags. Signed-off-by: David Lechner <david@pybricks.com>
* py/makeversionhdr: Honor SOURCE_DATE_EPOCH if present.iTitou2021-01-31
| | | | | | | | | | | This environment variable, if defined during the build process, indicates a fixed time that should be used in place of "now" when such a time is explicitely referenced. This allows for reproducible builds of micropython. See https://reproducible-builds.org/specs/source-date-epoch/ Signed-off-by: iTitou <moiandme@gmail.com>
* py/makeversionhdr.py: Match only git tags which look like versions.Mike Wadsten2020-10-01
| | | | | | | | Some downstream projects may use tags in their repositories for more than just designating MicroPython releases. In those cases, the makeversionhdr.py script would end up using a different tag than intended. So tell `git describe` to only match tags that look like a MicroPython version tag, such as `v1.12` or `v2.0`.
* all: Reformat C and Python source code with tools/codeformat.py.Damien George2020-02-28
| | | | This is run with uncrustify 0.70.1, and black 19.10b0.
* py/mpconfig: Move MICROPY_VERSION macros to static ones in mpconfig.h.Damien George2018-12-22
| | | | | | | It's more robust to have the version defined statically in a header file, rather than dynamically generating it via git using a git tag. In case git doesn't exist, or a different source control tool is used, it's important to still have the uPy version number available.
* py: Use "GEN" consistently for describing files generated in the build.Damien George2018-02-22
|
* py/makeversionhdr.py: Update to parse new release line in docs/conf.py.Damien George2017-07-04
| | | | | The line in docs/conf.py with the release/version number was recently changed and this patch makes the makeversionhdr.py script work again.
* py/makeversionhdr.py: Work with backslashes in paths.omtinez2015-10-30
| | | | | This script may be called by Windows IDEs (e.g. Visual Studio) and be passed paths with backslashes.
* py/makeversionhdr.py: Use returncode attr to be Python2.7 compat.Damien George2015-08-12
|
* py/makeversionhdr.py: Fallback to using docs version if no git repo.Damien George2015-08-11
| | | | Addresses issue #1420.
* py: Get makeqstrdata.py and makeversionhdr.py running under Python 2.6.Damien George2015-05-30
| | | | | These scripts should run under as wide a range of Python versions as possible.
* py: Make makeversionhdr.py extract version from docs/conf.py if no git.Damien George2015-05-25
| | | | Addresses issue #1285.
* py: Replace py-version.sh with makeversionhdr.py, written in Python.Damien George2015-04-28
Also rename py-version.h to mpversion.h for consistency with mpconfig.h.