diff --git a/.ci/create-changes-html.sh b/.ci/create-changes-html.sh index 33fd9a52472..80335ea1613 100755 --- a/.ci/create-changes-html.sh +++ b/.ci/create-changes-html.sh @@ -8,8 +8,6 @@ fi BASE_DOC_COMMIT="$1" DOC_REPOSITORY="$2" -# Wipe out chronic diffs between old doc and new doc -(cd $DOC_REPOSITORY && find . -name "*.html" | xargs sed -i -e '\;; d') # Create CHANGES.html echo '' > CHANGES.html echo '' >> CHANGES.html @@ -19,7 +17,9 @@ echo '' >> CHANGES.html cat >> CHANGES.html << EOF ; d') # Create git repo from old doc - (cd docs && \ + (cd doc && \ git init && \ (echo "*.svg binary"; echo "*.pdf binary") >> .gitattributes && \ (echo ".buildinfo"; echo '*.inv'; echo '.git*'; echo '*.svg'; echo '*.pdf'; echo '*.png'; echo 'searchindex.js') > .gitignore; \ - git add -A && git commit --quiet -m "old") + git add -A && git commit --quiet -m 'old') - - name: Build docs + - name: Build doc id: docbuild - if: (success() || failure()) && steps.worktree.outcome == 'success' + if: (success() || failure()) && steps.worktree.outcome == 'success' && !startsWith(github.ref, 'refs/tags/') # Always non-incremental because of the concern that # incremental docbuild may introduce broken links (inter-file references) though build succeeds run: | @@ -157,50 +166,47 @@ jobs: ./config.status && make sagemath_doc_html-no-deps shell: sh .ci/docker-exec-script.sh BUILD /sage {0} - - name: Copy docs + - name: Copy doc id: copy if: (success() || failure()) && steps.docbuild.outcome == 'success' run: | set -ex # We copy everything to a local folder - docker cp BUILD:/sage/local/share/doc/sage/html docs - docker cp BUILD:/sage/local/share/doc/sage/index.html docs - (cd docs && git commit -a -m 'new') - # Wipe out chronic diffs of new doc against old doc - (cd docs && \ + docker cp --follow-link BUILD:/sage/local/share/doc/sage/html doc + docker cp --follow-link BUILD:/sage/local/share/doc/sage/index.html doc + (cd doc && git commit -a -m 'new') + # Wipe out chronic diffs of new doc against old doc before creating CHANGES.html + (cd doc && \ find . -name "*.html" | xargs sed -i -e '/This is documentation for/ s/ built with GitHub PR .*. Doc/. Doc/' \ - -e '/;,\;; d' \ + && git commit -a -m 'wipe-out') + # Since HEAD is at commit 'wipe-out', HEAD~1 is commit 'new' (new doc), HEAD~2 is commit 'old' (old doc) + .ci/create-changes-html.sh $(cd doc && git rev-parse HEAD~2) doc + # Restore the new doc with changes made in create-changes-html.sh but dropping changes by "wipe out" + (cd doc && git stash -q && git checkout -q -f HEAD~1 && git stash pop -q) + # Sometimes rm -rf .git errors out because of some diehard hidden files + # So we simply move it out of the doc directory + (cd doc && mv .git ../git && mv .gitattributes ../gitattributes) + mv CHANGES.html doc # Zip everything for increased performance - zip -r docs.zip docs + zip -r doc.zip doc - - name: Upload docs + - name: Upload doc id: upload if: (success() || failure()) && steps.copy.outcome == 'success' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: docs - path: docs.zip + name: doc + path: doc.zip - - name: Save space - id: savespace - if: (success() || failure()) && steps.upload.outcome == 'success' && github.repository == 'sagemath/sage' && github.ref == 'refs/heads/develop' - run: | - set -ex - # Save space on runner device before we start to build livedoc - rm -rf docs/ - rm -f docs.zip + # + # On release tags: live doc and wheels + # - name: Build live doc id: buildlivedoc - if: (success() || failure()) && steps.savespace.outcome == 'success' + if: (success() || failure()) && startsWith(github.ref, 'refs/tags/') run: | export MAKE="make -j5 --output-sync=recurse" SAGE_NUM_THREADS=5 export PATH="build/bin:$PATH" @@ -227,7 +233,7 @@ jobs: - name: Upload live doc if: (success() || failure()) && steps.copylivedoc.outcome == 'success' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: livedoc path: livedoc.zip diff --git a/.github/workflows/doc-publish.yml b/.github/workflows/doc-publish.yml index bc12784cb9c..d5eafc953e1 100644 --- a/.github/workflows/doc-publish.yml +++ b/.github/workflows/doc-publish.yml @@ -1,5 +1,3 @@ -# Triggers after the documentation build has finished, -# taking the artifact and uploading it to netlify name: Publish documentation on: @@ -13,10 +11,27 @@ permissions: checks: write pull-requests: write + +# This workflow runs after doc-build workflow, taking the artifact +# (doc/livedoc) and deploying it to a netlify site. +# +# event (triggered doc-build) URL (of the doc deployed to NETLIFY_SITE) +# --------------------------- --------------------------------- +# on pull request https://doc-pr-12345--NETLIFY_SITE +# on push branch develop https://doc-develop--NETLIFY_SITE +# on push tag https://doc-10-4-beta2--NETLIFY_SITE +# on push tag https://doc-release--NETLIFY_SITE +# +# where NETLIFY_SITE is presently sagemath.netlify.app for repo sagemath/sage. +# +# This workflow runs only if secrets NETLIFY_AUTH_TOKEN and NETLIFY_SITE_ID are set. + jobs: - upload-docs: + publish-doc: runs-on: ubuntu-latest if: github.event.workflow_run.conclusion == 'success' + env: + CAN_DEPLOY: ${{ secrets.NETLIFY_AUTH_TOKEN != '' && secrets.NETLIFY_SITE_ID != '' }} steps: - name: Get information about workflow origin uses: potiuk/get-workflow-origin@v1_5 @@ -24,47 +39,37 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} sourceRunId: ${{ github.event.workflow_run.id }} + if: env.CAN_DEPLOY == 'true' - # Once https://github.com/actions/download-artifact/issues/172 and/or https://github.com/actions/download-artifact/issues/60 is implemented, we can use the official download-artifact action - # For now use the solution from https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow - - name: Download docs - uses: actions/github-script@v7.0.1 + - name: Download doc + id: download-doc + uses: actions/download-artifact@v4 with: - script: | - var artifacts = await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{github.event.workflow_run.id }}, - }); - var matchArtifact = artifacts.data.artifacts.filter((artifact) => { - return artifact.name == "docs" - })[0]; - var download = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: 'zip', - }); - var fs = require('fs'); - fs.writeFileSync('${{github.workspace}}/docs.zip', Buffer.from(download.data)); - - - name: Extract docs - run: unzip docs.zip -d docs && unzip docs/docs.zip -d docs/docs + name: doc + github-token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.repository }} + run-id: ${{ github.event.workflow_run.id }} + if: steps.source-run-info.outputs.sourceEvent == 'pull_request' || (steps.source-run-info.outputs.sourceEvent == 'push' && steps.source-run-info.outputs.targetBranch == 'develop') + + - name: Extract doc + run: unzip doc.zip -d doc + if: steps.download-doc.outcome == 'success' - name: Deploy to Netlify id: deploy-netlify uses: netlify/actions/cli@master with: - args: deploy --dir=docs/docs/docs ${NETLIFY_PRODUCTION:+"--prod"} --message ${NETLIFY_MESSAGE} --alias ${NETLIFY_ALIAS} + args: deploy --dir=doc/doc --message ${NETLIFY_MESSAGE} --alias ${NETLIFY_ALIAS} env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} - NETLIFY_PRODUCTION: ${{ github.ref == 'refs/heads/develop' }} - NETLIFY_MESSAGE: ${{ steps.source-run-info.outputs.pullRequestNumber }} - NETLIFY_ALIAS: preview-${{ steps.source-run-info.outputs.pullRequestNumber }} + NETLIFY_MESSAGE: doc-${{ steps.source-run-info.outputs.pullRequestNumber && format('pr-{0}', steps.source-run-info.outputs.pullRequestNumber) || 'develop' }} + NETLIFY_ALIAS: doc-${{ steps.source-run-info.outputs.pullRequestNumber && format('pr-{0}', steps.source-run-info.outputs.pullRequestNumber) || 'develop' }} + if: steps.download-doc.outcome == 'success' - # Add deployment as status check, PR comment and annotation - # we could use the nwtgck/actions-netlify action for that, except for that it is not (yet) working in workflow_run context: https://github.com/nwtgck/actions-netlify/issues/545 + # Add deployment as status check, PR comment and annotation we could use + # the nwtgck/actions-netlify action for that, except for that it is not + # (yet) working in workflow_run context: https://github.com/nwtgck/actions-netlify/issues/545 - name: Add/Update deployment status PR comment uses: marocchino/sticky-pull-request-comment@v2 with: @@ -74,10 +79,10 @@ jobs: message: | [Documentation preview for this PR](${{ steps.deploy-netlify.outputs.NETLIFY_URL }}/html/en) (built with commit ${{ steps.source-run-info.outputs.sourceHeadSha }}; [changes](${{ steps.deploy-netlify.outputs.NETLIFY_URL }}/CHANGES.html)) is ready! :tada: This preview will update shortly after each push to this PR. + if: steps.download-doc.outcome == 'success' - name: Update deployment status PR check uses: myrotvorets/set-commit-status-action@v2.0.1 - if: ${{ always() }} env: DEPLOY_SUCCESS: Successfully deployed preview. DEPLOY_FAILURE: Failed to deploy preview. @@ -88,50 +93,64 @@ jobs: context: Deploy Documentation targetUrl: ${{ steps.deploy-netlify.outputs.NETLIFY_URL }} description: ${{ job.status == 'success' && env.DEPLOY_SUCCESS || env.DEPLOY_FAILURE }} + if: steps.download-doc.outcome == 'success' - name: Report deployment url run: | echo "::notice::The documentation has been deployed - ${{ steps.deploy-netlify.outputs.NETLIFY_URL }}" + if: steps.download-doc.outcome == 'success' publish-live-doc: runs-on: ubuntu-latest - if: github.event.workflow_run.conclusion == 'success' && github.repository == 'sagemath/sage' && github.event.workflow_run.head_branch == 'develop' + if: github.event.workflow_run.conclusion == 'success' + env: + CAN_DEPLOY: ${{ secrets.NETLIFY_AUTH_TOKEN != '' && secrets.NETLIFY_SITE_ID != '' }} steps: + - name: Get information about workflow origin + uses: potiuk/get-workflow-origin@v1_5 + id: source-run-info + with: + token: ${{ secrets.GITHUB_TOKEN }} + sourceRunId: ${{ github.event.workflow_run.id }} + if: env.CAN_DEPLOY == 'true' + - name: Download live doc - uses: actions/github-script@v7.0.1 + id: download-doc + uses: actions/download-artifact@v4 with: - script: | - var artifacts = await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{github.event.workflow_run.id }}, - }); - var matchArtifact = artifacts.data.artifacts.filter((artifact) => { - return artifact.name == "livedoc" - })[0]; - var download = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: 'zip', - }); - var fs = require('fs'); - fs.writeFileSync('${{github.workspace}}/livedoc.zip', Buffer.from(download.data)); + name: livedoc + github-token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.repository }} + run-id: ${{ github.event.workflow_run.id }} + # if the doc was built for tag push (targetBranch contains the tag) + if: steps.source-run-info.outputs.sourceEvent == 'push' && steps.source-run-info.outputs.targetBranch != 'develop' - name: Extract live doc - run: unzip livedoc.zip -d doc && unzip doc/livedoc.zip -d doc/doc + run: unzip livedoc.zip -d livedoc + if: steps.download-doc.outcome == 'success' - - name: Deploy to Netlify + - name: Deploy to netlify with doc-TAG alias id: deploy-netlify uses: netlify/actions/cli@master with: - args: deploy --dir=doc/doc/livedoc --message ${NETLIFY_MESSAGE} --alias ${NETLIFY_ALIAS} + args: deploy --dir=livedoc/livedoc --message ${NETLIFY_MESSAGE} --alias ${NETLIFY_ALIAS} + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + NETLIFY_MESSAGE: doc-${{ steps.source-run-info.outputs.targetBranch }} + NETLIFY_ALIAS: doc-${{ steps.source-run-info.outputs.targetBranch }} + if: steps.download-doc.outcome == 'success' + + - name: Deploy to netlify with doc-release alias + uses: netlify/actions/cli@master + with: + args: deploy --dir=livedoc/livedoc --message doc-release --alias doc-release env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} - NETLIFY_MESSAGE: Deployed live doc - NETLIFY_ALIAS: livedoc + if: steps.download-doc.outcome == 'success' - name: Report deployment url run: | echo "::notice::The live documentation has been deployed - ${{ steps.deploy-netlify.outputs.NETLIFY_URL }}" + if: steps.download-doc.outcome == 'success' diff --git a/CITATION.cff b/CITATION.cff index eaf72cc1a94..0e9afaef5be 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -4,8 +4,8 @@ title: SageMath abstract: SageMath is a free open-source mathematics software system. authors: - name: "The SageMath Developers" -version: 10.4.rc1 +version: 10.4.rc2 doi: 10.5281/zenodo.8042260 -date-released: 2024-06-27 +date-released: 2024-07-04 repository-code: "https://github.com/sagemath/sage" url: "https://www.sagemath.org/" diff --git a/VERSION.txt b/VERSION.txt index c394af87fe2..7ac68647d4c 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -SageMath version 10.4.rc1, Release Date: 2024-06-27 +SageMath version 10.4.rc2, Release Date: 2024-07-04 diff --git a/build/bin/sage-dist-helpers b/build/bin/sage-dist-helpers index d55ac539837..520b6ceec5a 100644 --- a/build/bin/sage-dist-helpers +++ b/build/bin/sage-dist-helpers @@ -205,18 +205,7 @@ sdh_make_install() { sdh_die "Error installing $PKG_NAME" } -sdh_setup_bdist_wheel() { - # Issue #32046: Most uses of this function can be replaced by sdh_pip_install - mkdir -p dist - rm -f dist/*.whl - BDIST_DIR="$(mktemp -d)" - python3 setup.py --no-user-cfg \ - bdist_wheel --bdist-dir "$BDIST_DIR" \ - "$@" || sdh_die "Error building a wheel for $PKG_NAME" -} - -sdh_pip_install() { - echo "Installing $PKG_NAME" +sdh_build_wheel() { mkdir -p dist rm -f dist/*.whl export PIP_NO_INDEX=1 @@ -224,6 +213,8 @@ sdh_pip_install() { build_options="" # pip has --no-build-isolation but no flag that turns the default back on... build_isolation_option="" + # build has --wheel but no flag that turns the default (build sdist and then wheel) back on + dist_option="--wheel" export PIP_FIND_LINKS="$SAGE_SPKG_WHEELS" unset PIP_NO_BINARY while [ $# -gt 0 ]; do @@ -243,6 +234,9 @@ sdh_pip_install() { export PIP_NO_BINARY=:all: build_isolation_option="--no-isolation --skip-dependency-check" ;; + --sdist-then-wheel) + dist_option="" + ;; --no-deps) install_options="$install_options $1" ;; @@ -258,7 +252,7 @@ sdh_pip_install() { esac shift done - if python3 -m build --wheel --outdir=dist $build_isolation_option $build_options "$@"; then + if python3 -m build $dist_option --outdir=dist $build_isolation_option $build_options "$@"; then : # successful else case $build_isolation_option in @@ -266,12 +260,12 @@ sdh_pip_install() { sdh_die "Error building a wheel for $PKG_NAME" ;; *) - echo >&2 "Warning: building with \"python3 -m build --wheel --outdir=dist $build_isolation_option $build_options $@\" failed." + echo >&2 "Warning: building with \"python3 -m build $dist_option --outdir=dist $build_isolation_option $build_options $@\" failed." unset PIP_FIND_LINKS export PIP_NO_BINARY=:all: build_isolation_option="--no-isolation --skip-dependency-check" - echo >&2 "Retrying with \"python3 -m build --wheel --outdir=dist $build_isolation_option $build_options $@\"." - if python3 -m build --wheel --outdir=dist $build_isolation_option $build_options "$@"; then + echo >&2 "Retrying with \"python3 -m build $dist_option --outdir=dist $build_isolation_option $build_options $@\"." + if python3 -m build $dist_option --outdir=dist $build_isolation_option $build_options "$@"; then echo >&2 "Warning: Wheel building needed to use \"$build_isolation_option\" to succeed. This means that a dependencies file in build/pkgs/ needs to be updated. Please report this to sage-devel@googlegroups.com, including the build log of this package." else sdh_die "Error building a wheel for $PKG_NAME" @@ -282,6 +276,16 @@ sdh_pip_install() { unset PIP_FIND_LINKS unset PIP_NO_BINARY unset PIP_NO_INDEX +} + +sdh_build_and_store_wheel() { + sdh_build_wheel "$@" + sdh_store_wheel . +} + +sdh_pip_install() { + echo "Installing $PKG_NAME" + sdh_build_wheel "$@" sdh_store_and_pip_install_wheel $install_options . } diff --git a/build/pkgs/configure/checksums.ini b/build/pkgs/configure/checksums.ini index 604bdd90545..2f597f1181e 100644 --- a/build/pkgs/configure/checksums.ini +++ b/build/pkgs/configure/checksums.ini @@ -1,3 +1,3 @@ tarball=configure-VERSION.tar.gz -sha1=7e1e01d82e171303935202d5876e0c109d431f8b -sha256=eec0d494a20c6eff61a1ccc679cca149efd78cb191f88ade0446468b45abee00 +sha1=1451031f1325bb7d31929b92415ee25795ed7022 +sha256=a5c2064d5c792d32bbfa6c97a72aab395764ed7882f9bcadb8f04ca34c42c6b4 diff --git a/build/pkgs/configure/package-version.txt b/build/pkgs/configure/package-version.txt index 8e28acc48d1..b89560fcf48 100644 --- a/build/pkgs/configure/package-version.txt +++ b/build/pkgs/configure/package-version.txt @@ -1 +1 @@ -19bd20218effcdb6b242bfb18b113ff85c6d8497 +812a1160c06c055f74f9fcc86a7678c5a7a8788c diff --git a/build/pkgs/sage_conf/spkg-install.in b/build/pkgs/sage_conf/spkg-install.in deleted file mode 100644 index 4479c541b1c..00000000000 --- a/build/pkgs/sage_conf/spkg-install.in +++ /dev/null @@ -1,9 +0,0 @@ -cd src -if [ "$SAGE_EDITABLE" = yes ]; then - sdh_pip_editable_install . - if [ "$SAGE_WHEELS" = yes ]; then - sdh_setup_bdist_wheel && sdh_store_wheel . - fi -else - sdh_pip_install . -fi diff --git a/build/pkgs/sage_conf/spkg-install.in b/build/pkgs/sage_conf/spkg-install.in new file mode 120000 index 00000000000..428e161a850 --- /dev/null +++ b/build/pkgs/sage_conf/spkg-install.in @@ -0,0 +1 @@ +../sage_setup/spkg-install.in \ No newline at end of file diff --git a/build/pkgs/sage_conf/version_requirements.txt b/build/pkgs/sage_conf/version_requirements.txt index 0dd105252c5..dbcd1044c25 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 -sage-conf ~= 10.4rc1 +sage-conf ~= 10.4rc2 diff --git a/build/pkgs/sage_docbuild/spkg-install.in b/build/pkgs/sage_docbuild/spkg-install.in deleted file mode 100644 index 4479c541b1c..00000000000 --- a/build/pkgs/sage_docbuild/spkg-install.in +++ /dev/null @@ -1,9 +0,0 @@ -cd src -if [ "$SAGE_EDITABLE" = yes ]; then - sdh_pip_editable_install . - if [ "$SAGE_WHEELS" = yes ]; then - sdh_setup_bdist_wheel && sdh_store_wheel . - fi -else - sdh_pip_install . -fi diff --git a/build/pkgs/sage_docbuild/spkg-install.in b/build/pkgs/sage_docbuild/spkg-install.in new file mode 120000 index 00000000000..428e161a850 --- /dev/null +++ b/build/pkgs/sage_docbuild/spkg-install.in @@ -0,0 +1 @@ +../sage_setup/spkg-install.in \ No newline at end of file diff --git a/build/pkgs/sage_docbuild/version_requirements.txt b/build/pkgs/sage_docbuild/version_requirements.txt index 833c5473958..d8c15101186 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 -sage-docbuild ~= 10.4rc1 +sage-docbuild ~= 10.4rc2 diff --git a/build/pkgs/sage_setup/spkg-install.in b/build/pkgs/sage_setup/spkg-install.in index 4479c541b1c..da7d7a2870f 100644 --- a/build/pkgs/sage_setup/spkg-install.in +++ b/build/pkgs/sage_setup/spkg-install.in @@ -2,7 +2,7 @@ cd src if [ "$SAGE_EDITABLE" = yes ]; then sdh_pip_editable_install . if [ "$SAGE_WHEELS" = yes ]; then - sdh_setup_bdist_wheel && sdh_store_wheel . + sdh_build_and_store_wheel --no-isolation . fi else sdh_pip_install . diff --git a/build/pkgs/sage_setup/version_requirements.txt b/build/pkgs/sage_setup/version_requirements.txt index 8f03f0aa8ad..82ad2cb4b6f 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 -sage-setup ~= 10.4rc1 +sage-setup ~= 10.4rc2 diff --git a/build/pkgs/sage_sws2rst/spkg-install.in b/build/pkgs/sage_sws2rst/spkg-install.in deleted file mode 100644 index 4479c541b1c..00000000000 --- a/build/pkgs/sage_sws2rst/spkg-install.in +++ /dev/null @@ -1,9 +0,0 @@ -cd src -if [ "$SAGE_EDITABLE" = yes ]; then - sdh_pip_editable_install . - if [ "$SAGE_WHEELS" = yes ]; then - sdh_setup_bdist_wheel && sdh_store_wheel . - fi -else - sdh_pip_install . -fi diff --git a/build/pkgs/sage_sws2rst/spkg-install.in b/build/pkgs/sage_sws2rst/spkg-install.in new file mode 120000 index 00000000000..428e161a850 --- /dev/null +++ b/build/pkgs/sage_sws2rst/spkg-install.in @@ -0,0 +1 @@ +../sage_setup/spkg-install.in \ No newline at end of file diff --git a/build/pkgs/sage_sws2rst/version_requirements.txt b/build/pkgs/sage_sws2rst/version_requirements.txt index 2665a928259..4a46c21b6ef 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 -sage-sws2rst ~= 10.4rc1 +sage-sws2rst ~= 10.4rc2 diff --git a/build/pkgs/sagelib/spkg-install.in b/build/pkgs/sagelib/spkg-install.in index e085d2884fb..5c78e3459c8 100644 --- a/build/pkgs/sagelib/spkg-install.in +++ b/build/pkgs/sagelib/spkg-install.in @@ -24,11 +24,10 @@ export SAGE_ROOT=/doesnotexist export SAGE_SRC=/doesnotexist export SAGE_SRC_ROOT=/doesnotexist export SAGE_DOC_SRC=/doesnotexist -export SAGE_BUILD_DIR=/doesnotexist -# We also poison all directories below SAGE_LOCAL. +# We also poison all directories below SAGE_LOCAL +# except for SAGE_SPKG_SCRIPTS, which is needed by sage-dist-helpers export SAGE_PKGCONFIG=/doesnotexist -export SAGE_SPKG_SCRIPTS=/doesnotexist export SAGE_SHARE=/doesnotexist # However, we only unset SAGE_LOCAL and SAGE_PKG_CONFIG_PATH. @@ -53,7 +52,7 @@ if [ "$SAGE_EDITABLE" = yes ]; then if [ "$SAGE_WHEELS" = yes ]; then # Additionally build a wheel (for use in other venvs) - cd $SAGE_PKGS/sagelib/src && time sdh_setup_bdist_wheel && sdh_store_wheel . + cd $SAGE_PKGS/sagelib/src && time sdh_build_and_store_wheel --no-build-isolation . fi else # Now implied: "$SAGE_WHEELS" = yes diff --git a/build/pkgs/sagelib/version_requirements.txt b/build/pkgs/sagelib/version_requirements.txt index 1051a07e0b4..bc61d4da915 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 -sagemath-standard ~= 10.4rc1 +sagemath-standard ~= 10.4rc2 diff --git a/build/pkgs/sagemath_bliss/version_requirements.txt b/build/pkgs/sagemath_bliss/version_requirements.txt index 0d36d23bfe1..c184449da9d 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 -sagemath-bliss ~= 10.4rc1 +sagemath-bliss ~= 10.4rc2 diff --git a/build/pkgs/sagemath_categories/version_requirements.txt b/build/pkgs/sagemath_categories/version_requirements.txt index b7b26f85e98..a17593ff6ed 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 -sagemath-categories ~= 10.4rc1 +sagemath-categories ~= 10.4rc2 diff --git a/build/pkgs/sagemath_coxeter3/version_requirements.txt b/build/pkgs/sagemath_coxeter3/version_requirements.txt index 7bab240390c..32b5f6dd880 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 -sagemath-coxeter3 ~= 10.4rc1 +sagemath-coxeter3 ~= 10.4rc2 diff --git a/build/pkgs/sagemath_environment/version_requirements.txt b/build/pkgs/sagemath_environment/version_requirements.txt index 0e935728422..63587e89334 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 -sagemath-environment ~= 10.4rc1 +sagemath-environment ~= 10.4rc2 diff --git a/build/pkgs/sagemath_mcqd/version_requirements.txt b/build/pkgs/sagemath_mcqd/version_requirements.txt index a37aefe08f5..47d2a87aa0c 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 -sagemath-mcqd ~= 10.4rc1 +sagemath-mcqd ~= 10.4rc2 diff --git a/build/pkgs/sagemath_meataxe/version_requirements.txt b/build/pkgs/sagemath_meataxe/version_requirements.txt index 95885c638c7..08236c2fa7d 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 -sagemath-meataxe ~= 10.4rc1 +sagemath-meataxe ~= 10.4rc2 diff --git a/build/pkgs/sagemath_objects/spkg-install.in b/build/pkgs/sagemath_objects/spkg-install.in index 62cb1b73b22..53c094fde04 100644 --- a/build/pkgs/sagemath_objects/spkg-install.in +++ b/build/pkgs/sagemath_objects/spkg-install.in @@ -7,8 +7,4 @@ export PIP_FIND_LINKS="file://$SAGE_SPKG_WHEELS" # https://pypa-build.readthedocs.io/en/latest/#python--m-build # (Important because sagemath-objects uses MANIFEST.in for filtering.) # Do not install the wheel. -DIST_DIR="$(mktemp -d)" -python3 -m build --outdir "$DIST_DIR"/dist . || sdh_die "Failure building sdist and wheel" - -wheel=$(cd "$DIST_DIR" && sdh_store_wheel . >&2 && echo $wheel) -ls -l "$wheel" +sdh_build_and_store_wheel --sdist-then-wheel . diff --git a/build/pkgs/sagemath_objects/version_requirements.txt b/build/pkgs/sagemath_objects/version_requirements.txt index dd6fbdecf3f..d6483eabc32 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 -sagemath-objects ~= 10.4rc1 +sagemath-objects ~= 10.4rc2 diff --git a/build/pkgs/sagemath_repl/version_requirements.txt b/build/pkgs/sagemath_repl/version_requirements.txt index ea0193b7cd0..2136ac318b4 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 -sagemath-repl ~= 10.4rc1 +sagemath-repl ~= 10.4rc2 diff --git a/build/pkgs/sagemath_sirocco/version_requirements.txt b/build/pkgs/sagemath_sirocco/version_requirements.txt index a77151e1ae8..ed80111041b 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 -sagemath-sirocco ~= 10.4rc1 +sagemath-sirocco ~= 10.4rc2 diff --git a/build/pkgs/sagemath_tdlib/version_requirements.txt b/build/pkgs/sagemath_tdlib/version_requirements.txt index 880b6455dd8..ce27e4543de 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 -sagemath-tdlib ~= 10.4rc1 +sagemath-tdlib ~= 10.4rc2 diff --git a/pkgs/sage-conf/VERSION.txt b/pkgs/sage-conf/VERSION.txt index 072978a2ea9..ab2b6c0366e 100644 --- a/pkgs/sage-conf/VERSION.txt +++ b/pkgs/sage-conf/VERSION.txt @@ -1 +1 @@ -10.4.rc1 +10.4.rc2 diff --git a/pkgs/sage-conf_conda/VERSION.txt b/pkgs/sage-conf_conda/VERSION.txt index 072978a2ea9..ab2b6c0366e 100644 --- a/pkgs/sage-conf_conda/VERSION.txt +++ b/pkgs/sage-conf_conda/VERSION.txt @@ -1 +1 @@ -10.4.rc1 +10.4.rc2 diff --git a/pkgs/sage-conf_pypi/VERSION.txt b/pkgs/sage-conf_pypi/VERSION.txt index 072978a2ea9..ab2b6c0366e 100644 --- a/pkgs/sage-conf_pypi/VERSION.txt +++ b/pkgs/sage-conf_pypi/VERSION.txt @@ -1 +1 @@ -10.4.rc1 +10.4.rc2 diff --git a/pkgs/sage-docbuild/VERSION.txt b/pkgs/sage-docbuild/VERSION.txt index 072978a2ea9..ab2b6c0366e 100644 --- a/pkgs/sage-docbuild/VERSION.txt +++ b/pkgs/sage-docbuild/VERSION.txt @@ -1 +1 @@ -10.4.rc1 +10.4.rc2 diff --git a/pkgs/sage-setup/VERSION.txt b/pkgs/sage-setup/VERSION.txt index 072978a2ea9..ab2b6c0366e 100644 --- a/pkgs/sage-setup/VERSION.txt +++ b/pkgs/sage-setup/VERSION.txt @@ -1 +1 @@ -10.4.rc1 +10.4.rc2 diff --git a/pkgs/sage-sws2rst/VERSION.txt b/pkgs/sage-sws2rst/VERSION.txt index 072978a2ea9..ab2b6c0366e 100644 --- a/pkgs/sage-sws2rst/VERSION.txt +++ b/pkgs/sage-sws2rst/VERSION.txt @@ -1 +1 @@ -10.4.rc1 +10.4.rc2 diff --git a/pkgs/sagemath-bliss/VERSION.txt b/pkgs/sagemath-bliss/VERSION.txt index 072978a2ea9..ab2b6c0366e 100644 --- a/pkgs/sagemath-bliss/VERSION.txt +++ b/pkgs/sagemath-bliss/VERSION.txt @@ -1 +1 @@ -10.4.rc1 +10.4.rc2 diff --git a/pkgs/sagemath-categories/VERSION.txt b/pkgs/sagemath-categories/VERSION.txt index 072978a2ea9..ab2b6c0366e 100644 --- a/pkgs/sagemath-categories/VERSION.txt +++ b/pkgs/sagemath-categories/VERSION.txt @@ -1 +1 @@ -10.4.rc1 +10.4.rc2 diff --git a/pkgs/sagemath-coxeter3/VERSION.txt b/pkgs/sagemath-coxeter3/VERSION.txt index 072978a2ea9..ab2b6c0366e 100644 --- a/pkgs/sagemath-coxeter3/VERSION.txt +++ b/pkgs/sagemath-coxeter3/VERSION.txt @@ -1 +1 @@ -10.4.rc1 +10.4.rc2 diff --git a/pkgs/sagemath-environment/VERSION.txt b/pkgs/sagemath-environment/VERSION.txt index 072978a2ea9..ab2b6c0366e 100644 --- a/pkgs/sagemath-environment/VERSION.txt +++ b/pkgs/sagemath-environment/VERSION.txt @@ -1 +1 @@ -10.4.rc1 +10.4.rc2 diff --git a/pkgs/sagemath-mcqd/VERSION.txt b/pkgs/sagemath-mcqd/VERSION.txt index 072978a2ea9..ab2b6c0366e 100644 --- a/pkgs/sagemath-mcqd/VERSION.txt +++ b/pkgs/sagemath-mcqd/VERSION.txt @@ -1 +1 @@ -10.4.rc1 +10.4.rc2 diff --git a/pkgs/sagemath-meataxe/VERSION.txt b/pkgs/sagemath-meataxe/VERSION.txt index 072978a2ea9..ab2b6c0366e 100644 --- a/pkgs/sagemath-meataxe/VERSION.txt +++ b/pkgs/sagemath-meataxe/VERSION.txt @@ -1 +1 @@ -10.4.rc1 +10.4.rc2 diff --git a/pkgs/sagemath-objects/VERSION.txt b/pkgs/sagemath-objects/VERSION.txt index 072978a2ea9..ab2b6c0366e 100644 --- a/pkgs/sagemath-objects/VERSION.txt +++ b/pkgs/sagemath-objects/VERSION.txt @@ -1 +1 @@ -10.4.rc1 +10.4.rc2 diff --git a/pkgs/sagemath-repl/VERSION.txt b/pkgs/sagemath-repl/VERSION.txt index 072978a2ea9..ab2b6c0366e 100644 --- a/pkgs/sagemath-repl/VERSION.txt +++ b/pkgs/sagemath-repl/VERSION.txt @@ -1 +1 @@ -10.4.rc1 +10.4.rc2 diff --git a/pkgs/sagemath-sirocco/VERSION.txt b/pkgs/sagemath-sirocco/VERSION.txt index 072978a2ea9..ab2b6c0366e 100644 --- a/pkgs/sagemath-sirocco/VERSION.txt +++ b/pkgs/sagemath-sirocco/VERSION.txt @@ -1 +1 @@ -10.4.rc1 +10.4.rc2 diff --git a/pkgs/sagemath-tdlib/VERSION.txt b/pkgs/sagemath-tdlib/VERSION.txt index 072978a2ea9..ab2b6c0366e 100644 --- a/pkgs/sagemath-tdlib/VERSION.txt +++ b/pkgs/sagemath-tdlib/VERSION.txt @@ -1 +1 @@ -10.4.rc1 +10.4.rc2 diff --git a/src/VERSION.txt b/src/VERSION.txt index 072978a2ea9..ab2b6c0366e 100644 --- a/src/VERSION.txt +++ b/src/VERSION.txt @@ -1 +1 @@ -10.4.rc1 +10.4.rc2 diff --git a/src/bin/sage-version.sh b/src/bin/sage-version.sh index edf3ed22f84..8797015b79e 100644 --- a/src/bin/sage-version.sh +++ b/src/bin/sage-version.sh @@ -4,6 +4,6 @@ # 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! -SAGE_VERSION='10.4.rc1' -SAGE_RELEASE_DATE='2024-06-27' -SAGE_VERSION_BANNER='SageMath version 10.4.rc1, Release Date: 2024-06-27' +SAGE_VERSION='10.4.rc2' +SAGE_RELEASE_DATE='2024-07-04' +SAGE_VERSION_BANNER='SageMath version 10.4.rc2, Release Date: 2024-07-04' diff --git a/src/doc/en/developer/packaging.rst b/src/doc/en/developer/packaging.rst index ae8416cd186..d59e5dc07e9 100644 --- a/src/doc/en/developer/packaging.rst +++ b/src/doc/en/developer/packaging.rst @@ -444,10 +444,6 @@ begin with ``sdh_``, which stands for "Sage-distribution helper". arguments. If ``$SAGE_DESTDIR`` is not set then the command is run with ``$SAGE_SUDO``, if set. -- ``sdh_setup_bdist_wheel [...]``: Runs ``setup.py bdist_wheel`` with - the given arguments, as well as additional default arguments used for - installing packages into Sage. - - ``sdh_pip_install [...]``: The equivalent of running ``pip install`` with the given arguments, as well as additional default arguments used for installing packages into Sage with pip. The last argument must be @@ -609,10 +605,6 @@ Where ``sdh_pip_install`` is a function provided by ``sage-dist-helpers`` that points to the correct ``pip`` for the Python used by Sage, and includes some default flags needed for correct installation into Sage. -If ``pip`` will not work for a package but a command like ``python3 setup.py install`` -will, you may use ``sdh_setup_bdist_wheel``, followed by -``sdh_store_and_pip_install_wheel .``. - For ``spkg-check.in`` script templates, use ``python3`` rather than just ``python``. The paths are set by the Sage build system so that this runs the correct version of Python. diff --git a/src/sage/categories/pushout.py b/src/sage/categories/pushout.py index 5d397d42d22..7f0e153639e 100644 --- a/src/sage/categories/pushout.py +++ b/src/sage/categories/pushout.py @@ -1380,7 +1380,7 @@ def __mul__(self, other): """ if isinstance(other, IdentityConstructionFunctor): return self - if isinstance(other, self.__class__): # + if isinstance(other, self.__class__): INT = set(self._gens).intersection(other._gens) if INT: # if there is overlap of generators, it must only be at the ends, so that diff --git a/src/sage/combinat/integer_vector_weighted.py b/src/sage/combinat/integer_vector_weighted.py index c133a157b4f..ec074058b81 100644 --- a/src/sage/combinat/integer_vector_weighted.py +++ b/src/sage/combinat/integer_vector_weighted.py @@ -183,10 +183,10 @@ def __contains__(self, x): if len(self._weights) != len(x): return False s = 0 - for i, val in enumerate(x): - if (not isinstance(val, (int, Integer))) and (val not in ZZ): + for i, xi in enumerate(x): + if not isinstance(xi, (int, Integer)) and xi not in ZZ: return False - s += x[i] * self._weights[i] + s += xi * self._weights[i] return s == self._n def _recfun(self, n, l): diff --git a/src/sage/geometry/pseudolines.py b/src/sage/geometry/pseudolines.py index fe804a02a6b..cb9f68a8ba5 100644 --- a/src/sage/geometry/pseudolines.py +++ b/src/sage/geometry/pseudolines.py @@ -275,7 +275,7 @@ def __init__(self, seq, encoding='auto'): i = 0 while crossings > 0: - if (seq[i] != [] and + if (seq[i] and (seq[i][0] == 0 and seq[i+1][0] == 1)): @@ -290,7 +290,7 @@ def __init__(self, seq, encoding='auto'): seq[i].pop(0) seq[i+1].pop(0) - if i > 0 and seq[i-1] is not []: + if i > 0 and seq[i - 1]: i -= 1 else: i += 1 diff --git a/src/sage/graphs/generators/random.py b/src/sage/graphs/generators/random.py index 23213e01382..7e37a889381 100644 --- a/src/sage/graphs/generators/random.py +++ b/src/sage/graphs/generators/random.py @@ -2348,17 +2348,17 @@ def RandomBicubicPlanar(n, seed=None): Z3 = Zmod(3) colour = Z3.zero() not_touched = [i for i, v in enumerate(w) if v[0] in ['x', 'xb']] - for i, v in enumerate(w): + for i, wi in enumerate(w): # internal edges - if v[0] == 'i': + if wi[0] == 'i': colour += 1 if w[i + 1][0] == 'n': - G.add_edge((w[i], w[i + 1], colour)) - elif v[0] == 'n': + G.add_edge((wi, w[i + 1], colour)) + elif wi[0] == 'n': colour += 2 - elif v[0] == 'x': + elif wi[0] == 'x': pile.append(i) - elif v[0] == 'xb' and i in not_touched: + elif wi[0] == 'xb' and i in not_touched: if pile: j = pile.pop() G.add_edge((w[i + 1], w[j - 1], colour)) diff --git a/src/sage/graphs/graph_latex.py b/src/sage/graphs/graph_latex.py index f07cbbb61bf..464c65cb0dc 100644 --- a/src/sage/graphs/graph_latex.py +++ b/src/sage/graphs/graph_latex.py @@ -1711,34 +1711,34 @@ def translate(p): vl_color = {} vl_placement = {} for u in vertex_list: - # + c = dvc if u in vertex_colors: c = cc.to_rgb(vertex_colors[u]) v_color[u] = c - # + c = dvfc if u in vertex_fill_colors: c = cc.to_rgb(vertex_fill_colors[u]) vf_color[u] = c - # + sh = dsh if u in vertex_shapes: sh = vertex_shapes[u] v_shape[u] = sh - # + vs = dvs if u in vertex_sizes: vs = vertex_sizes[u] v_size[u] = vs - # + if vertex_labels: - # + c = dvlc if u in vertex_label_colors: c = cc.to_rgb(vertex_label_colors[u]) vl_color[u] = c - # + vlp = dvlp if u in vertex_label_placements: vlp = vertex_label_placements[u] @@ -1763,14 +1763,14 @@ def translate(p): # We collect options for edges, default values and for-some-edges # information. These are combined into dictionaries on a per-edge # basis, for all edges - # + # Defaults - # + dec = cc.to_rgb(self.get_option('edge_color')) if edge_fills: defc = cc.to_rgb(self.get_option('edge_fill_color')) det = self.get_option('edge_thickness') - # + if edge_labels: edge_labels_math = self.get_option('edge_labels_math') delc = cc.to_rgb(self.get_option('edge_label_color')) @@ -1793,7 +1793,7 @@ def translate(p): # an undirected graph in the "wrong" order, so we use a "reverse" to # test for this case. Everything formed here conforms to the order # used in the graph. - # + e_color = {} if edge_fills: ef_color = {} @@ -1806,7 +1806,7 @@ def translate(p): for e in self._graph.edges(sort=False): edge = (e[0], e[1]) reverse = (e[1], e[0]) - # + c = dec if edge in edge_colors or (not is_directed and reverse in edge_colors): if edge in edge_colors: @@ -1814,7 +1814,7 @@ def translate(p): else: c = cc.to_rgb(edge_colors[reverse]) e_color[edge] = c - # + if edge_fills: c = defc if edge in edge_fill_colors or (not is_directed and reverse in edge_fill_colors): @@ -1823,7 +1823,7 @@ def translate(p): else: c = cc.to_rgb(edge_fill_colors[reverse]) ef_color[edge] = c - # + et = det if edge in edge_thicknesses or (not is_directed and reverse in edge_thicknesses): if edge in edge_thicknesses: @@ -1831,7 +1831,7 @@ def translate(p): else: et = edge_thicknesses[reverse] e_thick[edge] = et - # + if edge_labels: c = delc if edge in edge_label_colors or (not is_directed and reverse in edge_label_colors): @@ -1840,7 +1840,7 @@ def translate(p): else: c = cc.to_rgb(edge_label_colors[reverse]) el_color[edge] = c - # + els = dels if edge in edge_label_slopes or (not is_directed and reverse in edge_label_slopes): if edge in edge_label_slopes: @@ -1848,7 +1848,7 @@ def translate(p): else: els = edge_label_slopes[reverse] el_slope[edge] = els - # + elp = delp if edge in edge_label_placements or (not is_directed and reverse in edge_label_placements): if edge in edge_label_placements: diff --git a/src/sage/groups/cubic_braid.py b/src/sage/groups/cubic_braid.py index aab79eac60d..c688ad7f2d0 100644 --- a/src/sage/groups/cubic_braid.py +++ b/src/sage/groups/cubic_braid.py @@ -1557,7 +1557,7 @@ def as_matrix_group(self, root_bur=None, domain=None, characteristic=None, var=' if unitary: from sage.rings.finite_rings.finite_field_base import FiniteField from sage.groups.matrix_gps.unitary import GU - d, d = herm_form.dimensions() + _, d = herm_form.dimensions() if isinstance(domain, FiniteField): base_group = GU(d, domain, var=domain.gen(), invariant_form=herm_form) else: @@ -1568,7 +1568,7 @@ def as_matrix_group(self, root_bur=None, domain=None, characteristic=None, var=' from sage.groups.matrix_gps.finitely_generated import MatrixGroup matrix_group = MatrixGroup(gen_list, category=self.category()) - # ------------------------------------------------------------------------------- + # -------------------------------------------------------------------- # check if there is a well defined group homomorphism to matrix_group # Register map from ``self`` to matrix_group. # Since GAP' check is very expansive (on time and memory), the check is performed diff --git a/src/sage/knots/link.py b/src/sage/knots/link.py index 438c4911bc7..68a5ad14101 100644 --- a/src/sage/knots/link.py +++ b/src/sage/knots/link.py @@ -1829,7 +1829,7 @@ def genus(self): t = [Link(B(si)).number_of_components() for si in s] for i, j in enumerate(s): if not j: - s[i].append(-2) + j.append(-2) for i in s: q2 = max(abs(k) + 1 for k in i) q.append(q2) diff --git a/src/sage/manifolds/chart.py b/src/sage/manifolds/chart.py index 632548505f7..86c3087d101 100644 --- a/src/sage/manifolds/chart.py +++ b/src/sage/manifolds/chart.py @@ -399,7 +399,7 @@ def __init__(self, domain, coordinates, calc_method=None, periods=None, # Initialization of the set of charts which the current chart is a # restriction of: self._supercharts = set([self]) - # + self._dom_restrict = {} # dict. of the restrictions of self to # subsets of self._domain, with the # subsets as keys diff --git a/src/sage/manifolds/differentiable/characteristic_cohomology_class.py b/src/sage/manifolds/differentiable/characteristic_cohomology_class.py index b65cc83a317..51f32ffb4b8 100644 --- a/src/sage/manifolds/differentiable/characteristic_cohomology_class.py +++ b/src/sage/manifolds/differentiable/characteristic_cohomology_class.py @@ -905,7 +905,7 @@ def _build_element(self, *args, **kwargs): name = 'c' class_type = 'multiplicative' val = 1 + x - if val == 'Pontryagin': + elif val == 'Pontryagin': if vbundle._field_type != 'real': raise ValueError(f'total Pontryagin class not defined on {vbundle}') if name is None: @@ -966,7 +966,7 @@ def _build_element(self, *args, **kwargs): class_type = 'Pfaffian' val = x else: - ValueError(f'predefined class "{val}" unknown') + raise ValueError(f'predefined class "{val}" unknown') # turn symbolic expression into a polynomial via Taylor expansion if isinstance(val, Expression): @@ -978,7 +978,7 @@ def _build_element(self, *args, **kwargs): elif vbundle._field_type == 'complex': pow_range = dim // 2 else: - ValueError(f'field type of {vbundle} must be real or complex') + raise ValueError(f'field type of {vbundle} must be real or complex') val = P(val.taylor(x, 0, pow_range)) @@ -1004,7 +1004,7 @@ def _build_element(self, *args, **kwargs): val = P([(-1) ** k * val[2 * k + 1] for k in range(n + 1)]) sym = multiplicative_sequence(val, n) else: - AttributeError('unkown class type') + raise AttributeError('unkown class type') d = {} w_vec = self._weighted_vectors diff --git a/src/sage/manifolds/differentiable/diff_map.py b/src/sage/manifolds/differentiable/diff_map.py index 7ff09814164..c238bcd54d5 100644 --- a/src/sage/manifolds/differentiable/diff_map.py +++ b/src/sage/manifolds/differentiable/diff_map.py @@ -1266,7 +1266,7 @@ def pushforward(self, tensor): "the {} by the {}".format(tensor, self)) # Vector field module for the result: fmodule2 = dom1.vector_field_module(dest_map=self) - # + frame2 = fmodule2.basis(from_frame=chart2.frame()) si1 = dom1.start_index() si2 = fmodule2._sindex diff --git a/src/sage/manifolds/differentiable/examples/euclidean.py b/src/sage/manifolds/differentiable/examples/euclidean.py index 87066ca191b..555881193cf 100644 --- a/src/sage/manifolds/differentiable/examples/euclidean.py +++ b/src/sage/manifolds/differentiable/examples/euclidean.py @@ -1707,7 +1707,7 @@ def __init__(self, name=None, latex_name=None, coordinates='Cartesian', symbols = 'r ph:\\phi z' self._spherical_chart = None # to be constructed later if necessary self._spherical_frame = None # orthonormal frame - self._cylindrical_chart = None # + self._cylindrical_chart = None self._cylindrical_frame = None # orthonormal frame init_coord_methods = {'Cartesian': self._init_cartesian, 'spherical': self._init_spherical, diff --git a/src/sage/manifolds/differentiable/manifold.py b/src/sage/manifolds/differentiable/manifold.py index 81b20482e64..285a160e7ff 100644 --- a/src/sage/manifolds/differentiable/manifold.py +++ b/src/sage/manifolds/differentiable/manifold.py @@ -3158,7 +3158,7 @@ def vector_frame(self, *args, **kwargs) -> VectorFrame: latex_indices = kwargs.pop('latex_indices', None) symbol_dual = kwargs.pop('symbol_dual', None) latex_symbol_dual = kwargs.pop('latex_symbol_dual', None) - # + if vector_fields: dest_map0 = vector_fields[0].parent().destination_map() if dest_map and dest_map is not dest_map0: diff --git a/src/sage/manifolds/differentiable/vectorfield_module.py b/src/sage/manifolds/differentiable/vectorfield_module.py index 200c69c078a..43efcb19aa6 100644 --- a/src/sage/manifolds/differentiable/vectorfield_module.py +++ b/src/sage/manifolds/differentiable/vectorfield_module.py @@ -2261,10 +2261,10 @@ def tensor_from_comp(self, tensor_type, comp, name=None, if isinstance(comp, CompWithSym): resu._sym = comp._sym resu._antisym = comp._antisym - # + # 2/ Tensor components set to comp: resu._components[comp._frame] = comp - # + return resu def sym_bilinear_form(self, name=None, latex_name=None): diff --git a/src/sage/manifolds/differentiable/vectorframe.py b/src/sage/manifolds/differentiable/vectorframe.py index 699f5802552..a284c6487b6 100644 --- a/src/sage/manifolds/differentiable/vectorframe.py +++ b/src/sage/manifolds/differentiable/vectorframe.py @@ -736,11 +736,11 @@ def __init__(self, vector_field_module, symbol, latex_symbol=None, if dest_map is self._domain.identity_map(): # The frame is added to the list of the domain's covering frames: self._domain._set_covering_frame(self) - # + # Dual coframe self._coframe = self.dual_basis() # self._coframe = a shortcut for # self._dual_basis - # + # Derived quantities: # Initialization of the set of frames that are restrictions of the # current frame to subdomains of the frame domain: @@ -748,7 +748,7 @@ def __init__(self, vector_field_module, symbol, latex_symbol=None, # Initialization of the set of frames which the current frame is a # restriction of: self._superframes = set([self]) - # + self._restrictions = {} # dict. of the restrictions of self to # subdomains of self._domain, with the # subdomains as keys diff --git a/src/sage/manifolds/manifold.py b/src/sage/manifolds/manifold.py index 1530d8d29b7..c27cd0b6434 100644 --- a/src/sage/manifolds/manifold.py +++ b/src/sage/manifolds/manifold.py @@ -582,11 +582,11 @@ def __init__(self, n, name, field, structure, base_manifold=None, category=category) self._is_open = True self._open_covers.append([self]) # list of open covers of self - # + if not isinstance(start_index, (int, Integer)): raise TypeError("the starting index must be an integer") self._sindex = start_index - # + self._atlas = [] # list of charts defined on subsets of self self._top_charts = [] # list of charts defined on subsets of self # that are not subcharts of charts on larger subsets diff --git a/src/sage/manifolds/scalarfield.py b/src/sage/manifolds/scalarfield.py index 0b77bc6c681..62c728ff5bb 100644 --- a/src/sage/manifolds/scalarfield.py +++ b/src/sage/manifolds/scalarfield.py @@ -2179,7 +2179,7 @@ def _display_expression(self, chart, result): else: field_name = str(field) field_latex_name = latex(field) - # + result = FormattedExpansion() if self._name is None: symbol = "" diff --git a/src/sage/manifolds/vector_bundle.py b/src/sage/manifolds/vector_bundle.py index fe566a614c4..fa2d277d012 100644 --- a/src/sage/manifolds/vector_bundle.py +++ b/src/sage/manifolds/vector_bundle.py @@ -783,7 +783,7 @@ def local_frame(self, *args, **kwargs): symbol_dual = kwargs.pop('symbol_dual', None) latex_symbol_dual = kwargs.pop('latex_symbol_dual', None) domain = kwargs.pop('domain', None) - # + sec_module = self.section_module(domain=domain, force_free=True) resu = LocalFrame(sec_module, symbol=symbol, latex_symbol=latex_symbol, indices=indices, latex_indices=latex_indices, diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py index fee1931bf46..057d01472c2 100644 --- a/src/sage/plot/multigraphics.py +++ b/src/sage/plot/multigraphics.py @@ -141,7 +141,7 @@ def __init__(self, graphics_list): """ self._glist = [] self._positions = [] - # + for ins in graphics_list: if isinstance(ins, Graphics): self.append(ins) # default position diff --git a/src/sage/tensor/modules/finite_rank_free_module.py b/src/sage/tensor/modules/finite_rank_free_module.py index 2050ec4ee33..0a979fd6b6f 100644 --- a/src/sage/tensor/modules/finite_rank_free_module.py +++ b/src/sage/tensor/modules/finite_rank_free_module.py @@ -2309,10 +2309,10 @@ def tensor_from_comp(self, tensor_type, comp, name=None, latex_name=None): if isinstance(comp, CompWithSym): resu._sym = comp._sym resu._antisym = comp._antisym - # + # 2/ Tensor components set to comp: resu._components[comp._frame] = comp - # + return resu def alternating_contravariant_tensor(self, degree, name=None, diff --git a/src/sage/tensor/modules/free_module_basis.py b/src/sage/tensor/modules/free_module_basis.py index 1028f3d2444..4e531b54e6e 100644 --- a/src/sage/tensor/modules/free_module_basis.py +++ b/src/sage/tensor/modules/free_module_basis.py @@ -1066,5 +1066,5 @@ def new_basis(self, change_of_basis, symbol, latex_symbol=None, # of changes of bases: fmodule._basis_changes[(self, the_new_basis)] = transf fmodule._basis_changes[(the_new_basis, self)] = inv_transf - # + return the_new_basis diff --git a/src/sage/version.py b/src/sage/version.py index 9929ed554be..f41ec973843 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.4.rc1' -date = '2024-06-27' -banner = 'SageMath version 10.4.rc1, Release Date: 2024-06-27' +version = '10.4.rc2' +date = '2024-07-04' +banner = 'SageMath version 10.4.rc2, Release Date: 2024-07-04' diff --git a/src/sage_docbuild/conf.py b/src/sage_docbuild/conf.py index e0e14d8e785..9ff67bc9ca7 100644 --- a/src/sage_docbuild/conf.py +++ b/src/sage_docbuild/conf.py @@ -354,7 +354,7 @@ def set_intersphinx_mappings(app, config): for directory in os.listdir(os.path.join(invpath)): if directory == 'jupyter_execute': # This directory is created by jupyter-sphinx extension for - # internal use and should be ignored here. See trac #33507. + # internal use and should be ignored here. See Issue #33507. continue if os.path.isdir(os.path.join(invpath, directory)): src = os.path.join(refpath, directory) @@ -442,7 +442,9 @@ def linkcode_resolve(domain, info): } if not version.split('.')[-1].isnumeric(): # develop version - ver = f'{version}' + # This URL is hardcoded in the file .github/workflows/doc-publish.yml. + # See NETLIFY_ALIAS of the "Deploy to Netlify" step. + ver = f'{version}' github_ref = os.environ.get('GITHUB_REF', '') if github_ref: match = re.search(r'refs/pull/(\d+)/merge', github_ref) @@ -631,7 +633,7 @@ def linkcode_resolve(domain, info): \let\textLaTeX\LaTeX \AtBeginDocument{\renewcommand*{\LaTeX}{\hbox{\textLaTeX}}} -% Workaround for a LaTeX bug -- see trac #31397 and +% Workaround for a LaTeX bug -- see Issue #31397 and % https://tex.stackexchange.com/questions/583391/mactex-2020-error-with-report-hyperref-mathbf-in-chapter. \makeatletter \pdfstringdefDisableCommands{% diff --git a/src/tox.ini b/src/tox.ini index c270270ff52..85a033166bb 100644 --- a/src/tox.ini +++ b/src/tox.ini @@ -315,7 +315,7 @@ passenv = RUFF_OUTPUT_FORMAT # 1 F402 [ ] Import `factor` from line 259 shadowed by loop variable # 1 PLC0208 [*] Use a sequence type instead of a `set` when iterating over values # -commands = ruff check --ignore PLR2004,I001,F401,E741,F821,PLR0912,PLR0913,E402,PLR0915,PLW2901,PLR5501,PLR0911,E731,F405,PLR1714,F403,PLR0402,PLW0603,F841,E713,PLW0602,PLR1711,E714,PLR1701,PLW3301,PLW1510,E721,PLW0120,F811,PLC0414,E743,PLE0101,PLR0124,PLW0127,F541,PLW1508,PLC3002,E742,PLE0302,PLW0129,F402,PLC0208 {posargs:{toxinidir}/sage/} +commands = ruff check --ignore PLR2004,I001,F401,E741,F821,PLR0912,PLR0913,E402,PLR0915,PLW2901,PLR5501,PLR0911,E731,F405,PLR1714,PLR1736,F403,PLR0402,PLW0603,F841,E713,PLW0602,PLR1711,E714,PLR1701,PLR1704,PLW3301,PLW1510,E721,PLW0120,F811,PLC2401,PLC0414,E743,PLE0101,PLR0124,PLW0127,F541,PLW1508,PLC3002,E742,PLE0302,PLW0129,F402,PLC0208 {posargs:{toxinidir}/sage/} [flake8] rst-roles =