From 4e5025e068bc5f1431d9fb35e71b03bab0a67880 Mon Sep 17 00:00:00 2001 From: Mohamed Barakat Date: Sun, 7 Apr 2024 07:22:36 +0200 Subject: [PATCH] applied PackageJanitor --- .github/workflows/Tests.yml | 2 +- PackageInfo.g | 4 ++-- dev/.release | 2 +- dev/ci_gaprc | 13 +++---------- dev/release-gap-package | 21 ++++++++++++++------- makefile | 6 ++++++ 6 files changed, 27 insertions(+), 21 deletions(-) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index bd34896..f4844e1 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -61,7 +61,7 @@ jobs: if [ -d "HigherHomologicalAlgebra/ToolsForHigherHomologicalAlgebra" ]; then make -C "HigherHomologicalAlgebra/ToolsForHigherHomologicalAlgebra" doc; fi if [ -d "homalg_project/homalg" ]; then make -C "homalg_project/homalg" doc; fi if [ -d "homalg_project/Modules" ]; then make -C "homalg_project/Modules" doc; fi - if [ -d "CategoricalTowers/CategoryConstructor" ]; then make -C "CategoricalTowers/CategoryConstructor" doc; fi + if [ -d "CategoricalTowers/ToolsForCategoricalTowers" ]; then make -C "CategoricalTowers/ToolsForCategoricalTowers" doc; fi if [ -d "CategoricalTowers/Toposes" ]; then make -C "CategoricalTowers/Toposes" doc; fi - name: Test LoopIntegrals run: | diff --git a/PackageInfo.g b/PackageInfo.g index 3919c0a..0963f59 100644 --- a/PackageInfo.g +++ b/PackageInfo.g @@ -10,7 +10,7 @@ SetPackageInfo( rec( PackageName := "LoopIntegrals", Subtitle := "Compute master integrals using commutative and noncommutative methods from computational algebraic geometry", -Version := "2023.11-04", +Version := "2024.04-01", Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ), @@ -112,7 +112,7 @@ PackageDoc := rec( ), Dependencies := rec( - GAP := ">= 4.12.1", + GAP := ">= 4.13.0", NeededOtherPackages := [ [ "GAPDoc", ">= 1.5" ], [ "MatricesForHomalg", ">= 2023.11-01" ], diff --git a/dev/.release b/dev/.release index 33e96cb..518dacf 100644 --- a/dev/.release +++ b/dev/.release @@ -14,7 +14,7 @@ sed "s;Date := .*;Date := \"$(date -I)\",;" PackageInfo.g > PackageInfo.g.bak mv PackageInfo.g.bak PackageInfo.g # replace links to packages which are possibly referenced in the documentation, keep this in sync with `Tests.yml.j2` -for package in CAP_project/CAP CAP_project/CompilerForCAP CAP_project/MonoidalCategories CAP_project/CartesianCategories CAP_project/FreydCategoriesForCAP HigherHomologicalAlgebra/ToolsForHigherHomologicalAlgebra homalg_project/homalg homalg_project/Modules CategoricalTowers/CategoryConstructor CategoricalTowers/Toposes; do +for package in CAP_project/CAP CAP_project/CompilerForCAP CAP_project/MonoidalCategories CAP_project/CartesianCategories CAP_project/FreydCategoriesForCAP HigherHomologicalAlgebra/ToolsForHigherHomologicalAlgebra homalg_project/homalg homalg_project/Modules CategoricalTowers/ToolsForCategoricalTowers CategoricalTowers/Toposes; do # adjust links to other manuals # Note that we cannot use sed's `-i` option for in-place editing, as diff --git a/dev/ci_gaprc b/dev/ci_gaprc index 3ed9280..3b423e7 100644 --- a/dev/ci_gaprc +++ b/dev/ci_gaprc @@ -1,3 +1,5 @@ +SetUserPreference( "ShortBanners", true ); + # Prefer GAPInfo.UserGapRoot over other package directories to prevent accidentally testing package # versions distributed with GAP. @@ -7,16 +9,7 @@ FORCE_LOADING_FROM_USER_GAP_ROOT := function ( ) package_info := GAPInfo.PackagesInfo.(name); pos := PositionProperty( package_info, info -> StartsWith( info.InstallationPath, GAPInfo.UserGapRoot ) ); if pos <> fail then - # work around https://github.com/gap-system/gap/pull/5178 - if IsBound( GAPInfo.PackagesLoaded.(name) ) then - if StartsWith( GAPInfo.PackagesLoaded.(name)[1], GAPInfo.UserGapRoot ) then - continue; - else - Error( "package already loaded at ", GAPInfo.PackagesLoaded.(name)[1] ); - fi; - else - SetPackagePath( name, package_info[pos].InstallationPath ); - fi; + SetPackagePath( name, package_info[pos].InstallationPath ); fi; od; end; diff --git a/dev/release-gap-package b/dev/release-gap-package index e18b552..1350c4a 100755 --- a/dev/release-gap-package +++ b/dev/release-gap-package @@ -239,7 +239,9 @@ command -v git >/dev/null 2>&1 || error "the 'git' command was not found, please install it" if [ "x$PYTHON" != x ] ; then - : + if ! command -v "$PYTHON" >/dev/null 2>&1; then + error "Could not execute python from PYTHON environment variable" + fi elif command -v python >/dev/null 2>&1; then PYTHON=python elif command -v python3 >/dev/null 2>&1; then @@ -361,6 +363,7 @@ fi # # Determine GitHub repository and username, and the current branch # +if [ $ONLY_TARBALL = no ] ; then notice "Using GitHub repository $REPO" if [ "x$GITHUB_USER" = x ] ; then @@ -371,11 +374,13 @@ if [ "x$GITHUB_USER" = x ] ; then fi notice "Using GitHub username $GITHUB_USER" -if [ "x$ONLY_TARBALL" = xno ] ; then - BRANCH=$(git symbolic-ref -q --short HEAD) - notice "Using branch $BRANCH" +BRANCH=$(git symbolic-ref -q --short HEAD || echo) +if [ "x$BRANCH" = x ] ; then + notice "no branch! Cannot proceed, exiting." + exit 1 +fi +notice "Using branch $BRANCH" fi - ###################################################################### # @@ -507,7 +512,9 @@ find . -name .DS_Store -exec rm -f {} + # * perform additional sanity checks; # * ... if [ "x$RELEASE_SCRIPT" != x ] ; then - . "$RELEASE_SCRIPT" + . "$RELEASE_SCRIPT" + # do not delete the custom release script since it might be reused, for example by additional packages of a monorepo + # if it should be deleted, it can always simply delete itself elif [ -f .release ] ; then . ./.release rm -f .release @@ -715,7 +722,7 @@ fi # BSD and GNU make. for f in ./*/*.htm* ; do sed \ - -e 's;href="../../../doc/;href="https://www.gap-system.org/Manuals/doc/;g' \ + -e 's;href="../../../doc/;href="https://docs.gap-system.org/doc/;g' \ -e 's;href="../../../pkg/GAPDoc[^\/]*/doc/;href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc/doc/;g' \ -e 's;href="../../../pkg/gapdoc[^\/]*/doc/;href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc/doc/;g' \ "$f" > "$f.bak" diff --git a/makefile b/makefile index 6bc3320..f7ac289 100644 --- a/makefile +++ b/makefile @@ -43,6 +43,12 @@ test-notebooks: rm modified_in out modified_out; \ done +update-notebooks: + cd examples/notebooks/; \ + for filename in *.ipynb; do \ + jupyter nbconvert --ExecutePreprocessor.kernel_name=julia-$$(julia -e 'print(VERSION.major); print("."); print(VERSION.minor)') --ExecutePreprocessor.record_timing=False --to notebook --inplace --execute "$$filename"; \ + done + test-spacing: # exit code 1 means no match, which is what we want here (exit code 2 signals an error) grep -R "[^ [\"] " gap/*.gi; test $$? -eq 1 || (echo "Duplicate spaces found" && exit 1)