From eb0b003c79d5aa6e72e0878ed9fee350f99733df Mon Sep 17 00:00:00 2001 From: Fabian Zickgraf Date: Thu, 3 Nov 2022 17:11:17 +0100 Subject: [PATCH 1/3] Comply with LinearAlgebraForCAP v2022.10-06 and CAP v2022.11-06 --- PackageInfo.g | 2 +- examples/SymmetricAlgebraInternalToS4rep.g | 4 ++-- examples/notebooks/SymmetricAlgebraInternalToS1rep.ipynb | 4 +++- examples/notebooks/SymmetricAlgebraInternalToS4rep.ipynb | 4 +++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/PackageInfo.g b/PackageInfo.g index cef6ec5..a0cde19 100644 --- a/PackageInfo.g +++ b/PackageInfo.g @@ -85,7 +85,7 @@ PackageDoc := rec( Dependencies := rec( GAP := ">= 4.11.1", NeededOtherPackages := [ [ "GAPDoc", ">= 1.5" ], - [ "CAP", ">= 2022.09-16" ], + [ "CAP", ">= 2022.11-06" ], [ "GradedCategories", ">= 2020.08.24" ], [ "ActionsForCAP", ">= 2020.04.27" ], [ "RingsForHomalg", ">= 2020.09.02" ], diff --git a/examples/SymmetricAlgebraInternalToS4rep.g b/examples/SymmetricAlgebraInternalToS4rep.g index b910539..8534602 100644 --- a/examples/SymmetricAlgebraInternalToS4rep.g +++ b/examples/SymmetricAlgebraInternalToS4rep.g @@ -1,12 +1,12 @@ #! @Chunk SymmetricAlgebraInternalToS4rep -LoadPackage( "InternalModules" ); +LoadPackage( "InternalModules" : OnlyNeeded ); #! @Example srepG := RepresentationCategory( SymmetricGroup( 4 ) ); #! The representation category of SymmetricGroup( [ 1 .. 4 ] ) InfoOfInstalledOperationsOfCategory( srepG ); -#! 46 primitive operations were used to derive 247 operations for +#! 46 primitive operations were used to derive 248 operations for #! this category which algorithmically #! * IsEquippedWithHomomorphismStructure #! * IsAbelianCategory diff --git a/examples/notebooks/SymmetricAlgebraInternalToS1rep.ipynb b/examples/notebooks/SymmetricAlgebraInternalToS1rep.ipynb index 9035b3d..c3f6002 100644 --- a/examples/notebooks/SymmetricAlgebraInternalToS1rep.ipynb +++ b/examples/notebooks/SymmetricAlgebraInternalToS1rep.ipynb @@ -119,11 +119,13 @@ "name": "stdout", "output_type": "stream", "text": [ - "46 primitive operations were used to derive 247 operations for this category which algorithmically\n", + "46 primitive operations were used to derive 343 operations for this category which algorithmically\n", "* IsEquippedWithHomomorphismStructure\n", "* IsAbelianCategory\n", "* IsRigidSymmetricClosedMonoidalCategory\n", "and furthermore mathematically\n", + "* IsFiniteCocompleteCategory (but not yet algorithmically)\n", + "* IsFiniteCompleteCategory (but not yet algorithmically)\n", "* IsSkeletalCategory\n" ] } diff --git a/examples/notebooks/SymmetricAlgebraInternalToS4rep.ipynb b/examples/notebooks/SymmetricAlgebraInternalToS4rep.ipynb index 68f84d5..cb327aa 100644 --- a/examples/notebooks/SymmetricAlgebraInternalToS4rep.ipynb +++ b/examples/notebooks/SymmetricAlgebraInternalToS4rep.ipynb @@ -123,11 +123,13 @@ "name": "stdout", "output_type": "stream", "text": [ - "46 primitive operations were used to derive 247 operations for this category which algorithmically\n", + "46 primitive operations were used to derive 343 operations for this category which algorithmically\n", "* IsEquippedWithHomomorphismStructure\n", "* IsAbelianCategory\n", "* IsRigidSymmetricClosedMonoidalCategory\n", "and furthermore mathematically\n", + "* IsFiniteCocompleteCategory (but not yet algorithmically)\n", + "* IsFiniteCompleteCategory (but not yet algorithmically)\n", "* IsSkeletalCategory\n" ] } From d6e275e71a5b5af85378720b42d01c1a6d2020f4 Mon Sep 17 00:00:00 2001 From: Fabian Zickgraf Date: Thu, 3 Nov 2022 17:50:22 +0100 Subject: [PATCH 2/3] Apply PackageJanitor --- .github/workflows/Tests.yml | 3 +++ PackageInfo.g | 2 +- ci_gaprc | 30 +++++++++++++++++++++++++++--- makefile | 14 +++++++------- upload_codecov.sh | 2 +- 5 files changed, 39 insertions(+), 12 deletions(-) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index fc572b9..6d8b7a5 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -23,6 +23,9 @@ jobs: # keep workflow active even if repository has no activity for 60 days (do not execute for pull requests) - run: '[ "$GITHUB_EVENT_NAME" = "pull_request" ] || curl --fail -X PUT -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/$GITHUB_REPOSITORY/actions/workflows/Tests.yml/enable' - uses: actions/checkout@v3 + with: + # the persisted token interferes with the subsplit token used below + persist-credentials: false - run: cp -a $GITHUB_WORKSPACE /home/gap/.gap/pkg/ - run: | export HOME="/home/gap" diff --git a/PackageInfo.g b/PackageInfo.g index a0cde19..5e20544 100644 --- a/PackageInfo.g +++ b/PackageInfo.g @@ -83,7 +83,7 @@ PackageDoc := rec( ), Dependencies := rec( - GAP := ">= 4.11.1", + GAP := ">= 4.12.1", NeededOtherPackages := [ [ "GAPDoc", ">= 1.5" ], [ "CAP", ">= 2022.11-06" ], [ "GradedCategories", ">= 2020.08.24" ], diff --git a/ci_gaprc b/ci_gaprc index 88fd324..3ed9280 100644 --- a/ci_gaprc +++ b/ci_gaprc @@ -1,12 +1,36 @@ # Prefer GAPInfo.UserGapRoot over other package directories to prevent accidentally testing package # versions distributed with GAP. -(function() + +FORCE_LOADING_FROM_USER_GAP_ROOT := function ( ) local name, package_info, pos; for name in RecNames( GAPInfo.PackagesInfo ) do package_info := GAPInfo.PackagesInfo.(name); pos := PositionProperty( package_info, info -> StartsWith( info.InstallationPath, GAPInfo.UserGapRoot ) ); if pos <> fail then - SetPackagePath( name, package_info[pos].InstallationPath ); + # 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; fi; od; -end)(); +end; + +FORCE_LOADING_FROM_USER_GAP_ROOT( ); + +MakeReadWriteGlobal( "InitializePackagesInfoRecords" ); +FORCE_LOADING_FROM_USER_GAP_ROOT_InitializePackagesInfoRecords_orig := InitializePackagesInfoRecords; +InitializePackagesInfoRecords := function ( args... ) + local old_PackagesInfo; + old_PackagesInfo := GAPInfo.PackagesInfo; + CallFuncList( FORCE_LOADING_FROM_USER_GAP_ROOT_InitializePackagesInfoRecords_orig, args ); + if not IsIdenticalObj( old_PackagesInfo, GAPInfo.PackagesInfo ) then + FORCE_LOADING_FROM_USER_GAP_ROOT( ); + fi; +end; +MakeReadOnlyGlobal( "InitializePackagesInfoRecords" ); diff --git a/makefile b/makefile index 3b2ee48..9a89804 100644 --- a/makefile +++ b/makefile @@ -17,10 +17,10 @@ test: doc gap tst/testall.g test-basic-spacing: - grep -RPl "\t" examples/ gap/ && echo "Tabs found" && exit 1 || exit 0 - grep -RPl "\r" examples/ gap/ && echo "Windows line-endings found" && exit 1 || exit 0 - # the second grep is a hack to fix the exit code with -L for grep <= 3.1 - grep -RPzL "\n\z" examples/ gap/ | grep "" && echo "File with no newline at end of file found" && exit 1 || exit 0 + # exit code 1 means no match, which is what we want here (exit code 2 signals an error) + grep -RPl "\t" examples/ gap/; test $$? -eq 1 || (echo "Tabs found" && exit 1) + grep -RPl "\r" examples/ gap/; test $$? -eq 1 || (echo "Windows line-endings found" && exit 1) + grep -RPzL "\n\z" examples/ gap/ | grep ""; test $$? -eq 1 || (echo "File with no newline at end of file found" && exit 1) test-doc: doc cp -aT doc/ doc_tmp/ @@ -44,12 +44,12 @@ test-notebooks: done test-spacing: - grep -R "[^ [\"] " gap/*.gi && echo "Duplicate spaces found" && exit 1 || exit 0 - grep -RE '[^ ] +$$' gap/* && echo "Trailing whitespace found" && exit 1 || exit 0 + # 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) + grep -RE '[^ ] +$$' gap/*; test $$? -eq 1 || (echo "Trailing whitespace found" && exit 1) for filename in gap/*; do \ echo $$filename; \ gap --quitonbreak --norepl --banner -c "LoadPackage(\"InternalModules\"); SizeScreen([4096]); func := ReadAsFunction(\"$$filename\"); FileString(\"gap_spacing\", DisplayString(func));"; \ - echo -e "\033[0m"; \ # In a perfect world, the DisplayString of a function would exactly match our code. However, our line breaks and indentation might differ from the GAP ones, \ # so we remove all indentation, line breaks, and empty lines, and afterwards insert line breaks at semicolons again for better readability. \ cat "gap_spacing" | tail -n +2 | head -n -2 | sed 's/\[ \]/[ ]/g' | sed 's/( )/( )/g' | sed 's/( :/( :/g' | sed 's/ *$$//' | sed 's/^ *//' | grep -v "^$$" | tr "\n" " " | sed 's/;/;\n/g' > modified_gap_spacing; \ diff --git a/upload_codecov.sh b/upload_codecov.sh index 77b485c..41e8aad 100755 --- a/upload_codecov.sh +++ b/upload_codecov.sh @@ -23,4 +23,4 @@ shasum -a 256 -c codecov.SHA256SUM # execute chmod +x codecov -./codecov -Z || ./codecov -Z || ./codecov -Z +./codecov -Z || (sleep 30; ./codecov -Z || (sleep 30; ./codecov -Z)) From 30188a72622c6de7511a56c160eb906903626580 Mon Sep 17 00:00:00 2001 From: Fabian Zickgraf Date: Thu, 3 Nov 2022 17:50:28 +0100 Subject: [PATCH 3/3] Bump version --- PackageInfo.g | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PackageInfo.g b/PackageInfo.g index 5e20544..5bbb9a7 100644 --- a/PackageInfo.g +++ b/PackageInfo.g @@ -10,7 +10,7 @@ SetPackageInfo( rec( PackageName := "InternalModules", Subtitle := "Modules over internal algebras", -Version := "2022.10-01", +Version := "2022.11-01", Date := Concatenation( "01/", ~.Version{[ 6, 7 ]}, "/", ~.Version{[ 1 .. 4 ]} ), License := "GPL-2.0-or-later",