From 0cdca9e9b67ab74d1d9e65304925558e811a75a4 Mon Sep 17 00:00:00 2001 From: Mohamed Barakat Date: Thu, 3 Nov 2022 15:47:23 +0100 Subject: [PATCH 1/2] applied PackageJanitor --- .github/workflows/Tests.yml | 9 ++++----- PackageInfo.g | 2 +- ci_gaprc | 30 +++++++++++++++++++++++++++--- upload_codecov.sh | 2 +- 4 files changed, 33 insertions(+), 10 deletions(-) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index 27d3160..ba1dae9 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -22,10 +22,8 @@ jobs: steps: # 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@v1 - - run: mkdir -p /home/gap/.gap/pkg/ - - run: sudo cp -a $GITHUB_WORKSPACE /home/gap/.gap/pkg/ - - run: sudo chown -R gap:gap /home/gap/.gap/pkg/ + - uses: actions/checkout@v3 + - run: cp -a $GITHUB_WORKSPACE /home/gap/.gap/pkg/ - run: | export HOME="/home/gap" cd /home/gap/.gap/pkg/ @@ -53,7 +51,7 @@ jobs: [ -d "homalg_project/homalg" ] && make -C "homalg_project/homalg" doc [ -d "homalg_project/Modules" ] && make -C "homalg_project/Modules" doc [ -d "Toposes" ] && make -C "Toposes" doc - TERM=dumb make -C CatReps -j $(nproc) --output-sync ci-test + make -C CatReps -j $(nproc) --output-sync ci-test cp ./CatReps/.codecov.yml ./ (cd CatReps && LANG=C.UTF-8 python3 process_coverage.py) [ "$GITHUB_EVENT_NAME" != "schedule" ] && [ "${{ matrix.image }}" = "ghcr.io/homalg-project/gap-docker-master:latest" ] && ./CatReps/upload_codecov.sh @@ -62,6 +60,7 @@ jobs: cd CatReps CUR_SHA=$(git rev-parse --verify HEAD) if [ "${{ matrix.image }}" = "ghcr.io/homalg-project/gap-docker:latest" ] && [ "$CUR_SHA" = "$(git rev-parse origin/master)" ] && [ $(dirname "$GITHUB_REPOSITORY") = "homalg-project" ]; then \ + git fetch origin gh-pages; \ git worktree add gh-pages/ gh-pages || (echo "There was an error. Make sure there is a branch named 'gh-pages'. See https://github.com/homalg-project/PackageJanitor#error-there-was-an-error-make-sure-there-is-a-branch-named-gh-pages"; exit 1); \ git checkout master; \ LANG=C.UTF-8 ./make_dist.sh --token "${{ secrets.GITHUB_TOKEN }}"; \ diff --git a/PackageInfo.g b/PackageInfo.g index 7650d49..7b010a2 100644 --- a/PackageInfo.g +++ b/PackageInfo.g @@ -97,7 +97,7 @@ PackageDoc := rec( ), Dependencies := rec( - GAP := ">= 4.11.1", + GAP := ">= 4.12.1", NeededOtherPackages := [ [ "GAPDoc", ">= 1.5" ], [ "CAP", ">= 2022.09-17" ], 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/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 e4ce4febdfe63489ff508340fdbe324c0a6e2b11 Mon Sep 17 00:00:00 2001 From: Mohamed Barakat Date: Thu, 3 Nov 2022 15:44:37 +0100 Subject: [PATCH 2/2] comply with CAP v2022.11-06 --- PackageInfo.g | 4 ++-- README.md | 2 +- examples/CategoryOfRepresentations.g | 2 +- examples/notebooks/CategoryOfRepresentations.ipynb | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PackageInfo.g b/PackageInfo.g index 7b010a2..cb0b6b9 100644 --- a/PackageInfo.g +++ b/PackageInfo.g @@ -10,7 +10,7 @@ SetPackageInfo( rec( PackageName := "CatReps", Subtitle := "Representations and cohomology of finite categories", -Version := "2022.10-04", +Version := "2022.11-01", Date := ~.Version{[ 1 .. 10 ]}, Date := Concatenation( "01/", ~.Version{[ 6, 7 ]}, "/", ~.Version{[ 1 .. 4 ]} ), @@ -100,7 +100,7 @@ Dependencies := rec( GAP := ">= 4.12.1", NeededOtherPackages := [ [ "GAPDoc", ">= 1.5" ], - [ "CAP", ">= 2022.09-17" ], + [ "CAP", ">= 2022.11-06" ], [ "MonoidalCategories", ">= 2021.08-01" ], [ "LinearAlgebraForCAP", ">= 2021.07-01" ], [ "FinSetsForCAP", ">= 2022.05-07" ], diff --git a/README.md b/README.md index 40d7907..8a364ee 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ The supported categorical doctrine of the category of representations is ```gap gap> InfoOfInstalledOperationsOfCategory( CatReps ); -95 primitive operations were used to derive 317 operations for this category +95 primitive operations were used to derive 318 operations for this category which constructively * IsEquippedWithHomomorphismStructure * IsLinearCategoryOverCommutativeRing diff --git a/examples/CategoryOfRepresentations.g b/examples/CategoryOfRepresentations.g index d065644..64399a3 100644 --- a/examples/CategoryOfRepresentations.g +++ b/examples/CategoryOfRepresentations.g @@ -33,7 +33,7 @@ CatReps := FunctorCategory( A, GF3 ); #! RightQuiver( "q(2)[a:1->1,b:1->2,c:2->2]" ) ) ) / relations, #! Category of matrices over GF(3) ) InfoOfInstalledOperationsOfCategory( CatReps ); -#! 95 primitive operations were used to derive 317 operations for this category +#! 95 primitive operations were used to derive 318 operations for this category #! which algorithmically #! * IsEquippedWithHomomorphismStructure #! * IsLinearCategoryOverCommutativeRing diff --git a/examples/notebooks/CategoryOfRepresentations.ipynb b/examples/notebooks/CategoryOfRepresentations.ipynb index e23d3e2..10fd314 100644 --- a/examples/notebooks/CategoryOfRepresentations.ipynb +++ b/examples/notebooks/CategoryOfRepresentations.ipynb @@ -515,7 +515,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "95 primitive operations were used to derive 317 operations for this category which algorithmically\n", + "95 primitive operations were used to derive 318 operations for this category which algorithmically\n", "* IsEquippedWithHomomorphismStructure\n", "* IsLinearCategoryOverCommutativeRing\n", "* IsSymmetricMonoidalCategory\n",