From ad2c8f39dd9116f39b3e8edc2dd9708e488e8345 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 25 Nov 2024 13:21:50 +0800 Subject: [PATCH] Move `sage-update-version` to `tools` --- .github/workflows/ci-macos.yml | 4 ++-- .upstream.d/20-github.com-sagemath-sage-releases | 2 +- build/pkgs/configure/SPKG.rst | 2 +- build/pkgs/sage_conf/version_requirements.txt | 2 +- build/pkgs/sage_docbuild/version_requirements.txt | 2 +- build/pkgs/sage_setup/version_requirements.txt | 2 +- build/pkgs/sage_sws2rst/version_requirements.txt | 2 +- build/pkgs/sagelib/version_requirements.txt | 2 +- build/pkgs/sagemath_bliss/version_requirements.txt | 2 +- .../pkgs/sagemath_categories/version_requirements.txt | 2 +- build/pkgs/sagemath_coxeter3/version_requirements.txt | 2 +- .../pkgs/sagemath_environment/version_requirements.txt | 2 +- build/pkgs/sagemath_mcqd/version_requirements.txt | 2 +- build/pkgs/sagemath_meataxe/version_requirements.txt | 2 +- build/pkgs/sagemath_objects/version_requirements.txt | 2 +- build/pkgs/sagemath_repl/version_requirements.txt | 2 +- build/pkgs/sagemath_sirocco/version_requirements.txt | 2 +- build/pkgs/sagemath_tdlib/version_requirements.txt | 2 +- src/bin/sage-version.sh | 2 +- src/doc/en/developer/packaging_sage_library.rst | 2 +- src/doc/en/website/versions.txt | 4 ++-- src/sage/version.py | 8 ++++---- src/setup.cfg.m4 | 1 - tools/README.md | 10 ++++++++++ src/bin/sage-update-version => tools/update-version | 10 +++++----- 25 files changed, 42 insertions(+), 33 deletions(-) rename src/bin/sage-update-version => tools/update-version (94%) mode change 100755 => 100644 diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index c62d259c286..b55ac11ed2c 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -84,14 +84,14 @@ jobs: run: | sudo DEBIAN_FRONTEND=noninteractive apt-get update sudo DEBIAN_FRONTEND=noninteractive apt-get install $(build/bin/sage-get-system-packages debian _bootstrap) - - name: Bootstrap with sage-update-version + - name: Bootstrap with update-version # We set SAGE_ROOT and SAGE_SRC by hand # because 'sage -sh' does not work with an unconfigured tree, # giving: Error: SAGE_SCRIPTS_DIR is set to a bad value run: | git config --global user.email "nobody@example.com" git config --global user.name "Sage GitHub CI" - SAGE_ROOT=. SAGE_SRC=./src src/bin/sage-update-version $(cat src/VERSION.txt).dev0 || echo "(ignoring error)" + SAGE_ROOT=. SAGE_SRC=./src tools/update-version $(cat src/VERSION.txt).dev0 || echo "(ignoring error)" - name: make dist run: | ./configure --enable-download-from-upstream-url && make dist diff --git a/.upstream.d/20-github.com-sagemath-sage-releases b/.upstream.d/20-github.com-sagemath-sage-releases index 399ee84dbd6..e41be3ca736 100644 --- a/.upstream.d/20-github.com-sagemath-sage-releases +++ b/.upstream.d/20-github.com-sagemath-sage-releases @@ -1,5 +1,5 @@ # Upstream packages as uploaded as GitHub release assets. -# This file is automatically updated by the sage-update-version script. +# This file is automatically updated by the update-version script. https://github.com/sagemath/sage/releases/download/10.5/ https://github.com/sagemath/sage/releases/download/10.4/ https://github.com/sagemath/sage/releases/download/10.3/ diff --git a/build/pkgs/configure/SPKG.rst b/build/pkgs/configure/SPKG.rst index 6b1365806d0..5a718d0dd06 100644 --- a/build/pkgs/configure/SPKG.rst +++ b/build/pkgs/configure/SPKG.rst @@ -24,5 +24,5 @@ Special Update/Build Instructions --------------------------------- This tarball is automatically generated by Sage whenever you run the -$SAGE_ROOT/bootstrap -s or the $SAGE_ROOT/src/bin/sage-update-version +$SAGE_ROOT/bootstrap -s or the $SAGE_ROOT/tools/update-version script. diff --git a/build/pkgs/sage_conf/version_requirements.txt b/build/pkgs/sage_conf/version_requirements.txt index 9d4b482d5a4..ce133fce2dc 100644 --- a/build/pkgs/sage_conf/version_requirements.txt +++ b/build/pkgs/sage_conf/version_requirements.txt @@ -1,2 +1,2 @@ -# This file is updated on every release by the sage-update-version script +# This file is updated on every release by the update-version script sage-conf ~= 10.5rc1 diff --git a/build/pkgs/sage_docbuild/version_requirements.txt b/build/pkgs/sage_docbuild/version_requirements.txt index cc82b61571d..43054d48c13 100644 --- a/build/pkgs/sage_docbuild/version_requirements.txt +++ b/build/pkgs/sage_docbuild/version_requirements.txt @@ -1,2 +1,2 @@ -# This file is updated on every release by the sage-update-version script +# This file is updated on every release by the update-version script sage-docbuild ~= 10.5rc1 diff --git a/build/pkgs/sage_setup/version_requirements.txt b/build/pkgs/sage_setup/version_requirements.txt index 1ff54dc7d60..eab811d6645 100644 --- a/build/pkgs/sage_setup/version_requirements.txt +++ b/build/pkgs/sage_setup/version_requirements.txt @@ -1,2 +1,2 @@ -# This file is updated on every release by the sage-update-version script +# This file is updated on every release by the update-version script sage-setup ~= 10.5rc1 diff --git a/build/pkgs/sage_sws2rst/version_requirements.txt b/build/pkgs/sage_sws2rst/version_requirements.txt index 1c2539d939c..bdd88e81704 100644 --- a/build/pkgs/sage_sws2rst/version_requirements.txt +++ b/build/pkgs/sage_sws2rst/version_requirements.txt @@ -1,2 +1,2 @@ -# This file is updated on every release by the sage-update-version script +# This file is updated on every release by the update-version script sage-sws2rst ~= 10.5rc1 diff --git a/build/pkgs/sagelib/version_requirements.txt b/build/pkgs/sagelib/version_requirements.txt index 43b9a42f129..b9536ef8f08 100644 --- a/build/pkgs/sagelib/version_requirements.txt +++ b/build/pkgs/sagelib/version_requirements.txt @@ -1,2 +1,2 @@ -# This file is updated on every release by the sage-update-version script +# This file is updated on every release by the update-version script sagemath-standard ~= 10.5rc1 diff --git a/build/pkgs/sagemath_bliss/version_requirements.txt b/build/pkgs/sagemath_bliss/version_requirements.txt index 2368924f603..dac68e92258 100644 --- a/build/pkgs/sagemath_bliss/version_requirements.txt +++ b/build/pkgs/sagemath_bliss/version_requirements.txt @@ -1,2 +1,2 @@ -# This file is updated on every release by the sage-update-version script +# This file is updated on every release by the update-version script sagemath-bliss ~= 10.5rc1 diff --git a/build/pkgs/sagemath_categories/version_requirements.txt b/build/pkgs/sagemath_categories/version_requirements.txt index 12dbd988f69..f84e05cdd5c 100644 --- a/build/pkgs/sagemath_categories/version_requirements.txt +++ b/build/pkgs/sagemath_categories/version_requirements.txt @@ -1,2 +1,2 @@ -# This file is updated on every release by the sage-update-version script +# This file is updated on every release by the update-version script sagemath-categories ~= 10.5rc1 diff --git a/build/pkgs/sagemath_coxeter3/version_requirements.txt b/build/pkgs/sagemath_coxeter3/version_requirements.txt index 68b68b8849a..11a265f9bab 100644 --- a/build/pkgs/sagemath_coxeter3/version_requirements.txt +++ b/build/pkgs/sagemath_coxeter3/version_requirements.txt @@ -1,2 +1,2 @@ -# This file is updated on every release by the sage-update-version script +# This file is updated on every release by the update-version script sagemath-coxeter3 ~= 10.5rc1 diff --git a/build/pkgs/sagemath_environment/version_requirements.txt b/build/pkgs/sagemath_environment/version_requirements.txt index 90066e303ad..0dd9dab8f9d 100644 --- a/build/pkgs/sagemath_environment/version_requirements.txt +++ b/build/pkgs/sagemath_environment/version_requirements.txt @@ -1,2 +1,2 @@ -# This file is updated on every release by the sage-update-version script +# This file is updated on every release by the update-version script sagemath-environment ~= 10.5rc1 diff --git a/build/pkgs/sagemath_mcqd/version_requirements.txt b/build/pkgs/sagemath_mcqd/version_requirements.txt index f41ce17c20b..d898e46e81b 100644 --- a/build/pkgs/sagemath_mcqd/version_requirements.txt +++ b/build/pkgs/sagemath_mcqd/version_requirements.txt @@ -1,2 +1,2 @@ -# This file is updated on every release by the sage-update-version script +# This file is updated on every release by the update-version script sagemath-mcqd ~= 10.5rc1 diff --git a/build/pkgs/sagemath_meataxe/version_requirements.txt b/build/pkgs/sagemath_meataxe/version_requirements.txt index f8304228dbc..e4171f0160f 100644 --- a/build/pkgs/sagemath_meataxe/version_requirements.txt +++ b/build/pkgs/sagemath_meataxe/version_requirements.txt @@ -1,2 +1,2 @@ -# This file is updated on every release by the sage-update-version script +# This file is updated on every release by the update-version script sagemath-meataxe ~= 10.5rc1 diff --git a/build/pkgs/sagemath_objects/version_requirements.txt b/build/pkgs/sagemath_objects/version_requirements.txt index 990a0601e08..ed101e6f03e 100644 --- a/build/pkgs/sagemath_objects/version_requirements.txt +++ b/build/pkgs/sagemath_objects/version_requirements.txt @@ -1,2 +1,2 @@ -# This file is updated on every release by the sage-update-version script +# This file is updated on every release by the update-version script sagemath-objects ~= 10.5rc1 diff --git a/build/pkgs/sagemath_repl/version_requirements.txt b/build/pkgs/sagemath_repl/version_requirements.txt index 7ab5cec5f5b..607c729e60e 100644 --- a/build/pkgs/sagemath_repl/version_requirements.txt +++ b/build/pkgs/sagemath_repl/version_requirements.txt @@ -1,2 +1,2 @@ -# This file is updated on every release by the sage-update-version script +# This file is updated on every release by the update-version script sagemath-repl ~= 10.5rc1 diff --git a/build/pkgs/sagemath_sirocco/version_requirements.txt b/build/pkgs/sagemath_sirocco/version_requirements.txt index 0863567dacc..bf1a96af3ca 100644 --- a/build/pkgs/sagemath_sirocco/version_requirements.txt +++ b/build/pkgs/sagemath_sirocco/version_requirements.txt @@ -1,2 +1,2 @@ -# This file is updated on every release by the sage-update-version script +# This file is updated on every release by the update-version script sagemath-sirocco ~= 10.5rc1 diff --git a/build/pkgs/sagemath_tdlib/version_requirements.txt b/build/pkgs/sagemath_tdlib/version_requirements.txt index 847534f161e..5538b58a5f3 100644 --- a/build/pkgs/sagemath_tdlib/version_requirements.txt +++ b/build/pkgs/sagemath_tdlib/version_requirements.txt @@ -1,2 +1,2 @@ -# This file is updated on every release by the sage-update-version script +# This file is updated on every release by the update-version script sagemath-tdlib ~= 10.5rc1 diff --git a/src/bin/sage-version.sh b/src/bin/sage-version.sh index bafb8fc6368..8d5280271fa 100644 --- a/src/bin/sage-version.sh +++ b/src/bin/sage-version.sh @@ -3,7 +3,7 @@ # #31049: The following line is valid shell code but not valid Python code, # which stops "setup.py develop" from rewriting it as a Python file. : -# This file is auto-generated by the sage-update-version script, do not edit! +# This file is auto-generated by the update-version script, do not edit! SAGE_VERSION='10.5.rc1' SAGE_RELEASE_DATE='2024-11-23' SAGE_VERSION_BANNER='SageMath version 10.5.rc1, Release Date: 2024-11-23' diff --git a/src/doc/en/developer/packaging_sage_library.rst b/src/doc/en/developer/packaging_sage_library.rst index 9fbb4271727..206c47da85e 100644 --- a/src/doc/en/developer/packaging_sage_library.rst +++ b/src/doc/en/developer/packaging_sage_library.rst @@ -186,7 +186,7 @@ The source directory of a distribution package, such as in :sage_root:`src` - ``VERSION.txt`` -- package version. This file is updated by the release manager by - running the ``sage-update-version`` script. + running the ``update-version`` script. Sometimes it may be necessary to upload a hotfix for a distribution package to PyPI. These should be marked by adding a suffix diff --git a/src/doc/en/website/versions.txt b/src/doc/en/website/versions.txt index 12aed2b8cfe..1cf0945ddc0 100644 --- a/src/doc/en/website/versions.txt +++ b/src/doc/en/website/versions.txt @@ -1,10 +1,10 @@ # This file is used by the version selector of the Sage doc -# and updated by the script src/bin/sage-update-version +# and updated by the script tools/update-version # # The lines are for recent stable releases (at most 10 lines) # A line consists of the version and the URL to the doc # -# The sage-update-version script adds a new line for a new stable release +# The update-version script adds a new line for a new stable release # when run by the Sage release manager to prepare a new release # 10.4 doc-10-4--sagemath.netlify.app diff --git a/src/sage/version.py b/src/sage/version.py index eeb9eae6692..d341bc8d847 100644 --- a/src/sage/version.py +++ b/src/sage/version.py @@ -1,5 +1,5 @@ # Sage version information for Python scripts -# This file is auto-generated by the sage-update-version script, do not edit! -version = '10.5.rc1' -date = '2024-11-23' -banner = 'SageMath version 10.5.rc1, Release Date: 2024-11-23' +# This file is auto-generated by the update-version script, do not edit! +version = "10.5.rc1" +date = "2024-11-23" +banner = "SageMath version 10.5.rc1, Release Date: 2024-11-23" diff --git a/src/setup.cfg.m4 b/src/setup.cfg.m4 index 969793209c8..3d12038c524 100644 --- a/src/setup.cfg.m4 +++ b/src/setup.cfg.m4 @@ -88,7 +88,6 @@ scripts = bin/sage-run bin/sage-run-cython bin/sage-startuptime.py - bin/sage-update-version [options.package_data] diff --git a/tools/README.md b/tools/README.md index b0c2e4bb68b..e640b79c274 100644 --- a/tools/README.md +++ b/tools/README.md @@ -11,3 +11,13 @@ Within an active virtual environment where Meson is installed, run the following ```bash tools/update_meson.py ``` + +## Update Version Number + +Increments the version number in the project. This command is useful when releasing a new version of the project. + +Set `SAGE_ROOT` to the root directory of the Sage project and run the following command: + +```bash +tools/update_version +``` diff --git a/src/bin/sage-update-version b/tools/update-version old mode 100755 new mode 100644 similarity index 94% rename from src/bin/sage-update-version rename to tools/update-version index 179461a8340..3a77b6afba8 --- a/src/bin/sage-update-version +++ b/tools/update-version @@ -26,7 +26,7 @@ if [ -z "$SAGE_ROOT" ]; then fi if [ -z "$SAGE_SRC" ]; then - die "must be run from within a Sage environment, or with SAGE_SRC provided" + SAGE_SRC="$SAGE_ROOT/src" fi set -e @@ -46,7 +46,7 @@ done # Update version_requirements.txt for all distribution packages ( cd "$SAGE_ROOT"/build/pkgs/ && for spkg in sage*; do if [ -f "$spkg"/version_requirements.txt -a -d "$spkg"/src ]; then - ( echo "# This file is updated on every release by the sage-update-version script" + ( echo "# This file is updated on every release by the update-version script" # Normalize the package name to PyPI convention (dashes, not underscores) if [ "$spkg" = sagelib ]; then pkg=sagemath-standard @@ -65,7 +65,7 @@ done # Update Sage version file for Python in SAGE_SRC/sage cat < "$SAGE_SRC/sage/version.py" # Sage version information for Python scripts -# This file is auto-generated by the sage-update-version script, do not edit! +# This file is auto-generated by the update-version script, do not edit! version = '$SAGE_VERSION' date = '$SAGE_RELEASE_DATE' banner = '$SAGE_VERSION_BANNER' @@ -78,7 +78,7 @@ cat < "$SAGE_SRC/bin/sage-version.sh" # #31049: The following line is valid shell code but not valid Python code, # which stops "setup.py develop" from rewriting it as a Python file. : -# This file is auto-generated by the sage-update-version script, do not edit! +# This file is auto-generated by the update-version script, do not edit! SAGE_VERSION='$SAGE_VERSION' SAGE_RELEASE_DATE='$SAGE_RELEASE_DATE' SAGE_VERSION_BANNER='$SAGE_VERSION_BANNER' @@ -98,7 +98,7 @@ SAGE_MINOR_VERSION=${SAGE_MINOR_VERSION//.rc*/} ) | uniq | head -n 3 > "$SAGE_ROOT/.upstream.d/20-github.com-sagemath-sage-releases.tmp" ( cat < "$SAGE_ROOT/.upstream.d/20-github.com-sagemath-sage-releases"