diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6b08a0fe270..276d2e3671f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -31,17 +31,3 @@ jobs: run: pip install tox relint - name: Lint using relint run: tox -e relint src/sage/ - lint-pyright: - name: Static type check with pyright - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Set up node to install pyright - uses: actions/setup-node@v1 - with: - node-version: '12' - - name: Install pyright - run: npm install -g pyright - - name: Lint using pyright - run: pyright diff --git a/.zenodo.json b/.zenodo.json index a479748a194..51e1992f633 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,10 +1,10 @@ { "description": "Mirror of the Sage https://sagemath.org/ source tree", "license": "other-open", - "title": "sagemath/sage: 9.5.beta1", - "version": "9.5.beta1", + "title": "sagemath/sage: 9.5.beta2", + "version": "9.5.beta2", "upload_type": "software", - "publication_date": "2021-09-13", + "publication_date": "2021-09-26", "creators": [ { "affiliation": "SageMath.org", @@ -15,7 +15,7 @@ "related_identifiers": [ { "scheme": "url", - "identifier": "https://github.com/sagemath/sage/tree/9.5.beta1", + "identifier": "https://github.com/sagemath/sage/tree/9.5.beta2", "relation": "isSupplementTo" }, { diff --git a/VERSION.txt b/VERSION.txt index aa602ec847b..85f52b22a59 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -SageMath version 9.5.beta1, Release Date: 2021-09-13 +SageMath version 9.5.beta2, Release Date: 2021-09-26 diff --git a/build/bin/sage-dist-helpers b/build/bin/sage-dist-helpers index 5f52e7d271d..4a8862d50f6 100644 --- a/build/bin/sage-dist-helpers +++ b/build/bin/sage-dist-helpers @@ -240,7 +240,7 @@ sdh_pip_install() { echo "Installing $PKG_NAME" mkdir -p dist rm -f dist/*.whl - python3 -m pip wheel --use-feature=in-tree-build --wheel-dir=dist --no-binary :all: --verbose --no-deps --no-index --isolated --no-build-isolation "$@" || \ + python3 -m pip wheel --use-feature=in-tree-build --wheel-dir=dist --no-binary :all: --verbose --no-deps --no-index --isolated --no-build-isolation --ignore-requires-python "$@" || \ sdh_die "Error building a wheel for $PKG_NAME" sdh_store_and_pip_install_wheel . @@ -275,6 +275,17 @@ sdh_store_wheel() { } sdh_store_and_pip_install_wheel() { + local pip_options="" + while [ $# -gt 0 ]; do + case $1 in + -*) pip_options="$pip_options $1" + ;; + *) + break + ;; + esac + shift + done sdh_store_wheel "$@" if [ -n "$SAGE_SUDO" ]; then # Trac #29585: Do the SAGE_DESTDIR staging of the wheel installation @@ -295,7 +306,7 @@ sdh_store_and_pip_install_wheel() { local sudo="" local root="" fi - $sudo sage-pip-install $root "$wheel" || \ + $sudo sage-pip-install $root $pip_options "$wheel" || \ sdh_die "Error installing ${wheel##*/}" if [ -n "${SAGE_PKG_DIR}" ]; then # Record name of installed distribution name for uninstallation. diff --git a/build/bin/sage-pip-install b/build/bin/sage-pip-install index 343ba8027d9..6c01f8444f7 100755 --- a/build/bin/sage-pip-install +++ b/build/bin/sage-pip-install @@ -3,16 +3,15 @@ # built wheel. # Default arguments for all packages installed with `pip install` -# --ignore-installed : Force pip to re-install package even if it thinks it's -# already installed (for which it sometimes gets false -# positives for partially-installed packages). # --verbose : Display the output when running setup.py. -# --no-deps : Don't install runtime dependencies from PyPI. # --no-index : Don't look at the package index. -# This also disables pip's version self-check. +# --disable-pip-version-check : Disables pip's version self-check. # --isolated : Don't read configuration files such as # ~/.pydistutils.cfg -pip_install_flags="--ignore-installed --verbose --no-deps --no-index --isolated" +# --no-cache-dir : Disable the cache. +# (so that no previously built wheels can sneak in to +# resolve runtime dependencies) +pip_install_flags="--verbose --no-index --find-links=$SAGE_SPKG_WHEELS --disable-pip-version-check --isolated --no-cache-dir" # Note: "sage-pip-install" is meant to be run after $(PYTHON) has # been installed (either as an spkg or as a venv over a system python3). @@ -35,6 +34,17 @@ LOCK="$SAGE_LOCAL/var/lock/$PIP.lock" # to apply a shared lock) sage-flock -s $LOCK $PYTHON -m pip install $pip_install_flags "$@" if [ $? -ne 0 ]; then - echo >&2 "Error: installing with $PIP failed" - exit 3 + # --ignore-installed : Force pip to re-install package even if it thinks it's + # already installed (for which it sometimes gets false + # positives for partially-installed packages). + # --no-deps : Don't install runtime dependencies from PyPI. + extra_pip_install_flags="--no-deps --ignore-installed --ignore-requires-python" + echo >&2 "Warning: installing with \"$PYTHON -m pip install $pip_install_flags\" failed. Retrying, adding \"$extra_pip_install_flags\"" + sage-flock -s $LOCK $PYTHON -m pip install $pip_install_flags $extra_pip_install_flags "$@" + if [ $? -ne 0 ]; then + echo >&2 "Error: installing with pip failed" + exit 3 + else + echo >&2 "Warning: The installation needed to use \"$extra_pip_install_flags\" 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." + fi fi diff --git a/build/make/Makefile.in b/build/make/Makefile.in index 3aaa39336f7..3e145dc4f0a 100644 --- a/build/make/Makefile.in +++ b/build/make/Makefile.in @@ -534,8 +534,10 @@ $(1)-$(4)-no-deps: $(1)-no-deps: $(1)-$(4)-no-deps $(1)-$(4)-clean: - sage-spkg-uninstall $(if $(filter $(1),$(TOOLCHAIN_DEPS)),--keep-files) \ - $(1) '$$($(4))' + if [ -d '$$($(4))' ]; then \ + sage-spkg-uninstall $(if $(filter $(1),$(TOOLCHAIN_DEPS)),--keep-files) \ + $(1) '$$($(4))'; \ + fi $(1)-clean: $(1)-$(4)-clean diff --git a/build/pkgs/bleach/dependencies b/build/pkgs/bleach/dependencies index 15df0c4d6d8..7b139dc904c 100644 --- a/build/pkgs/bleach/dependencies +++ b/build/pkgs/bleach/dependencies @@ -1,4 +1,4 @@ -$(PYTHON) | $(PYTHON_TOOLCHAIN) +$(PYTHON) packaging six | $(PYTHON_TOOLCHAIN) ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/configure/checksums.ini b/build/pkgs/configure/checksums.ini index d27a1b81e57..7e67ba41b21 100644 --- a/build/pkgs/configure/checksums.ini +++ b/build/pkgs/configure/checksums.ini @@ -1,4 +1,4 @@ tarball=configure-VERSION.tar.gz -sha1=c68b33782a9f983d5cd132cdb85b9cdc424d5c04 -md5=be4260558a6cf800a2e9eda789efc32b -cksum=344926279 +sha1=9b22a30a08e51ba00cd1d83434baaefd3185301e +md5=0ac843dd51c77c37da876beae77af4bf +cksum=1637280499 diff --git a/build/pkgs/configure/package-version.txt b/build/pkgs/configure/package-version.txt index 2f32b1096a6..f8d177cfe6e 100644 --- a/build/pkgs/configure/package-version.txt +++ b/build/pkgs/configure/package-version.txt @@ -1 +1 @@ -a2af3f6a457f4c5618b72690a5c0be2b02360afb +0a4f2a302c23d9c821b7be2cd6a7429075b7da60 diff --git a/build/pkgs/database_knotinfo/checksums.ini b/build/pkgs/database_knotinfo/checksums.ini index c0c4e86ceb2..d3e1988a7e1 100644 --- a/build/pkgs/database_knotinfo/checksums.ini +++ b/build/pkgs/database_knotinfo/checksums.ini @@ -1,5 +1,5 @@ tarball=database_knotinfo-VERSION.tar.gz -sha1=2d758c5f8bf346162d13bec1d5bccfec9d27baa1 -md5=ec20d43af0c4ecf59dfd281c6ccc4ef0 -cksum=2792610748 +sha1=549e3162b2ba6942dede30366072d10e26643f54 +md5=c6487321cd2e0fd6b9f9ee7bdfa19993 +cksum=2255768788 upstream_url=https://pypi.io/packages/source/d/database_knotinfo/database_knotinfo-VERSION.tar.gz diff --git a/build/pkgs/database_knotinfo/dependencies b/build/pkgs/database_knotinfo/dependencies index 0738c2d7777..30b944a731d 100644 --- a/build/pkgs/database_knotinfo/dependencies +++ b/build/pkgs/database_knotinfo/dependencies @@ -1,4 +1,4 @@ -$(PYTHON) | $(PYTHON_TOOLCHAIN) +$(PYTHON) | $(PYTHON_TOOLCHAIN) $(and $(filter-out no,$(SAGE_CHECK_database_knotinfo)), $(SAGERUNTIME) ipywidgets sympy singular gap libhomfly libbraiding matplotlib) ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/database_knotinfo/package-version.txt b/build/pkgs/database_knotinfo/package-version.txt index eb49d7c7fdc..bb805851b41 100644 --- a/build/pkgs/database_knotinfo/package-version.txt +++ b/build/pkgs/database_knotinfo/package-version.txt @@ -1 +1 @@ -0.7 +2021.9.1 diff --git a/build/pkgs/database_knotinfo/spkg-check.in b/build/pkgs/database_knotinfo/spkg-check.in index 6a1eb79a95a..4f776156682 100644 --- a/build/pkgs/database_knotinfo/spkg-check.in +++ b/build/pkgs/database_knotinfo/spkg-check.in @@ -1,10 +1,5 @@ cd $SAGE_ROOT/src/sage/ -echo "Testing databases/knotinfo_db.py" -sage -t --long --optional="sage,database_knotinfo" databases/knotinfo_db.py || sdh_die "Error testing KnotInfo databases" - -echo "Testing knots/knotinfo.py" -sage -t --optional="sage,database_knotinfo" knots/knotinfo.py || sdh_die "Error testing KnotInfo funcionality" - -echo "Testing knots/link.py" -sage -t --optional="sage,database_knotinfo" knots/link.py || sdh_die "Error testing KnotInfo funcionality" +FILES="databases/ features/ knots/" +echo "Testing: "$FILES +sage -tp --long --optional="sage,database_knotinfo" $FILES || sdh_die "Error testing KnotInfo databases" diff --git a/build/pkgs/database_knotinfo/spkg-install.in b/build/pkgs/database_knotinfo/spkg-install.in index f9667e4a733..37ac1a53437 100644 --- a/build/pkgs/database_knotinfo/spkg-install.in +++ b/build/pkgs/database_knotinfo/spkg-install.in @@ -1,9 +1,2 @@ cd src sdh_pip_install . - -FILECACHE="${SAGE_SHARE}/knotinfo" -if [ -d $FILECACHE ] -then - echo "Clearing former filecache of knotinfo" - rm -rf $FILECACHE -fi diff --git a/build/pkgs/distlib/checksums.ini b/build/pkgs/distlib/checksums.ini index 718023bc038..11203a5485f 100644 --- a/build/pkgs/distlib/checksums.ini +++ b/build/pkgs/distlib/checksums.ini @@ -1,5 +1,5 @@ tarball=distlib-VERSION.zip -sha1=1c575431e31c32d25596c360e81bba7fe4638669 -md5=4baf787d8aceb260d6f77cb31bf27cf6 -cksum=2902365751 +sha1=b36dcbb9542fa58ada97ab27269176ff7d170724 +md5=50196f22cc2ed82fe2cf6c8fa3220d78 +cksum=801947531 upstream_url=https://pypi.io/packages/source/d/distlib/distlib-VERSION.zip diff --git a/build/pkgs/distlib/package-version.txt b/build/pkgs/distlib/package-version.txt index 9e11b32fcaa..d15723fbe8d 100644 --- a/build/pkgs/distlib/package-version.txt +++ b/build/pkgs/distlib/package-version.txt @@ -1 +1 @@ -0.3.1 +0.3.2 diff --git a/build/pkgs/flit_core/dependencies b/build/pkgs/flit_core/dependencies index 0738c2d7777..93c460228b4 100644 --- a/build/pkgs/flit_core/dependencies +++ b/build/pkgs/flit_core/dependencies @@ -1,4 +1,4 @@ -$(PYTHON) | $(PYTHON_TOOLCHAIN) +$(PYTHON) | pip ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/html5lib/dependencies b/build/pkgs/html5lib/dependencies index 15df0c4d6d8..cdcfeeba041 100644 --- a/build/pkgs/html5lib/dependencies +++ b/build/pkgs/html5lib/dependencies @@ -1,4 +1,4 @@ -$(PYTHON) | $(PYTHON_TOOLCHAIN) +$(PYTHON) webencodings | $(PYTHON_TOOLCHAIN) ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/importlib_metadata/checksums.ini b/build/pkgs/importlib_metadata/checksums.ini index 92286cd18a8..4006b5133d2 100644 --- a/build/pkgs/importlib_metadata/checksums.ini +++ b/build/pkgs/importlib_metadata/checksums.ini @@ -1,5 +1,5 @@ tarball=importlib_metadata-VERSION.tar.gz -sha1=9a41be5cdf1fb347fca35640d607cbb27873cd02 -md5=de8753734db41db35d763475b3cf56be -cksum=2900617554 +sha1=1572500dd099439cbd86bb70bfe1d206fbc844f6 +md5=5b944bce3fccaf848f0cba7a07f850a1 +cksum=416853070 upstream_url=https://pypi.io/packages/source/i/importlib_metadata/importlib_metadata-VERSION.tar.gz diff --git a/build/pkgs/importlib_metadata/package-version.txt b/build/pkgs/importlib_metadata/package-version.txt index 1454f6ed4b7..697e993915d 100644 --- a/build/pkgs/importlib_metadata/package-version.txt +++ b/build/pkgs/importlib_metadata/package-version.txt @@ -1 +1 @@ -4.0.1 +4.8.1 diff --git a/build/pkgs/importlib_resources/checksums.ini b/build/pkgs/importlib_resources/checksums.ini index 7b2b8a13aee..f769a9f43b4 100644 --- a/build/pkgs/importlib_resources/checksums.ini +++ b/build/pkgs/importlib_resources/checksums.ini @@ -1,5 +1,5 @@ tarball=importlib_resources-VERSION.tar.gz -sha1=d4b853132e9b9a0c58610e23df380c84be428c08 -md5=a4586b3cbb3d39c7a5e7ffc49d9ceb53 -cksum=1484460315 +sha1=d1f2742895a68f3f8d19dd7285df1687877fb15a +md5=5db738106ca7c05340495c36357986a2 +cksum=1338307365 upstream_url=https://pypi.io/packages/source/i/importlib_resources/importlib_resources-VERSION.tar.gz diff --git a/build/pkgs/importlib_resources/dependencies b/build/pkgs/importlib_resources/dependencies index 0738c2d7777..58927ab6f75 100644 --- a/build/pkgs/importlib_resources/dependencies +++ b/build/pkgs/importlib_resources/dependencies @@ -1,4 +1,4 @@ -$(PYTHON) | $(PYTHON_TOOLCHAIN) +$(PYTHON) zipp | $(PYTHON_TOOLCHAIN) ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/importlib_resources/package-version.txt b/build/pkgs/importlib_resources/package-version.txt index 76e9e619d63..ce7f2b425b5 100644 --- a/build/pkgs/importlib_resources/package-version.txt +++ b/build/pkgs/importlib_resources/package-version.txt @@ -1 +1 @@ -5.1.4 +5.2.2 diff --git a/build/pkgs/ipykernel/dependencies b/build/pkgs/ipykernel/dependencies index 541ee185018..45d2d0c0eb9 100644 --- a/build/pkgs/ipykernel/dependencies +++ b/build/pkgs/ipykernel/dependencies @@ -1,4 +1,4 @@ -$(PYTHON) | ipython jupyter_client $(PYTHON_TOOLCHAIN) scandir +$(PYTHON) debugpy matplotlib_inline ipython jupyter_client scandir | $(PYTHON_TOOLCHAIN) ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/jupyterlab_pygments/dependencies b/build/pkgs/jupyterlab_pygments/dependencies index 0738c2d7777..a59532cdda1 100644 --- a/build/pkgs/jupyterlab_pygments/dependencies +++ b/build/pkgs/jupyterlab_pygments/dependencies @@ -1,4 +1,4 @@ -$(PYTHON) | $(PYTHON_TOOLCHAIN) +$(PYTHON) pygments | $(PYTHON_TOOLCHAIN) ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/matplotlib_inline/dependencies b/build/pkgs/matplotlib_inline/dependencies index 0738c2d7777..1da34eeae60 100644 --- a/build/pkgs/matplotlib_inline/dependencies +++ b/build/pkgs/matplotlib_inline/dependencies @@ -1,4 +1,4 @@ -$(PYTHON) | $(PYTHON_TOOLCHAIN) +$(PYTHON) traitlets | $(PYTHON_TOOLCHAIN) ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/nbclient/dependencies b/build/pkgs/nbclient/dependencies index 0738c2d7777..d6cb580bd7a 100644 --- a/build/pkgs/nbclient/dependencies +++ b/build/pkgs/nbclient/dependencies @@ -1,4 +1,4 @@ -$(PYTHON) | $(PYTHON_TOOLCHAIN) +$(PYTHON) jupyter_client | $(PYTHON_TOOLCHAIN) ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/nbconvert/dependencies b/build/pkgs/nbconvert/dependencies index 100e53ee242..9a2dd453b8c 100644 --- a/build/pkgs/nbconvert/dependencies +++ b/build/pkgs/nbconvert/dependencies @@ -1,4 +1,4 @@ -$(PYTHON) | $(PYTHON_TOOLCHAIN) mistune jinja2 pygments traitlets jupyter_core nbformat entrypoints bleach pandocfilters testpath defusedxml +$(PYTHON) mistune jinja2 pygments traitlets jupyter_core nbformat entrypoints bleach pandocfilters testpath defusedxml jupyter_client jupyterlab_pygments nbclient | $(PYTHON_TOOLCHAIN) ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/numpy/checksums.ini b/build/pkgs/numpy/checksums.ini index 74d283e01f0..b306701d888 100644 --- a/build/pkgs/numpy/checksums.ini +++ b/build/pkgs/numpy/checksums.ini @@ -1,5 +1,5 @@ tarball=numpy-VERSION.zip -sha1=56731f9eedf3bd42de2940515cfe3fadea7dfcca -md5=949d9114af9accc25ede1daa359c4227 -cksum=2320980313 +sha1=c7eb91a2232f7843301c355795860baaa0280909 +md5=5638d5dae3ca387be562912312db842e +cksum=2204147896 upstream_url=https://pypi.io/packages/source/n/numpy/numpy-VERSION.zip diff --git a/build/pkgs/numpy/package-version.txt b/build/pkgs/numpy/package-version.txt index f5b00dc262b..0369d0b1e93 100644 --- a/build/pkgs/numpy/package-version.txt +++ b/build/pkgs/numpy/package-version.txt @@ -1 +1 @@ -1.20.3 +1.21.2 diff --git a/build/pkgs/openssl/checksums.ini b/build/pkgs/openssl/checksums.ini index b248035442f..3c447ff698b 100644 --- a/build/pkgs/openssl/checksums.ini +++ b/build/pkgs/openssl/checksums.ini @@ -1,5 +1,5 @@ tarball=openssl-VERSION.tar.gz -sha1=261ea1ad4bbf7738622bea5caa97da0283fc3166 -md5=53807796206619b62037a178846ebe7e -cksum=980103943 +sha1=3be896f1b33bc01af874ccca701a6f700af9de20 +md5=43c5ab628b7ab899d7cd4a4c7fe4067f +cksum=2515710600 upstream_url=https://www.openssl.org/source/openssl-VERSION.tar.gz diff --git a/build/pkgs/openssl/package-version.txt b/build/pkgs/openssl/package-version.txt index 5cff90533e9..4a36342fcab 100644 --- a/build/pkgs/openssl/package-version.txt +++ b/build/pkgs/openssl/package-version.txt @@ -1 +1 @@ -3.0.0-beta2 +3.0.0 diff --git a/build/pkgs/packaging/checksums.ini b/build/pkgs/packaging/checksums.ini index d129ec14022..e68006c5b1b 100644 --- a/build/pkgs/packaging/checksums.ini +++ b/build/pkgs/packaging/checksums.ini @@ -1,5 +1,5 @@ tarball=packaging-VERSION.tar.gz -sha1=6f8880ab84f05714a2549c1b54314b4f79fee319 -md5=5377308b3ba89f2d78c05e7f485be65d -cksum=1567718319 +sha1=6ba3b8ff3ee43d1d4c0b658241f4fd6036ee7c78 +md5=240ba5823ed31051a1254e74c9d18d55 +cksum=3836397838 upstream_url=https://pypi.io/packages/source/p/packaging/packaging-VERSION.tar.gz diff --git a/build/pkgs/packaging/dependencies b/build/pkgs/packaging/dependencies index 256333c03d8..4818dfe9b48 100644 --- a/build/pkgs/packaging/dependencies +++ b/build/pkgs/packaging/dependencies @@ -1,4 +1,4 @@ -$(PYTHON) | $(PYTHON_TOOLCHAIN) pyparsing six +$(PYTHON) | setuptools pip wheel pyparsing ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/packaging/package-version.txt b/build/pkgs/packaging/package-version.txt index 48ef2c10bab..5f39e914469 100644 --- a/build/pkgs/packaging/package-version.txt +++ b/build/pkgs/packaging/package-version.txt @@ -1 +1 @@ -20.9 +21.0 diff --git a/build/pkgs/pip/checksums.ini b/build/pkgs/pip/checksums.ini index 858cd7a1023..8fbd5a77b58 100644 --- a/build/pkgs/pip/checksums.ini +++ b/build/pkgs/pip/checksums.ini @@ -1,5 +1,5 @@ tarball=pip-VERSION.tar.gz -sha1=b26e4afd5524f5613edf5b1b94dd1b6e9a2e1f87 -md5=a867fd51eacfd5293f5b7e0c2e7867a7 -cksum=2004742197 +sha1=c6c9348c79a7f8448cd14b9e53baf141ea185dee +md5=efbdb4201a5e6383fb4d12e26f78f355 +cksum=2583473334 upstream_url=https://pypi.io/packages/source/p/pip/pip-VERSION.tar.gz diff --git a/build/pkgs/pip/package-version.txt b/build/pkgs/pip/package-version.txt index 9fcf356b68f..0f058b4809c 100644 --- a/build/pkgs/pip/package-version.txt +++ b/build/pkgs/pip/package-version.txt @@ -1 +1 @@ -21.1.2 +21.2.4 diff --git a/build/pkgs/pip/patches/10029.patch b/build/pkgs/pip/patches/10029.patch deleted file mode 100644 index cfd93403298..00000000000 --- a/build/pkgs/pip/patches/10029.patch +++ /dev/null @@ -1,71 +0,0 @@ -From b8f1fcf863081fde0b9d558759c0e3c46ce09a12 Mon Sep 17 00:00:00 2001 -From: Ben Darnell <> -Date: Fri, 28 May 2021 16:01:41 +0000 -Subject: [PATCH] Avoid importing a non-vendored version of Tornado - -Code depending on this conditional import could break if an old -version of Tornado is present in the environment, rendering pip -unusable. ---- - news/10020.bugfix.rst | 1 + - src/pip/_vendor/tenacity/__init__.py | 10 ++++++---- - tools/vendoring/patches/tenacity.patch | 21 +++++++++++++++++++++ - 3 files changed, 28 insertions(+), 4 deletions(-) - create mode 100644 news/10020.bugfix.rst - create mode 100644 tools/vendoring/patches/tenacity.patch - -diff --git a/news/10020.bugfix.rst b/news/10020.bugfix.rst -new file mode 100644 -index 00000000000..9425626fb07 ---- /dev/null -+++ b/news/10020.bugfix.rst -@@ -0,0 +1 @@ -+Remove unused optional ``tornado`` import in vendored ``tenacity`` to prevent old versions of Tornado from breaking pip. -diff --git a/src/pip/_vendor/tenacity/__init__.py b/src/pip/_vendor/tenacity/__init__.py -index 5f8cb505896..42e9d8940b1 100644 ---- a/src/pip/_vendor/tenacity/__init__.py -+++ b/src/pip/_vendor/tenacity/__init__.py -@@ -22,10 +22,12 @@ - except ImportError: - iscoroutinefunction = None - --try: -- import tornado --except ImportError: -- tornado = None -+# Replace a conditional import with a hard-coded None so that pip does -+# not attempt to use tornado even if it is present in the environment. -+# If tornado is non-None, tenacity will attempt to execute some code -+# that is sensitive to the version of tornado, which could break pip -+# if an old version is found. -+tornado = None - - import sys - import threading -diff --git a/tools/vendoring/patches/tenacity.patch b/tools/vendoring/patches/tenacity.patch -new file mode 100644 -index 00000000000..006588b3653 ---- /dev/null -+++ b/tools/vendoring/patches/tenacity.patch -@@ -0,0 +1,21 @@ -+diff --git a/src/pip/_vendor/tenacity/__init__.py b/src/pip/_vendor/tenacity/__init__.py -+index 5f8cb5058..42e9d8940 100644 -+--- a/src/pip/_vendor/tenacity/__init__.py -++++ b/src/pip/_vendor/tenacity/__init__.py -+@@ -22,10 +22,12 @@ try: -+ except ImportError: -+ iscoroutinefunction = None -+ -+-try: -+- import tornado -+-except ImportError: -+- tornado = None -++# Replace a conditional import with a hard-coded None so that pip does -++# not attempt to use tornado even if it is present in the environment. -++# If tornado is non-None, tenacity will attempt to execute some code -++# that is sensitive to the version of tornado, which could break pip -++# if an old version is found. -++tornado = None -+ -+ import sys -+ import threading diff --git a/build/pkgs/pip/spkg-install.in b/build/pkgs/pip/spkg-install.in index 9db95c4b8cd..651f5c1dc1e 100644 --- a/build/pkgs/pip/spkg-install.in +++ b/build/pkgs/pip/spkg-install.in @@ -6,4 +6,6 @@ sdh_setup_bdist_wheel # source directory in on the PYTHONPATH export PYTHONPATH="$(pwd)/src" -sdh_store_and_pip_install_wheel . +# --ignore-installed makes sure that pip does not mistake +# its own source tree as an existing installation +sdh_store_and_pip_install_wheel --ignore-installed . diff --git a/build/pkgs/pkgconfig/checksums.ini b/build/pkgs/pkgconfig/checksums.ini index 2bd38c7565f..d3cc48bde60 100644 --- a/build/pkgs/pkgconfig/checksums.ini +++ b/build/pkgs/pkgconfig/checksums.ini @@ -1,5 +1,5 @@ tarball=pkgconfig-VERSION.tar.gz -sha1=9db3e565c5bd85ceee16cbc162ab4f2f5019153c -md5=0d889edf670b644bfeaa3bb9444169cb -cksum=3590715331 +sha1=32af6abc220c64b36f745a208b950542b1ab3456 +md5=12523e11b91b050ca49975cc033689a4 +cksum=1707388199 upstream_url=https://pypi.io/packages/source/p/pkgconfig/pkgconfig-VERSION.tar.gz diff --git a/build/pkgs/pkgconfig/package-version.txt b/build/pkgs/pkgconfig/package-version.txt index 4cda8f19edc..9075be49515 100644 --- a/build/pkgs/pkgconfig/package-version.txt +++ b/build/pkgs/pkgconfig/package-version.txt @@ -1 +1 @@ -1.5.2 +1.5.5 diff --git a/build/pkgs/pluggy/checksums.ini b/build/pkgs/pluggy/checksums.ini index 9a6e585fcc9..087f36ad1a6 100644 --- a/build/pkgs/pluggy/checksums.ini +++ b/build/pkgs/pluggy/checksums.ini @@ -1,5 +1,5 @@ tarball=pluggy-VERSION.tar.gz -sha1=828b2c10996d902b8c47f2fded0e101c636b9ff9 -md5=7f610e28b8b34487336b585a3dfb803d -cksum=3074963981 +sha1=0486bc511fc3415bb84252339b63b9d9e6d0734a +md5=daa6fddfb6cd364f3c82e52098911e4b +cksum=996010694 upstream_url=https://pypi.io/packages/source/p/pluggy/pluggy-VERSION.tar.gz diff --git a/build/pkgs/pluggy/package-version.txt b/build/pkgs/pluggy/package-version.txt index c317a91891f..3eefcb9dd5b 100644 --- a/build/pkgs/pluggy/package-version.txt +++ b/build/pkgs/pluggy/package-version.txt @@ -1 +1 @@ -0.13.1 +1.0.0 diff --git a/build/pkgs/pynac/SPKG.rst b/build/pkgs/pynac/SPKG.rst deleted file mode 100644 index 61486cae128..00000000000 --- a/build/pkgs/pynac/SPKG.rst +++ /dev/null @@ -1,28 +0,0 @@ -pynac: A fork of the symbolic computation software GiNaC that uses Python objects -================================================================================= - -Description ------------ - -A modified version of GiNaC that replaces the dependency on CLN by -Python. - -License -------- - -GPL V2+ - - -Upstream Contact ----------------- - -- https://github.com/pynac/pynac -- http://pynac.org -- Burcin Erocal - burcin spam.erocal.org -- William Stein - wstein spam.gmail.com -- Mike Hansen - mhansen spam.gmail.com - -Dependencies ------------- - -Python diff --git a/build/pkgs/pynac/checksums.ini b/build/pkgs/pynac/checksums.ini deleted file mode 100644 index f4ac5637046..00000000000 --- a/build/pkgs/pynac/checksums.ini +++ /dev/null @@ -1,5 +0,0 @@ -tarball=pynac-VERSION.tar.bz2 -sha1=aed9f7fb94346d406afe248afdaa6ae0f6c2928b -md5=d5a2f75854f8a30c0d27ecdcadfdb78e -cksum=3621897717 -upstream_url=https://github.com/pynac/pynac/releases/download/pynac-VERSION/pynac-VERSION.tar.bz2 diff --git a/build/pkgs/pynac/dependencies b/build/pkgs/pynac/dependencies deleted file mode 100644 index 94337012126..00000000000 --- a/build/pkgs/pynac/dependencies +++ /dev/null @@ -1,5 +0,0 @@ -$(PYTHON) $(MP_LIBRARY) flint singular | pkgconf - ----------- -All lines of this file are ignored except the first. -It is copied by SAGE_ROOT/build/make/install into SAGE_ROOT/build/make/Makefile. diff --git a/build/pkgs/pynac/distros/conda.txt b/build/pkgs/pynac/distros/conda.txt deleted file mode 100644 index f28f855f90a..00000000000 --- a/build/pkgs/pynac/distros/conda.txt +++ /dev/null @@ -1 +0,0 @@ -pynac diff --git a/build/pkgs/pynac/distros/debian.txt b/build/pkgs/pynac/distros/debian.txt deleted file mode 100644 index 5f088e68bcc..00000000000 --- a/build/pkgs/pynac/distros/debian.txt +++ /dev/null @@ -1 +0,0 @@ -libpynac-dev diff --git a/build/pkgs/pynac/distros/freebsd.txt b/build/pkgs/pynac/distros/freebsd.txt deleted file mode 100644 index e934d704e03..00000000000 --- a/build/pkgs/pynac/distros/freebsd.txt +++ /dev/null @@ -1 +0,0 @@ -math/pynac diff --git a/build/pkgs/pynac/distros/repology.txt b/build/pkgs/pynac/distros/repology.txt deleted file mode 100644 index f28f855f90a..00000000000 --- a/build/pkgs/pynac/distros/repology.txt +++ /dev/null @@ -1 +0,0 @@ -pynac diff --git a/build/pkgs/pynac/package-version.txt b/build/pkgs/pynac/package-version.txt deleted file mode 100644 index 1330c2bc537..00000000000 --- a/build/pkgs/pynac/package-version.txt +++ /dev/null @@ -1 +0,0 @@ -0.7.29.p1 diff --git a/build/pkgs/pynac/patches/realpartloop.patch b/build/pkgs/pynac/patches/realpartloop.patch deleted file mode 100644 index 78d22093144..00000000000 --- a/build/pkgs/pynac/patches/realpartloop.patch +++ /dev/null @@ -1,54 +0,0 @@ -diff --git a/ginac/power.cpp b/ginac/power.cpp -index 5c07324..8f2c179 100644 ---- a/ginac/power.cpp -+++ b/ginac/power.cpp -@@ -790,7 +790,9 @@ ex power::conjugate() const - - ex power::real_part() const - { -- if (exponent.is_integer()) { -+ if (is_exactly_a(exponent) -+ and ((ex_to(exponent).t == LONG) or (ex_to(exponent).t == MPZ))) { -+ numeric nexp = ex_to(exponent); - ex basis_real = basis.real_part(); - if (basis_real == basis) - return *this; -@@ -798,10 +800,10 @@ ex power::real_part() const - a.set_domain(domain::real); - b.set_domain(domain::real); - ex result; -- if (exponent.info(info_flags::posint)) -- result = power(a+I*b,exponent); -+ if (nexp >= 0) -+ result = power(a+I*b, nexp); - else -- result = power(a/(a*a+b*b)-I*b/(a*a+b*b),-exponent); -+ result = power(a/(a*a+b*b)-I*b/(a*a+b*b), -nexp); - result = result.expand(); - result = result.real_part(); - result = result.subs(lst( a==basis_real, b==basis.imag_part() )); -@@ -817,7 +819,9 @@ ex power::real_part() const - - ex power::imag_part() const - { -- if (exponent.info(info_flags::integer)) { -+ if (is_exactly_a(exponent) -+ and ((ex_to(exponent).t == LONG) or (ex_to(exponent).t == MPZ))) { -+ numeric nexp = ex_to(exponent); - ex basis_real = basis.real_part(); - if (basis_real == basis) - return 0; -@@ -825,10 +829,10 @@ ex power::imag_part() const - a.set_domain(domain::real); - b.set_domain(domain::real); - ex result; -- if (exponent.info(info_flags::posint)) -- result = power(a+I*b,exponent); -+ if (nexp >= 0) -+ result = power(a+I*b, nexp); - else -- result = power(a/(a*a+b*b)-I*b/(a*a+b*b),-exponent); -+ result = power(a/(a*a+b*b)-I*b/(a*a+b*b), -nexp); - result = result.expand(); - result = result.imag_part(); - result = result.subs(lst( a==basis_real, b==basis.imag_part() )); diff --git a/build/pkgs/pynac/spkg-install.in b/build/pkgs/pynac/spkg-install.in deleted file mode 100644 index 9fa0d99b2ed..00000000000 --- a/build/pkgs/pynac/spkg-install.in +++ /dev/null @@ -1,45 +0,0 @@ -########################################### -## pynac -########################################### - -export CXXFLAGS="-O2 -g $(echo $CXXFLAGS | sed 's/-fvisibility-inlines-hidden//g')" - -WORKDIR=${PWD}/src -PYNACDIR=${WORKDIR} - -build_pynac() -{ - cd ${PYNACDIR} - PKG_CONFIG_PATH=${SAGE_LOCAL}/lib/pkgconfig; export PKG_CONFIG_PATH - sdh_configure --disable-static --with-giac=no PYTHON=python3 - sdh_make - cd ${WORKDIR} -} - -install_pynac() -{ - rm ${SAGE_LOCAL}/lib/*ginac* - rm ${SAGE_LOCAL}/lib/*pynac* - rm -rf ${SAGE_LOCAL}/include/ginac - rm -rf ${SAGE_LOCAL}/include/pynac - cd ${PYNACDIR} - sdh_make_install - cd ${WORKDIR} -} - -clean_pynac() -{ - true -} - - -cd src - -echo "Starting build..." -echo "Running build_pynac..." -build_pynac -echo "Done build_pynac." - -echo "Installing pynac..." -install_pynac -echo "Done installing pynac." diff --git a/build/pkgs/pyparsing/dependencies b/build/pkgs/pyparsing/dependencies index 15df0c4d6d8..3614951f5cb 100644 --- a/build/pkgs/pyparsing/dependencies +++ b/build/pkgs/pyparsing/dependencies @@ -1,4 +1,4 @@ -$(PYTHON) | $(PYTHON_TOOLCHAIN) +$(PYTHON) | setuptools pip wheel ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/python3/checksums.ini b/build/pkgs/python3/checksums.ini index d7a767ec8ac..9bf4797720f 100644 --- a/build/pkgs/python3/checksums.ini +++ b/build/pkgs/python3/checksums.ini @@ -1,5 +1,5 @@ tarball=Python-VERSION.tar.xz -sha1=05826c93a178872958f6685094ee3514e53ba653 -md5=ecc29a7688f86e550d29dba2ee66cf80 -cksum=2690897923 +sha1=5208c1d1e0e859f42a9bdbb110efd0855ec4ecf1 +md5=fddb060b483bc01850a3f412eea1d954 +cksum=1991454647 upstream_url=https://www.python.org/ftp/python/VERSION/Python-VERSION.tar.xz diff --git a/build/pkgs/python3/package-version.txt b/build/pkgs/python3/package-version.txt index 1635d0f5a14..f69abe410a3 100644 --- a/build/pkgs/python3/package-version.txt +++ b/build/pkgs/python3/package-version.txt @@ -1 +1 @@ -3.9.6 +3.9.7 diff --git a/build/pkgs/python3/spkg-build.in b/build/pkgs/python3/spkg-build.in index bcdc5f6898d..9e1ae082dab 100644 --- a/build/pkgs/python3/spkg-build.in +++ b/build/pkgs/python3/spkg-build.in @@ -107,7 +107,7 @@ fi echo "Testing importing of various modules..." import_errors=false # Trac #31160: We no longer check for readline here. -test_modules="ctypes math hashlib crypt socket zlib sqlite3" +test_modules="ctypes math hashlib crypt socket zlib sqlite3 ssl" if [ "$UNAME" = "Darwin" ]; then test_modules="$test_modules _scproxy" fi diff --git a/build/pkgs/python3/spkg-configure.m4 b/build/pkgs/python3/spkg-configure.m4 index 9ebcdf77fa9..d3eb2ad9b87 100644 --- a/build/pkgs/python3/spkg-configure.m4 +++ b/build/pkgs/python3/spkg-configure.m4 @@ -23,7 +23,7 @@ SAGE_SPKG_CONFIGURE([python3], [ dnl Check if we can do venv with a system python3 dnl instead of building our own copy. dnl Trac #31160: We no longer check for readline here. - check_modules="sqlite3, ctypes, math, hashlib, crypt, socket, zlib, distutils.core" + check_modules="sqlite3, ctypes, math, hashlib, crypt, socket, zlib, distutils.core, ssl" AC_CACHE_CHECK([for python3 >= ]MIN_VERSION[, < ]LT_VERSION[ with modules $check_modules], [ac_cv_path_PYTHON3], [ AS_IF([test x"$ac_path_PYTHON3" != x], [dnl checking explicitly specified $with_python AC_MSG_RESULT([]) @@ -119,6 +119,17 @@ To build Sage with a different system python, use ./configure --with-python=/pat ]) AC_SUBST([PYTHON_FOR_VENV]) + AS_VAR_IF([SAGE_VENV], [auto], [SAGE_VENV=$SAGE_VENV_AUTO]) + AS_CASE([$SAGE_VENV], + [no], [SAGE_VENV='${SAGE_LOCAL}'],dnl Quoted so that it is resolved at build time by shell/Makefile + [yes], [AS_IF([test -n "$PYTHON_FOR_VENV"], [ + PYTHON_VERSION=$("$PYTHON_FOR_VENV" -c "import sysconfig; print(sysconfig.get_python_version())") + ], [ + PYTHON_VERSION=$(echo $(cat build/pkgs/python3/package-version.txt)) + ]) + SAGE_VENV='${SAGE_LOCAL}'/var/lib/sage/venv-python$PYTHON_VERSION] + ) + dnl These temporary directories are created by the check above dnl and need to be cleaned up to prevent the "rm -f conftest*" dnl (that a bunch of other checks do) from emitting warnings about diff --git a/build/pkgs/qepcad/patches/qepcad-B-env.patch b/build/pkgs/qepcad/patches/qepcad-B-env.patch deleted file mode 100644 index ce32a5e8a87..00000000000 --- a/build/pkgs/qepcad/patches/qepcad-B-env.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/source/main/BEGINQEPCAD.c.orig 2018-01-30 14:04:58.000000000 -0700 -+++ b/source/main/BEGINQEPCAD.c 2018-08-29 20:03:05.718540333 -0600 -@@ -127,7 +127,8 @@ void BEGINQEPCAD(int &argc, char**& argv - void QEPCAD_ProcessRC(int argc, char **argv) - { - char *qepath = getenv("qe"); -- if (qepath == NULL) { FAIL("QEPCAD_ProcessRC","Environment variable qe not defined!"); } -+ if (qepath == NULL) { setenv("qe", "/usr/share/qepcad", 1); qepath = getenv("qe"); } -+ if (getenv("SINGULARPATH") == NULL) { setenv("SINGULARPATH", "@LIBDIR@/Singular", 1); } - string rcFileName = qepath + string("/default.qepcadrc"); - ifstream rcin(rcFileName.c_str()); - if (!rcin) { return; } diff --git a/build/pkgs/qepcad/patches/qepcad-boolean-SINGULAR.patch b/build/pkgs/qepcad/patches/qepcad-boolean-SINGULAR.patch new file mode 100644 index 00000000000..a555ed69a8b --- /dev/null +++ b/build/pkgs/qepcad/patches/qepcad-boolean-SINGULAR.patch @@ -0,0 +1,150 @@ +From 5db4eaf19fa460bdd7bd9556631836bc6692c16c Mon Sep 17 00:00:00 2001 +From: Michael Orlitzky +Date: Wed, 18 Aug 2021 08:20:09 -0400 +Subject: [PATCH 1/1] */*: make the SINGULAR variable boolean. + +The "SINGULAR" variable (optionally defined in qepcadrc) is supposed +to tell QEPCAD where Singular lives. But, the only thing it's used for +is launching "Singular", for which it is much much simpler to just +assume that it lives in the $PATH. + +This commit changes the SINGULAR variable from a path (string) to a +boolean (yes). When its value is "yes", Singular will be assumed to +live in $PATH, and QEPCAD will try to launch it as +"Singular". Otherwise, Singular will not be used. +--- + README | 12 ++++-------- + default.qepcadrc | 2 +- + source/db/SINGULAR.c | 8 +++----- + source/db/SINGULAR.h | 2 +- + source/main/BEGINQEPCAD.c | 14 +++++++------- + source/main/qepcadcls.h | 2 +- + 6 files changed, 17 insertions(+), 23 deletions(-) + +diff --git a/README b/README +index f14c087..f2eaf3a 100644 +--- a/README ++++ b/README +@@ -27,17 +27,13 @@ Using Singular as a Computer Algebra Server + ------------------------------------------- + QEPCAD B allows you to run Singular to farm out some computations + that might not be as fast in Saclib, like multivariate polynomial +-factorization, and to provide Groebner Basis computation, which ++factorization, and to provide Groebner Basis computation, which + is not available in Saclib. When Singular is installed on your +-system, add the line ++system (and belongs to your $PATH), add the line + +- SINGULAR ++ SINGULAR yes + +-to the default.qepcadrc file. For example: +- +- SINGULAR /usr/lib/Singular/3-0-0/ix86-Linux +- +-might be right for you. ++to the default.qepcadrc file. + + Making CAD2D + ------------- +diff --git a/default.qepcadrc b/default.qepcadrc +index d307bb6..f1cc944 100644 +--- a/default.qepcadrc ++++ b/default.qepcadrc +@@ -5,4 +5,4 @@ + # so that it gets used for some computer algebra + # computations is the only feature. + ##################################################### +-# SINGULAR /usr/bin ++# SINGULAR yes +diff --git a/source/db/SINGULAR.c b/source/db/SINGULAR.c +index f94c4b1..42cab28 100644 +--- a/source/db/SINGULAR.c ++++ b/source/db/SINGULAR.c +@@ -5,10 +5,8 @@ + using namespace std; + + +-SingularServer::SingularServer(string SingularBase) ++SingularServer::SingularServer() + { +- string SingularCall = SingularBase + "/Singular"; +- + // Fork + childpid = fork(); + if (childpid == -1) { perror("Failed to fork!"); exit(1); } +@@ -29,8 +27,8 @@ SingularServer::SingularServer(string SingularBase) + // End: Just for debug!! + + +- execlp(SingularCall.c_str(), +- SingularCall.c_str(), ++ execlp("Singular", ++ "Singular", + "-q", + "--no-warn", + "--min-time=0.001", +diff --git a/source/db/SINGULAR.h b/source/db/SINGULAR.h +index d7512e2..e7111b9 100644 +--- a/source/db/SINGULAR.h ++++ b/source/db/SINGULAR.h +@@ -17,7 +17,7 @@ public: + UnnamedPipe intoSingular, outofSingular; + pid_t childpid; + +- SingularServer(string SingluarBase); // give path to Singular ++ SingularServer(); + ~SingularServer(); + void kill() { ::kill(childpid,SIGKILL); } + +diff --git a/source/main/BEGINQEPCAD.c b/source/main/BEGINQEPCAD.c +index bdfac84..9999400 100644 +--- a/source/main/BEGINQEPCAD.c ++++ b/source/main/BEGINQEPCAD.c +@@ -113,14 +113,14 @@ void BEGINQEPCAD(int &argc, char**& argv) + INITSYS(); + + /* Launch CA Servers and set up CA Policy */ +- if (GVContext->SingularPath == "") +- GVCAP = new OriginalPolicy; +- else +- { +- pair tp(string("Singular"),new SingularServer(GVContext->SingularPath)); ++ if (GVContext->Singular == "yes") { ++ pair tp(string("Singular"),new SingularServer()); + GVSB.insert(tp); + GVCAP = new SingSacPolicy; + } ++ else { ++ GVCAP = new OriginalPolicy; ++ } + + } + +@@ -138,8 +138,8 @@ void QEPCAD_ProcessRC(int argc, char **argv) + if (!(sin >> name)) { continue; } + if (name == "SINGULAR") + { +- if (!(sin >> tmp)) { cerr << "Error reading SINGULAR path in " << rcFileName << "!" << endl; } +- else { GVContext->SingularPath = tmp; } ++ if (!(sin >> tmp)) { cerr << "Error reading SINGULAR value in " << rcFileName << "!" << endl; } ++ else { GVContext->Singular = tmp; } + } + } + } +diff --git a/source/main/qepcadcls.h b/source/main/qepcadcls.h +index c014589..29f87e9 100644 +--- a/source/main/qepcadcls.h ++++ b/source/main/qepcadcls.h +@@ -8,7 +8,7 @@ + class QEPCADContext + { + public: +- string SingularPath; ++ string Singular; + }; + extern QEPCADContext* GVContext; + +-- +2.31.1 + diff --git a/build/pkgs/qepcad/patches/qepcad-sage-default.qepcadrc-location.patch b/build/pkgs/qepcad/patches/qepcad-sage-default.qepcadrc-location.patch new file mode 100644 index 00000000000..3b3d6e6a055 --- /dev/null +++ b/build/pkgs/qepcad/patches/qepcad-sage-default.qepcadrc-location.patch @@ -0,0 +1,28 @@ +From b6d02652abaf7340473ffac8941f07039ff78780 Mon Sep 17 00:00:00 2001 +From: Michael Orlitzky +Date: Wed, 18 Aug 2021 14:15:07 -0400 +Subject: [PATCH 2/2] source/main/BEGINQEPCAD.c: move default.qepcadrc to etc. + +Instead of $qe/default.qepcadrc, this file is more appropriate at +$qe/etc/default.qepcadrc, especially in SageMath where $qe is defined +to be $SAGE_LOCAL. +--- + source/main/BEGINQEPCAD.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/source/main/BEGINQEPCAD.c b/source/main/BEGINQEPCAD.c +index 9999400..7a6ecf7 100644 +--- a/source/main/BEGINQEPCAD.c ++++ b/source/main/BEGINQEPCAD.c +@@ -128,7 +128,7 @@ void QEPCAD_ProcessRC(int argc, char **argv) + { + char *qepath = getenv("qe"); + if (qepath == NULL) { FAIL("QEPCAD_ProcessRC","Environment variable qe not defined!"); } +- string rcFileName = qepath + string("/default.qepcadrc"); ++ string rcFileName = qepath + string("/etc/default.qepcadrc"); + ifstream rcin(rcFileName.c_str()); + if (!rcin) { return; } + string name, tmp; +-- +2.31.1 + diff --git a/build/pkgs/qepcad/patches/qepcad-sage-help-location.patch b/build/pkgs/qepcad/patches/qepcad-sage-help-location.patch new file mode 100644 index 00000000000..fd218ff1500 --- /dev/null +++ b/build/pkgs/qepcad/patches/qepcad-sage-help-location.patch @@ -0,0 +1,29 @@ +From a15e1e14d448af6f4790d62a50eea41a07cfa394 Mon Sep 17 00:00:00 2001 +From: Michael Orlitzky +Date: Wed, 18 Aug 2021 14:13:34 -0400 +Subject: [PATCH 1/2] source/userint/HELPFRD.c: move qepcad.help to + share/qepcad. + +Instead of $qe/bin/qepcad.help, this file is much more appropriate in +$qe/share/qepcad/share, assuming $qe is usr-ish (in SageMath, $qe is +set to $SAGE_LOCAL). +--- + source/userint/HELPFRD.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/source/userint/HELPFRD.c b/source/userint/HELPFRD.c +index c7df76d..a60cf93 100644 +--- a/source/userint/HELPFRD.c ++++ b/source/userint/HELPFRD.c +@@ -33,7 +33,7 @@ Step1: /* Open the text file containing the helps. */ + strcpy(helppath,HELPPATH); + else { + strcpy(helppath,qepath); +- strcat(helppath,"/bin/qepcad.help"); } ++ strcat(helppath,"/share/qepcad/qepcad.help"); } + if (!(fp = fopen(helppath,"r"))) { + fprintf(stderr,"Error HELPFRD: Could not open %s\n",helppath); + exit(1); } +-- +2.31.1 + diff --git a/build/pkgs/qepcad/spkg-install.in b/build/pkgs/qepcad/spkg-install.in index d3eb36586c8..11fbea86b16 100644 --- a/build/pkgs/qepcad/spkg-install.in +++ b/build/pkgs/qepcad/spkg-install.in @@ -14,7 +14,7 @@ LIBS=-lreadline if [ "$UNAME" = "Linux" ]; then LIBS="$LIBS -lrt" fi -$MAKE -j1 opt SHELL=/bin/sh FLAGSo="-O3 -g -Wl,-rpath,$SAGE_LOCAL/lib" ARFLAGS="crv" LIBS="$LIBS" +$MAKE -j1 opt SHELL=/bin/sh FLAGSo="${CXXFLAGS} -Wl,-rpath,$SAGE_LOCAL/lib" ARFLAGS="crv" LIBS="$LIBS" if [ $? -ne 0 ]; then echo >&2 "Error building qepcad." exit 1 @@ -24,11 +24,12 @@ fi # install binaries to the Sage tree find . -name *.a -exec cp {} "$SAGE_LOCAL/lib/" \; cp source/qepcad "$SAGE_LOCAL/bin/" -cp bin/qepcad.help "$SAGE_LOCAL/bin/" +mkdir -p "${SAGE_LOCAL}/share/qepcad" +cp bin/qepcad.help "$SAGE_LOCAL/share/qepcad" chmod 0644 "$SAGE_LOCAL/bin/qepcad.help" cp ../sage-qepcad "$SAGE_LOCAL/bin/" -cat > "$SAGE_LOCAL/default.qepcadrc" < "$SAGE_LOCAL/etc/default.qepcadrc" < "$SAGE_LOCAL/default.qepcadrc" < -Date: Sun, 29 Nov 2020 16:26:44 +0100 -Subject: [PATCH] setup.py: fix for MACOSX_DEPLOYMENT_TARGET=11 - ---- - Lib/distutils/spawn.py | 4 ++-- - Lib/distutils/tests/test_build_ext.py | 10 +++++++--- - Lib/test/test_posix.py | 2 +- - setup.py | 2 +- - 4 files changed, 11 insertions(+), 7 deletions(-) - -diff --git a/Lib/distutils/spawn.py b/Lib/distutils/spawn.py -index 0d1bd0391e6f1..f50edd2da9710 100644 ---- a/setuptools/_distutils/spawn.py -+++ b/setuptools/_distutils/spawn.py -@@ -54,8 +54,8 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0): - global _cfg_target, _cfg_target_split - if _cfg_target is None: - from distutils import sysconfig -- _cfg_target = sysconfig.get_config_var( -- 'MACOSX_DEPLOYMENT_TARGET') or '' -+ _cfg_target = str(sysconfig.get_config_var( -+ 'MACOSX_DEPLOYMENT_TARGET') or '') - if _cfg_target: - _cfg_target_split = [int(x) for x in _cfg_target.split('.')] - if _cfg_target: diff --git a/build/pkgs/setuptools_scm/checksums.ini b/build/pkgs/setuptools_scm/checksums.ini index e2afcaf1458..10f9425e48f 100644 --- a/build/pkgs/setuptools_scm/checksums.ini +++ b/build/pkgs/setuptools_scm/checksums.ini @@ -1,5 +1,5 @@ tarball=setuptools_scm-VERSION.tar.gz -sha1=183e0947ee14f8107a3ad6a7f635f04f54a30011 -md5=aa7f0efbbf46c5576db5994dd1ce3f8d -cksum=4017375148 +sha1=6d793de55ec500f7516802830f903cbc460a7999 +md5=7e17d25fd5bc5b128cfe2964a2e4cd5b +cksum=1288889703 upstream_url=https://pypi.io/packages/source/s/setuptools_scm/setuptools_scm-VERSION.tar.gz diff --git a/build/pkgs/setuptools_scm/dependencies b/build/pkgs/setuptools_scm/dependencies index 2573414ce8a..22810d06619 100644 --- a/build/pkgs/setuptools_scm/dependencies +++ b/build/pkgs/setuptools_scm/dependencies @@ -1,4 +1,4 @@ -$(PYTHON) | setuptools pip +$(PYTHON) | setuptools pip wheel tomli packaging ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/setuptools_scm/package-version.txt b/build/pkgs/setuptools_scm/package-version.txt index 5fe60723048..dc0208aba8e 100644 --- a/build/pkgs/setuptools_scm/package-version.txt +++ b/build/pkgs/setuptools_scm/package-version.txt @@ -1 +1 @@ -6.0.1 +6.3.1 diff --git a/build/pkgs/six/checksums.ini b/build/pkgs/six/checksums.ini index aeb1c840003..b7226d114b5 100644 --- a/build/pkgs/six/checksums.ini +++ b/build/pkgs/six/checksums.ini @@ -1,5 +1,5 @@ tarball=six-VERSION.tar.gz -sha1=a785c20658b3676333c749436f088394c12b0c26 -md5=9f90a0eaa0ea7747fda01ca79d21ebcb -cksum=961210934 +sha1=06fa0bb50f2a4e2917fd14c21e9d2d5508ce0163 +md5=a7c927740e4964dd29b72cebfc1429bb +cksum=1693137720 upstream_url=https://pypi.io/packages/source/s/six/six-VERSION.tar.gz diff --git a/build/pkgs/six/package-version.txt b/build/pkgs/six/package-version.txt index 141f2e805be..15b989e398f 100644 --- a/build/pkgs/six/package-version.txt +++ b/build/pkgs/six/package-version.txt @@ -1 +1 @@ -1.15.0 +1.16.0 diff --git a/build/pkgs/sphinx/checksums.ini b/build/pkgs/sphinx/checksums.ini index b42e84540d3..f7ba55273cb 100644 --- a/build/pkgs/sphinx/checksums.ini +++ b/build/pkgs/sphinx/checksums.ini @@ -1,5 +1,5 @@ tarball=Sphinx-VERSION.tar.gz -sha1=ac493c525509f639a4eeb784a85648b3066f1f40 -md5=4714d870be4e599280e2c06561b44430 -cksum=2654318749 +sha1=b7d3ad1e91059d62044a3296112fa6662a38f089 +md5=6af34550e36dd6d58a496e47ec67280f +cksum=1867791932 upstream_url=https://pypi.io/packages/source/s/sphinx/Sphinx-VERSION.tar.gz diff --git a/build/pkgs/sphinx/package-version.txt b/build/pkgs/sphinx/package-version.txt index f727dc16efb..6aba2b245a8 100644 --- a/build/pkgs/sphinx/package-version.txt +++ b/build/pkgs/sphinx/package-version.txt @@ -1 +1 @@ -4.0.1.p0 +4.2.0 diff --git a/build/pkgs/sphinxcontrib_htmlhelp/checksums.ini b/build/pkgs/sphinxcontrib_htmlhelp/checksums.ini index 818e991207c..1a1402088aa 100644 --- a/build/pkgs/sphinxcontrib_htmlhelp/checksums.ini +++ b/build/pkgs/sphinxcontrib_htmlhelp/checksums.ini @@ -1,5 +1,5 @@ tarball=sphinxcontrib-htmlhelp-VERSION.tar.gz -sha1=fc695250bc781777203b3a97a7aa7b0eab8a2c51 -md5=f1db7db2a467f08f6292ab0d76e38584 -cksum=1195324208 +sha1=fcd0a815cd0e7941669aff2d652679f72caadb1b +md5=70765b55395a3c20233631802902c840 +cksum=3402949758 upstream_url=https://pypi.io/packages/source/s/sphinxcontrib-htmlhelp/sphinxcontrib-htmlhelp-VERSION.tar.gz diff --git a/build/pkgs/sphinxcontrib_htmlhelp/package-version.txt b/build/pkgs/sphinxcontrib_htmlhelp/package-version.txt index 21e8796a09d..227cea21564 100644 --- a/build/pkgs/sphinxcontrib_htmlhelp/package-version.txt +++ b/build/pkgs/sphinxcontrib_htmlhelp/package-version.txt @@ -1 +1 @@ -1.0.3 +2.0.0 diff --git a/build/pkgs/sphinxcontrib_serializinghtml/checksums.ini b/build/pkgs/sphinxcontrib_serializinghtml/checksums.ini index ea8ac106822..64c3b69e74d 100644 --- a/build/pkgs/sphinxcontrib_serializinghtml/checksums.ini +++ b/build/pkgs/sphinxcontrib_serializinghtml/checksums.ini @@ -1,5 +1,5 @@ tarball=sphinxcontrib-serializinghtml-VERSION.tar.gz -sha1=7d782d9f8fef0a5663fc7732d72847e711f0f18b -md5=518ff437dcb05a74ed32ba19c892ce05 -cksum=3002072803 +sha1=e299c07d7a22514053cb709105d094ff70b2e926 +md5=d99d2edc7b26988dc5fa92163857bfbf +cksum=2518239143 upstream_url=https://pypi.io/packages/source/s/sphinxcontrib-serializinghtml/sphinxcontrib-serializinghtml-VERSION.tar.gz diff --git a/build/pkgs/sphinxcontrib_serializinghtml/package-version.txt b/build/pkgs/sphinxcontrib_serializinghtml/package-version.txt index 65087b4f5ec..e25d8d9f357 100644 --- a/build/pkgs/sphinxcontrib_serializinghtml/package-version.txt +++ b/build/pkgs/sphinxcontrib_serializinghtml/package-version.txt @@ -1 +1 @@ -1.1.4 +1.1.5 diff --git a/build/pkgs/tomli/SPKG.rst b/build/pkgs/tomli/SPKG.rst new file mode 100644 index 00000000000..16bcc21ec1d --- /dev/null +++ b/build/pkgs/tomli/SPKG.rst @@ -0,0 +1,16 @@ +tomli: A lil' TOML parser +========================= + +Description +----------- + +A lil' TOML parser + +License +------- + +Upstream Contact +---------------- + +https://pypi.org/project/tomli/ + diff --git a/build/pkgs/tomli/checksums.ini b/build/pkgs/tomli/checksums.ini new file mode 100644 index 00000000000..05ce662b256 --- /dev/null +++ b/build/pkgs/tomli/checksums.ini @@ -0,0 +1,5 @@ +tarball=tomli-VERSION.tar.gz +sha1=a5926b4a093154139bc21d182a451a386a3e46db +md5=507a0bd532e99439c9dfb7f67a4217b6 +cksum=942629044 +upstream_url=https://pypi.io/packages/source/t/tomli/tomli-VERSION.tar.gz diff --git a/build/pkgs/tomli/dependencies b/build/pkgs/tomli/dependencies new file mode 100644 index 00000000000..31b6d3bd71c --- /dev/null +++ b/build/pkgs/tomli/dependencies @@ -0,0 +1,4 @@ +$(PYTHON) | pip flit_core toml + +---------- +All lines of this file are ignored except the first. diff --git a/build/pkgs/tomli/install-requires.txt b/build/pkgs/tomli/install-requires.txt new file mode 100644 index 00000000000..aab392a3ac2 --- /dev/null +++ b/build/pkgs/tomli/install-requires.txt @@ -0,0 +1 @@ +tomli diff --git a/build/pkgs/tomli/package-version.txt b/build/pkgs/tomli/package-version.txt new file mode 100644 index 00000000000..6085e946503 --- /dev/null +++ b/build/pkgs/tomli/package-version.txt @@ -0,0 +1 @@ +1.2.1 diff --git a/build/pkgs/tomli/spkg-install.in b/build/pkgs/tomli/spkg-install.in new file mode 100644 index 00000000000..37ac1a53437 --- /dev/null +++ b/build/pkgs/tomli/spkg-install.in @@ -0,0 +1,2 @@ +cd src +sdh_pip_install . diff --git a/build/pkgs/pynac/type b/build/pkgs/tomli/type similarity index 100% rename from build/pkgs/pynac/type rename to build/pkgs/tomli/type diff --git a/build/pkgs/tox/checksums.ini b/build/pkgs/tox/checksums.ini index c202fbcb281..f64c6e12b24 100644 --- a/build/pkgs/tox/checksums.ini +++ b/build/pkgs/tox/checksums.ini @@ -1,5 +1,5 @@ tarball=tox-VERSION.tar.gz -sha1=e98277cf47d1e4ca9dbaeeaf7e0e301700c9694b -md5=9fe85f2cab666ad764f5a076c4544956 -cksum=2996434561 +sha1=b755ebd6a4fe57bb64bd9cc460761ac38d2c1bfd +md5=b270c0b956305570fb9a638ab72fecec +cksum=3980705014 upstream_url=https://pypi.io/packages/source/t/tox/tox-VERSION.tar.gz diff --git a/build/pkgs/tox/package-version.txt b/build/pkgs/tox/package-version.txt index 9b2f2a16885..693bd59e3e6 100644 --- a/build/pkgs/tox/package-version.txt +++ b/build/pkgs/tox/package-version.txt @@ -1 +1 @@ -3.23.1 +3.24.3 diff --git a/build/pkgs/virtualenv/checksums.ini b/build/pkgs/virtualenv/checksums.ini index 177479bc005..bc8df2a4f32 100644 --- a/build/pkgs/virtualenv/checksums.ini +++ b/build/pkgs/virtualenv/checksums.ini @@ -1,5 +1,5 @@ tarball=virtualenv-VERSION.tar.gz -sha1=42c609ae86f5b6b3d491e4a865235e71ed35bfd3 -md5=6693920d5de24bd3e6ec8a6749c22b0d -cksum=2813528266 +sha1=b5e76bd08c1bebac54de72c7209d85fab8db9e08 +md5=0695fb2609140cedd0e7388ad8664296 +cksum=2836864806 upstream_url=https://pypi.io/packages/source/v/virtualenv/virtualenv-VERSION.tar.gz diff --git a/build/pkgs/virtualenv/package-version.txt b/build/pkgs/virtualenv/package-version.txt index f065d76cc07..936280a3a7c 100644 --- a/build/pkgs/virtualenv/package-version.txt +++ b/build/pkgs/virtualenv/package-version.txt @@ -1 +1 @@ -20.4.7 +20.7.2 diff --git a/build/pkgs/wheel/checksums.ini b/build/pkgs/wheel/checksums.ini index ee2c6f5ac0d..6efe682cd2e 100644 --- a/build/pkgs/wheel/checksums.ini +++ b/build/pkgs/wheel/checksums.ini @@ -1,5 +1,5 @@ tarball=wheel-VERSION.tar.gz -sha1=be566aa87fa26a25f29c53f8a1bfe1f722534457 -md5=800401c0549ea01449dc47305858c833 -cksum=239330208 +sha1=d25b95c1e0048051e5a94d7e9f415d253195eb0b +md5=79f55b898e6f274f5586bbde39f6fe8e +cksum=1919232158 upstream_url=https://pypi.io/packages/source/w/wheel/wheel-VERSION.tar.gz diff --git a/build/pkgs/wheel/package-version.txt b/build/pkgs/wheel/package-version.txt index d647c8a4416..0f1a7dfc7c4 100644 --- a/build/pkgs/wheel/package-version.txt +++ b/build/pkgs/wheel/package-version.txt @@ -1 +1 @@ -0.36.2 +0.37.0 diff --git a/build/pkgs/zipp/checksums.ini b/build/pkgs/zipp/checksums.ini index b2e894bf906..6af68aa3d57 100644 --- a/build/pkgs/zipp/checksums.ini +++ b/build/pkgs/zipp/checksums.ini @@ -1,5 +1,5 @@ tarball=zipp-VERSION.tar.gz -sha1=b228cce701321b2680906567b9359d72a6c38532 -md5=a0fd3753611113293992665059c69730 -cksum=3930145842 +sha1=53234d6dbfc809d03f2b85db6dbb4e559ef200a1 +md5=617efbf3edb707c57008ec00f408972f +cksum=2911023413 upstream_url=https://pypi.io/packages/source/z/zipp/zipp-VERSION.tar.gz diff --git a/build/pkgs/zipp/package-version.txt b/build/pkgs/zipp/package-version.txt index cb0c939a936..1545d966571 100644 --- a/build/pkgs/zipp/package-version.txt +++ b/build/pkgs/zipp/package-version.txt @@ -1 +1 @@ -0.5.2 +3.5.0 diff --git a/configure.ac b/configure.ac index 12bed296d10..a4093a2d4ee 100644 --- a/configure.ac +++ b/configure.ac @@ -70,15 +70,24 @@ SAGE_LOCAL="$prefix" # This is nonstandard. if test "$SAGE_LOCAL" = NONE; then SAGE_LOCAL=local + if test -x "$SAGE_LOCAL"/bin/python3; then + # Incremental build with an existing installation of python3 spkg + # in SAGE_LOCAL or venv in SAGE_LOCAL. Keep old behavior. + SAGE_VENV_AUTO=no + else + SAGE_VENV_AUTO=yes + fi +else + SAGE_VENV_AUTO=no fi SAGE_SRC="$SAGE_ROOT/src" SAGE_SPKG_INST="$SAGE_LOCAL/var/lib/sage/installed" AC_ARG_WITH([sage-venv], - [AS_HELP_STRING([--with-sage-venv=SAGE_VENV], + [AS_HELP_STRING([--with-sage-venv={auto,yes,no,SAGE_VENV}], [put Python packages into an installation hierarchy separate from prefix])], [SAGE_VENV="$withval"], - [SAGE_VENV='${SAGE_LOCAL}'])dnl Quoted so that it is resolved at build time by shell/Makefile + [SAGE_VENV="auto"]) AC_SUBST([SAGE_VENV]) #--------------------------------------------------------- @@ -460,6 +469,10 @@ AC_ARG_ENABLE([sagelib], done ]) +dnl Packages that require a special override to use the SPKG +dnl when the system package is not usable. +AS_VAR_SET([sage_use_system_gcc], [force]) + SAGE_SPKG_COLLECT() dnl AC_CONFIG_HEADERS([config.h]) @@ -497,6 +510,27 @@ AC_CONFIG_COMMANDS(mkdirs, SAGE_INST="$SAGE_SPKG_INST" ]) +AC_CONFIG_COMMANDS(links, [ + dnl Create links for the convenience of users + SYMLINK="${ac_top_build_prefix}prefix" + AS_IF([test -L "$SYMLINK" -o ! -e "$SYMLINK"], [ + AC_MSG_NOTICE([creating convenience symlink $SYMLINK -> $SAGE_LOCAL]) + ln -sf "$SAGE_LOCAL" "$SYMLINK" + ], [ + AC_MSG_NOTICE([cannot create convenience symlink $SYMLINK -> $SAGE_LOCAL because the file exists and is not a symlink; this is harmless]) + ]) + SYMLINK="${ac_top_build_prefix}venv" + AS_IF([test -L "$SYMLINK" -o ! -e "$SYMLINK"], [ + AC_MSG_NOTICE([creating convenience symlink $SYMLINK -> $SAGE_VENV]) + ln -sf "$SAGE_VENV" "$SYMLINK" + ], [ + AC_MSG_NOTICE([cannot create convenience symlink $SYMLINK -> $SAGE_VENV because the file exists and is not a symlink; this is harmless]) + ]) +], [ + SAGE_LOCAL="$SAGE_LOCAL" + eval SAGE_VENV="$SAGE_VENV"dnl eval so as to evaluate the embedded ${SAGE_LOCAL} +]) + AC_OUTPUT() SAGE_SYSTEM_PACKAGE_NOTICE() diff --git a/m4/sage_spkg_collect.m4 b/m4/sage_spkg_collect.m4 index 1ab62d6fa47..1e1cd57f45b 100644 --- a/m4/sage_spkg_collect.m4 +++ b/m4/sage_spkg_collect.m4 @@ -153,8 +153,8 @@ for DIR in $SAGE_ROOT/build/pkgs/*; do dnl Jupyter notebook, then packages such as jupyter_core would have to be installed into dnl two trees. SPKG_TREE_VAR=SAGE_LOCAL - if test -f "$DIR/requirements.txt" -o -f "$DIR/install-requires.txt"; then - dnl A Python package + if test -f "$DIR/requirements.txt" -o -f "$DIR/install-requires.txt" -o "$SPKG_NAME" = python3; then + dnl A Python package or spkg installation of python3 itself SPKG_TREE_VAR=SAGE_VENV fi SAGE_PACKAGE_TREES="${SAGE_PACKAGE_TREES}$(printf '\ntrees_')${SPKG_NAME} = ${SPKG_TREE_VAR}" @@ -240,6 +240,9 @@ for DIR in $SAGE_ROOT/build/pkgs/*; do [yes], [ message="no suitable system package; $message" AS_VAR_APPEND([$SAGE_NEED_SYSTEM_PACKAGES_VAR], [" $SPKG_NAME"]) ], + [force], [ message="no suitable system package; this is an error" + AS_VAR_APPEND([$SAGE_NEED_SYSTEM_PACKAGES_VAR], [" $SPKG_NAME"]) + ], [installed], [ message="already installed as an SPKG$uninstall_message" ], [ message="$reason; $message" ]) ]) @@ -397,7 +400,9 @@ $COMMAND $COMMAND ]) + AS_VAR_SET([need_reconfig_msg], [yes]) ]) + dnl Reconfigure message AS_VAR_IF([need_reconfig_msg], [yes], [ AC_MSG_NOTICE([ @@ -410,4 +415,8 @@ $COMMAND ]) ]) ]) + dnl Deferred errors from --with-system-SPKG=force + AS_VAR_SET_IF([SAGE_SPKG_ERRORS], [AC_MSG_ERROR([ +$SAGE_SPKG_ERRORS + ])]) ]) diff --git a/m4/sage_spkg_configure.m4 b/m4/sage_spkg_configure.m4 index d8b64f831fb..968e6077134 100644 --- a/m4/sage_spkg_configure.m4 +++ b/m4/sage_spkg_configure.m4 @@ -65,12 +65,14 @@ AS_BOX([Checking whether SageMath should install SPKG $1...]) >& AS_MESSAGE_LOG_ AC_ARG_WITH([system-]SPKG_NAME, AS_HELP_STRING(--with-system-SPKG_NAME={no|yes (default)|force (exit with an error if no usable version is found)}, [detect and use an existing system SPKG_NAME]), - [AS_VAR_SET(SPKG_USE_SYSTEM, [$withval])], - [AS_VAR_SET(SPKG_USE_SYSTEM, [yes])] + [AS_VAR_SET(SPKG_USE_SYSTEM, [$withval])] ) AS_VAR_SET([sage_spkg_name], SPKG_NAME) +dnl Default value for most packages +AS_VAR_SET_IF([SPKG_USE_SYSTEM], [], [AS_VAR_SET([SPKG_USE_SYSTEM], [yes])]) + dnl The default is not to install a package, unless a check below finds that we should. AS_VAR_SET(SPKG_INSTALL, [no]) @@ -113,7 +115,10 @@ AS_VAR_IF(SPKG_INSTALL, [no], [ AC_MSG_NOTICE(m4_normalize([will use system package and not install SPKG ]SPKG_NAME)) ], [ AS_VAR_IF(SPKG_USE_SYSTEM, [force], [ - AC_MSG_ERROR(m4_normalize([given --with-system-]SPKG_NAME[=force but no system package could be used])) + AS_VAR_APPEND([SAGE_SPKG_ERRORS], [" + Given --with-system-]SPKG_NAME[=force, but no system package could be used. + That's an error. Please install the indicated package to continue. + (To override this error, use ./configure --without-system-]SPKG_NAME[)"]) ], [ AC_MSG_NOTICE(m4_normalize([no suitable system package found for SPKG ]SPKG_NAME)) ]) diff --git a/pkgs/sage-conf/README.rst b/pkgs/sage-conf/README.rst index 7b28f9f0de6..0e881fb9dc5 100644 --- a/pkgs/sage-conf/README.rst +++ b/pkgs/sage-conf/README.rst @@ -23,7 +23,10 @@ sage_conf sdist on PyPI This implementation of the ``sage_conf`` distribution package comes from https://trac.sagemath.org/ticket/29039, which adds the directory -``src/pkgs/sage_conf-pypi/``. +``pkgs/sage-conf_pypi/``. + +To install, use ``pip install -v sage_conf``. Using ``-v`` ensures that diagnostic +messages are displayed. On installation (or building a wheel), it invokes ``sage_bootstrap`` to establish a build tree (``SAGE_ROOT``) and installation tree (``SAGE_LOCAL``) for @@ -46,7 +49,7 @@ Prebuilt binary wheels of the ``sage_conf`` distribution package are available at https://github.com/sagemath/sage-wheels/releases/ This implementation of ``sage_conf`` comes from https://trac.sagemath.org/ticket/31396, -which adds the directory ``src/pkgs/sage_conf-relocatable/``. +which adds the directory ``pkgs/sage-conf_relocatable/``. On building a wheel, it invokes ``sage_bootstrap`` to establish a build and installation tree (``SAGE_ROOT``, ``SAGE_LOCAL``) in a @@ -74,9 +77,8 @@ sage_conf in the SageMath distribution The original version of the distribution package ``sage_conf`` is used internally in the SageMath distribution. It is provided in the directory -``build/pkgs/sage_conf/src``. This version of the package is generated -by the Sage distribution's ``configure`` -script. +``pkgs/sage-conf/``. This version of the package is generated +by the Sage distribution's ``configure`` script. sage_conf in downstream distributions @@ -98,4 +100,4 @@ Upstream Contact https://www.sagemath.org This package is included in the source code of the Sage distribution, -in ``pkgs/sage-conf``. +in ``pkgs/sage-conf*``. diff --git a/pkgs/sage-conf_pypi/MANIFEST.in b/pkgs/sage-conf_pypi/MANIFEST.in index 744d661c092..121c9edde97 100644 --- a/pkgs/sage-conf_pypi/MANIFEST.in +++ b/pkgs/sage-conf_pypi/MANIFEST.in @@ -1,3 +1,4 @@ +prune .tox include VERSION.txt graft bin graft sage_root @@ -15,4 +16,5 @@ global-exclude .tox global-exclude *~* global-exclude *.bak global-exclude __pycache__ -global-exclude *.pyc +global-exclude *.py[co] +global-exclude *.so diff --git a/pkgs/sage-conf_pypi/setup.py b/pkgs/sage-conf_pypi/setup.py index 4a22b39b694..8091754c4ff 100644 --- a/pkgs/sage-conf_pypi/setup.py +++ b/pkgs/sage-conf_pypi/setup.py @@ -2,6 +2,7 @@ import sys import shutil import sysconfig +import platform from setuptools import setup from distutils.command.build_scripts import build_scripts as distutils_build_scripts @@ -19,18 +20,13 @@ def run(self): sage_version = f.read().strip() # For convenience, set up the homebrew env automatically. This is a no-op if homebrew is not present. SETENV = '(. ./.homebrew-build-env 2> /dev/null || :)' - # Until pynac is repackaged as a pip-installable package (#30534), SAGE_LOCAL still has to be specific to - # the Python version. Note that as of pynac-0.7.26.sage-2020-04-03, on Cygwin, pynac is linked through - # to libpython; whereas on all other platforms, it is not linked through, so we only key it to the SOABI. - soabi = sysconfig.get_config_var('SOABI') - if sys.platform == 'cygwin': - libdir_tag = sysconfig.get_config_var('LIBDIR').replace(' ', '-').replace('\\', '-').replace('/', '-') - ldversion = sysconfig.get_config_var('LDVERSION') - python_tag = f'{libdir_tag}-{ldversion}' - else: - python_tag = soabi + # After #30534, SAGE_LOCAL no longer contains any Python. So we key the SAGE_ROOT only to Sage version + # and architecture. + system = platform.system() + machine = platform.machine() + arch_tag = f'{system}-{machine}' # TODO: These two should be user-configurable with options passed to "setup.py install" - SAGE_ROOT = os.path.join(DOT_SAGE, f'sage-{sage_version}-{python_tag}') + SAGE_ROOT = os.path.join(DOT_SAGE, f'sage-{sage_version}-{arch_tag}') SAGE_LOCAL = os.path.join(SAGE_ROOT, 'local') if os.path.exists(os.path.join(SAGE_ROOT, 'config.status')): print(f'Reusing SAGE_ROOT={SAGE_ROOT}') @@ -41,15 +37,20 @@ def run(self): shutil.copytree('sage_root', SAGE_ROOT) # will fail if already exists except Exception: raise DistutilsSetupError(f"the directory SAGE_ROOT={SAGE_ROOT} already exists but it is not configured. Please remove it and try again.") - cmd = f"cd {SAGE_ROOT} && {SETENV} && ./configure --prefix={SAGE_LOCAL} --with-python={sys.executable} --enable-build-as-root --enable-download-from-upstream-url --with-system-python3=force --disable-notebook --disable-sagelib" + cmd = f"cd {SAGE_ROOT} && {SETENV} && ./configure --prefix={SAGE_LOCAL} --with-python={sys.executable} --enable-build-as-root --enable-download-from-upstream-url --with-system-python3=force --with-sage-venv --disable-notebook --disable-sagelib" print(f"Running {cmd}") + sys.stdout.flush() if os.system(cmd) != 0: + print(f"configure failed; this may be caused by missing build prerequisites.") + sys.stdout.flush() + PREREQ_SPKG = "_prereq bzip2 xz libffi" # includes python3 SPKG_DEPCHECK packages + os.system(f'cd {SAGE_ROOT} && export SYSTEM=$(build/bin/sage-guess-package-system 2>/dev/null) && export PACKAGES="$(build/bin/sage-get-system-packages $SYSTEM {PREREQ_SPKG})" && [ -n "$PACKAGES" ] && echo "You can install the required build prerequisites using the following shell command" && echo "" && build/bin/sage-print-system-package-command $SYSTEM --verbose --sudo install $PACKAGES && echo ""') raise DistutilsSetupError("configure failed") # Here we run "make build" -- which builds everything except for sagelib because we # used configure --disable-sagelib # Alternative: # "make build-local" only builds the non-Python packages of the Sage distribution. - # It still makes an (empty) venv in SAGE_LOCAL, which is unused by default; + # It still makes an (empty) venv in SAGE_VENV, which is unused by default; # but then a user could use "make build-venv" to build compatible wheels for all Python packages. # TODO: A target to only build wheels of tricky packages # (that use native libraries shared with other packages). diff --git a/src/.relint.yml b/src/.relint.yml index e174f30d6dc..cb1a1e5eac2 100644 --- a/src/.relint.yml +++ b/src/.relint.yml @@ -7,9 +7,8 @@ hint: | # ifilter, imap, izip # __metaclass__ Hint: # update raise statements # except Exception, var - Hint: # cmp # sagenb - Hint: # next # six is no longer allowed - pattern: '(import.*ifilter|import.*imap|import.*izip|^\s*raise\s*[A-Za-z]*Error\s*,|[\s,\(]cmp\s*=|[^_a-z]cmp\(|\.next\(\)|__metaclass__|except\s*[A-Za-z]\s*,|sagenb|import six|from six import)' + Hint: # sagenb # six is no longer allowed + pattern: '(import.*[, ]ifilter|import.*[, ]imap|import.*[, ]izip|^\s*raise\s*[A-Za-z]*Error\s*,|__metaclass__|except\s*[A-Za-z]\s*,|sagenb|import six|from six import)' filePattern: .*[.](py|pyx|rst) - name: 'foreign_latex: foreign commands in LaTeX' diff --git a/src/VERSION.txt b/src/VERSION.txt index 41370016bdc..bc12a7eeb60 100644 --- a/src/VERSION.txt +++ b/src/VERSION.txt @@ -1 +1 @@ -9.5.beta1 +9.5.beta2 diff --git a/src/bin/sage-notebook b/src/bin/sage-notebook index 6d009bf81cc..ff7525c275c 100755 --- a/src/bin/sage-notebook +++ b/src/bin/sage-notebook @@ -13,13 +13,10 @@ logger = logging.getLogger() from sage.misc.banner import banner -class NotebookJupyter(object): +_system_jupyter_url = "https://doc.sagemath.org/html/en/installation/launching.html#setting-up-sagemath-as-a-jupyter-kernel-in-an-existing-jupyter-notebook-or-jupyterlab-installation" + - PREREQUISITE_ERROR = textwrap.dedent(""" - The Jupyter notebook requires ssl, even if you do not use - https. Install the openssl development packages in your system and - then rebuild Python (sage -f python3). - """) +class NotebookJupyter(object): def print_banner(self): banner() @@ -31,11 +28,18 @@ class NotebookJupyter(object): def __init__(self, argv): self.print_banner() - from sage.repl.ipython_kernel.install import have_prerequisites - if not have_prerequisites(): - print(self.PREREQUISITE_ERROR) + try: + from notebook.notebookapp import main + except ImportError: + import traceback + traceback.print_exc() + print("The Jupyter notebook is not installed (at least not in this Sage installation).") + print("You can install it by running") + print(" sage -i notebook") + print("Alternatively, you can follow the instructions at") + print(" " + _system_jupyter_url) + print("to use Sage with an existing Jupyter notebook installation.") raise SystemExit(1) - from notebook.notebookapp import main main(argv) @@ -52,12 +56,17 @@ class NotebookJupyterlab(object): try: from jupyterlab.labapp import main except ImportError: + import traceback + traceback.print_exc() print("Jupyterlab is not installed (at least not in this Sage installation).") print("You can install it by running") print(" sage -i jupyterlab_widgets") print("which includes support for interacts and the ability to download and") print("install other Jupyterlab extensions. For a minimal installation, run") print(" sage -i jupyterlab") + print("Alternatively, you can follow the instructions at") + print(" " + _system_jupyter_url) + print("to use Sage with an existing Jupyterlab installation.") raise SystemExit(1) self.print_banner() main(argv) diff --git a/src/bin/sage-version.sh b/src/bin/sage-version.sh index d0290f3d77c..46acf9862a7 100644 --- a/src/bin/sage-version.sh +++ b/src/bin/sage-version.sh @@ -1,5 +1,5 @@ # Sage version information for shell scripts # This file is auto-generated by the sage-update-version script, do not edit! -SAGE_VERSION='9.5.beta1' -SAGE_RELEASE_DATE='2021-09-13' -SAGE_VERSION_BANNER='SageMath version 9.5.beta1, Release Date: 2021-09-13' +SAGE_VERSION='9.5.beta2' +SAGE_RELEASE_DATE='2021-09-26' +SAGE_VERSION_BANNER='SageMath version 9.5.beta2, Release Date: 2021-09-26' diff --git a/src/doc/en/developer/packaging.rst b/src/doc/en/developer/packaging.rst index b26c5da1d25..498825377c5 100644 --- a/src/doc/en/developer/packaging.rst +++ b/src/doc/en/developer/packaging.rst @@ -602,47 +602,49 @@ version, then the lower bound should be adjusted. .. _section-spkg-SPKG-txt: -The SPKG.rst or SPKG.txt File ------------------------------ +The SPKG.rst File +----------------- -The ``SPKG.txt`` file should follow this pattern: +The ``SPKG.rst`` file should follow this pattern: .. CODE-BLOCK:: text - = PACKAGE_NAME = + PACKAGE_NAME: One line description - == Description == + Description + ----------- What does the package do? - == License == + License + ------- What is the license? If non-standard, is it GPLv3+ compatible? - == Upstream Contact == + Upstream Contact + ---------------- - Provide information for upstream contact. + Provide information for upstream contact. Usually just an URL. - == Dependencies == + Dependencies + ------------ - Put a bulleted list of dependencies here: + Only put special dependencies here that are not captured by the + ``dependencies`` file. Otherwise omit this section. - * python - * readline + Special Update/Build Instructions + --------------------------------- - == Special Update/Build Instructions == + If the tarball was modified by hand and not via an ``spkg-src`` + script, describe what was changed. Otherwise omit this section. - If the tarball was modified by hand and not via a spkg-src - script, describe what was changed. +with ``PACKAGE_NAME`` replaced by the SPKG name (= the directory name in +``build/pkgs``). -with ``PACKAGE_NAME`` replaced by the package name. Legacy -``SPKG.txt`` files have an additional changelog section, but this +Legacy ``SPKG.txt`` files have an additional changelog section, but this information is now kept in the git repository. -It is now also possible to use an ``SPKG.rst`` file instead, with the same -sections. - .. _section-dependencies: Package dependencies @@ -1019,9 +1021,10 @@ For Python packages available from PyPI, you can use:: This automatically downloads the most recent version from PyPI and also obtains most of the necessary information by querying PyPI. -The ``dependencies`` file may need editing, and also you may want to set -lower and upper bounds for acceptable package versions in the file -``install-requires.txt``. +The ``dependencies`` file may need editing (watch out for warnings regarding +``--no-deps`` that Sage issues during installation of the package!). +Also you may want to set lower and upper bounds for acceptable package versions +in the file ``install-requires.txt``. To create a pip package rather than a normal package, you can use:: diff --git a/src/doc/en/reference/arithmetic_curves/index.rst b/src/doc/en/reference/arithmetic_curves/index.rst index b6469625dd3..1e6682247bd 100644 --- a/src/doc/en/reference/arithmetic_curves/index.rst +++ b/src/doc/en/reference/arithmetic_curves/index.rst @@ -17,6 +17,7 @@ Maps between them .. toctree:: :maxdepth: 2 + sage/schemes/elliptic_curves/hom sage/schemes/elliptic_curves/weierstrass_morphism sage/schemes/elliptic_curves/ell_curve_isogeny sage/schemes/elliptic_curves/isogeny_small_degree diff --git a/src/doc/en/reference/index.rst b/src/doc/en/reference/index.rst index eb11d0fe393..27ad9acc226 100644 --- a/src/doc/en/reference/index.rst +++ b/src/doc/en/reference/index.rst @@ -121,6 +121,7 @@ Number Theory * :doc:`General Hecke Algebras and Hecke Modules ` * :doc:`Modular Symbols ` * :doc:`Modular Forms ` +* :doc:`Quasimodular Forms ` * :doc:`Modular Forms for Hecke Triangle Groups ` * :doc:`Modular Abelian Varieties ` * :doc:`Miscellaneous Modular-Form-Related Modules ` @@ -168,4 +169,3 @@ Indices and Tables * :ref:`genindex` * :ref:`modindex` * :ref:`search` - diff --git a/src/doc/en/reference/quasimodfrm/conf.py b/src/doc/en/reference/quasimodfrm/conf.py new file mode 120000 index 00000000000..2bdf7e68470 --- /dev/null +++ b/src/doc/en/reference/quasimodfrm/conf.py @@ -0,0 +1 @@ +../conf_sub.py \ No newline at end of file diff --git a/src/doc/en/reference/quasimodfrm/index.rst b/src/doc/en/reference/quasimodfrm/index.rst new file mode 100644 index 00000000000..4fb81ca671d --- /dev/null +++ b/src/doc/en/reference/quasimodfrm/index.rst @@ -0,0 +1,13 @@ +Quasimodular Forms +================== + +Module List +----------- + +.. toctree:: + :maxdepth: 2 + + sage/modular/quasimodform/ring + sage/modular/quasimodform/element + +.. include:: ../footer.txt diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index 3643fe08de6..8ff9195aed1 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -607,8 +607,13 @@ REFERENCES: (2006) 306--317. .. [BDP2013] Thomas Brüstle, Grégoire Dupont, Matthieu Pérotin - *On Maximal Green Sequences* - :arxiv:`1205.2050` + *On Maximal Green Sequences* + :arxiv:`1205.2050` + +.. [BDPR2011] Marcus Bishop, J. Matthew Douglass, Götz Pfeiffer, Gerhard Röhrle, + *Computations for Coxeter arrangements and Solomon's descent algebra: + Groups of rank three and four*; Journal of symbolic computation, + volume 50, 03-2013, pp. 139-158. .. [BDMW2010] \K. A. Browning, J. F. Dillon, M. T. McQuistan, and A. J. Wolfe, *An APN permutation in dimension six*; in Finite Fields: Theory @@ -5901,6 +5906,10 @@ REFERENCES: **Z** +.. [Zag2008] \D. Zagier, *Elliptic Modular Forms and Their Applications*, + In: Ranestad K. (eds) The 1-2-3 of Modular Forms. Universitext. + Springer, Berlin, Heidelberg. (2008) :doi:`10.1007/978-3-540-74119-0_1` + .. [ZBLRYV2015] \W. Zhang, Z. Bao, D. Lin, V. Rijmen, B. Yang, and I. Verbauwhede, *RECTANGLE: A bit-slice lightweight block cipher suitable for multiple platforms*; in @@ -5911,6 +5920,11 @@ REFERENCES: constrained optimization. ACM Transactions on Mathematical Software, Vol 23, Num. 4, pp.550--560, 1997. +.. [ZC2005] Afra Zomorodian and Gunnar Carlsson + "Computing Persistent Homology", + Discrete and Computational Geometry (2005) + :doi:`10.1007/s00454-004-1146-y` + .. [ZDYBXJZ2019] \W. Zhang, T. Ding, B. Yang, Z. Bao, Z. Xiang, F. Ji, X. Zhao. *KNOT: Algorithm Specifications and Supporting Document* https://csrc.nist.gov/CSRC/media/Projects/Lightweight-Cryptography/documents/round-1/spec-doc/KNOT-spec.pdf diff --git a/src/doc/en/reference/topology/index.rst b/src/doc/en/reference/topology/index.rst index bf3eff5149b..8550c2b0c42 100644 --- a/src/doc/en/reference/topology/index.rst +++ b/src/doc/en/reference/topology/index.rst @@ -2,7 +2,7 @@ Topology ======== Sage includes some tools for topology, and in particular cell -complexes: simplicial complexes, `\Delta`-complexes, cubical +complexes: (filtered) simplicial complexes, `\Delta`-complexes, cubical complexes, and simplicial sets. A class of generic cell complexes is also available, mainly for developers who want to use it as a base for other types of cell complexes. @@ -22,5 +22,6 @@ other types of cell complexes. sage/topology/simplicial_set_catalog sage/topology/simplicial_set_morphism sage/topology/cell_complex + sage/topology/filtered_simplicial_complex .. include:: ../footer.txt diff --git a/src/sage/__init__.py b/src/sage/__init__.py index eb317071816..49098fa7e08 100644 --- a/src/sage/__init__.py +++ b/src/sage/__init__.py @@ -1,14 +1,7 @@ -__all__ = ['all'] +# Do not add anything to this file. +# It will be removed soon in order to turn 'sage' into a native namespace package. +# See https://trac.sagemath.org/ticket/29705 -# Set sage.__version__ to the current version number. This is analogous -# to many other Python packages. -from sage.version import version as __version__ - -import sys -# Make sure that the correct zlib library is loaded. This is needed -# to prevent the system zlib to be loaded instead of the Sage one. -# See https://trac.sagemath.org/ticket/23122 -import zlib # IPython calls this when starting up def load_ipython_extension(*args): @@ -16,92 +9,31 @@ def load_ipython_extension(*args): sage.repl.ipython_extension.load_ipython_extension(*args) -# Monkey-patch inspect.isfunction() to support Cython functions. +# Deprecated leftover of monkey-patching inspect.isfunction() to support Cython functions. +# We cannot use lazy_import for the deprecation here. def isfunction(obj): """ Check whether something is a function. + This is a variant of ``inspect.isfunction``: We assume that anything which has a genuine ``__code__`` attribute (not using ``__getattr__`` overrides) is a function. This is meant to support Cython functions. + This function is deprecated. Most uses of ``isfunction`` + can be replaced by ``callable``. + EXAMPLES:: - sage: from inspect import isfunction + sage: from sage import isfunction sage: def f(): pass sage: isfunction(f) + doctest:warning... + DeprecationWarning: sage.isfunction is deprecated; use callable or sage.misc.sageinspect.is_function_or_cython_function instead + See https://trac.sagemath.org/32479 for details. True - sage: isfunction(lambda x:x) - True - sage: from sage.categories.coercion_methods import _mul_parent - sage: isfunction(_mul_parent) - True - sage: isfunction(Integer.digits) # unbound method - False - sage: isfunction(Integer(1).digits) # bound method - False - - Verify that ipywidgets can correctly determine signatures of Cython - functions:: - - sage: from ipywidgets.widgets.interaction import signature - sage: from sage.dynamics.complex_dynamics.mandel_julia_helper import fast_mandelbrot_plot - sage: signature(fast_mandelbrot_plot) # random - """ - # We use type(obj) instead of just obj to avoid __getattr__(). - # Some types, like methods, will return the __code__ of the - # underlying function in __getattr__() but we don't want to - # detect those as functions. - return hasattr(type(obj), "__code__") - -import inspect -inspect.isfunction = isfunction - - -# Monkey-patch ExtensionFileLoader to allow IPython to find the sources -# of Cython files. See https://trac.sagemath.org/ticket/24681 -try: - from importlib.machinery import ExtensionFileLoader -except ImportError: - pass # Python 2 -else: - del ExtensionFileLoader.get_source - - -# Work around a Cygwin-specific bug caused by sqlite3; see -# https://trac.sagemath.org/ticket/30157 and the docstring for -# fix_for_ticket_30157 -# Here we monkey-patch the sqlite3 module to ensure the fix is -# applied the very first time a connection is made to a sqlite3 -# database -if sys.platform == 'cygwin': - def patch_sqlite3(): - try: - from sage.misc.sage_ostools import fix_for_ticket_30157 - except ImportError: - # The module might not have been re-built yet; don't worry about it - # then - return - - import sqlite3 - import functools - orig_sqlite3_connect = sqlite3.connect - - @functools.wraps(orig_sqlite3_connect) - def connect(*args, **kwargs): - if fix_for_ticket_30157(): - raise RuntimeError( - 'patch for Trac ticket #30157 failed; please report this ' - 'bug to https://trac.sagemath.org') - - # Undo the monkey-patch - try: - return orig_sqlite3_connect(*args, **kwargs) - finally: - sqlite3.connect = orig_sqlite3_connect - - sqlite3.connect = connect - - patch_sqlite3() - del patch_sqlite3 + from sage.misc.superseded import deprecation + deprecation(32479, "sage.isfunction is deprecated; use callable or sage.misc.sageinspect.is_function_or_cython_function instead") + from sage.misc.sageinspect import is_function_or_cython_function + return is_function_or_cython_function(obj) diff --git a/src/sage/algebras/finite_dimensional_algebras/__init__.py b/src/sage/algebras/finite_dimensional_algebras/__init__.py index 8b137891791..e69de29bb2d 100644 --- a/src/sage/algebras/finite_dimensional_algebras/__init__.py +++ b/src/sage/algebras/finite_dimensional_algebras/__init__.py @@ -1 +0,0 @@ - diff --git a/src/sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_morphism.py b/src/sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_morphism.py index f339848c02f..cfe8d796e2c 100644 --- a/src/sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_morphism.py +++ b/src/sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_morphism.py @@ -79,7 +79,7 @@ def __init__(self, parent, f, check=True, unitary=True): raise ValueError("homomorphism does not respect unit elements") def _repr_(self): - """ + r""" TESTS:: sage: A = FiniteDimensionalAlgebra(QQ, [Matrix([[1, 0], [0, 1]]), Matrix([[0, 1], [0, 0]])]) @@ -89,7 +89,7 @@ def _repr_(self): 'Morphism from Finite-dimensional algebra of degree 2 over Rational Field to Finite-dimensional algebra of degree 1 over Rational Field given by matrix\n[1]\n[0]' """ return "Morphism from {} to {} given by matrix\n{}".format( - self.domain(), self.codomain(), self._matrix) + self.domain(), self.codomain(), self._matrix) def __call__(self, x): """ diff --git a/src/sage/algebras/hecke_algebras/ariki_koike_algebra.py b/src/sage/algebras/hecke_algebras/ariki_koike_algebra.py index 1c4487923cc..9454e301d26 100644 --- a/src/sage/algebras/hecke_algebras/ariki_koike_algebra.py +++ b/src/sage/algebras/hecke_algebras/ariki_koike_algebra.py @@ -1020,7 +1020,7 @@ def _Li_power(self, i, m): This function is used internally by the multiplication and may return elements that are not in the basis. However these will be eventually resolved after the product has - been computed. + been computed. :: sage: H = algebras.ArikiKoike(3, 2).LT() sage: L2 = H.L(2) diff --git a/src/sage/algebras/iwahori_hecke_algebra.py b/src/sage/algebras/iwahori_hecke_algebra.py index 35cb17c9e65..023d66931b5 100644 --- a/src/sage/algebras/iwahori_hecke_algebra.py +++ b/src/sage/algebras/iwahori_hecke_algebra.py @@ -547,7 +547,7 @@ def _bar_on_coefficients(self, c): This is the ring homomorphism of Laurent polynomials in `\ZZ[u,u^{-1},v,v^{-1}]` which sends `u` to `u^{-1}` and `v` - to `v^{-1}. + to `v^{-1}`. EXAMPLES:: @@ -2435,7 +2435,7 @@ def _bar_on_coefficients(self, c): This is the ring homomorphism of Laurent polynomials in `\ZZ[u,u^{-1},v,v^{-1}]` which sends `u` to `u^{-1}` and `v` - to `v^{-1}. + to `v^{-1}`. EXAMPLES:: diff --git a/src/sage/algebras/letterplace/__init__.py b/src/sage/algebras/letterplace/__init__.py index e0769e05f1b..e69de29bb2d 100644 --- a/src/sage/algebras/letterplace/__init__.py +++ b/src/sage/algebras/letterplace/__init__.py @@ -1 +0,0 @@ -# tell Python that letterplace exists diff --git a/src/sage/algebras/lie_algebras/poincare_birkhoff_witt.py b/src/sage/algebras/lie_algebras/poincare_birkhoff_witt.py index b3ff2c8c82d..4f770e64b01 100644 --- a/src/sage/algebras/lie_algebras/poincare_birkhoff_witt.py +++ b/src/sage/algebras/lie_algebras/poincare_birkhoff_witt.py @@ -325,8 +325,12 @@ def _coerce_map_from_(self, R): if R == self._g: # Make this into the lift map I = self._indices - def basis_function(x): return self.monomial(I.gen(x)) - def inv_supp(m): return None if m.length() != 1 else m.leading_support() + + def basis_function(x): + return self.monomial(I.gen(x)) + + def inv_supp(m): + return None if m.length() != 1 else m.leading_support() # TODO: this diagonal, but with a smaller indexing set... return self._g.module_morphism(basis_function, codomain=self, triangular='upper', unitriangular=True, diff --git a/src/sage/algebras/lie_conformal_algebras/free_fermions_lie_conformal_algebra.py b/src/sage/algebras/lie_conformal_algebras/free_fermions_lie_conformal_algebra.py index 6d7303dac17..dd1d883771a 100644 --- a/src/sage/algebras/lie_conformal_algebras/free_fermions_lie_conformal_algebra.py +++ b/src/sage/algebras/lie_conformal_algebras/free_fermions_lie_conformal_algebra.py @@ -105,10 +105,10 @@ def __init__(self, R, ngens=None, gram_matrix=None, names=None, "{0} x {0} matrix, got {1}".format(ngens,gram_matrix)) else: if ngens is None: - ngens = 1; - gram_matrix = identity_matrix(R,ngens,ngens) + ngens = 1 + gram_matrix = identity_matrix(R, ngens, ngens) - latex_names=None + latex_names = None if (names is None) and (index_set is None): if ngens==1: diff --git a/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_element.py b/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_element.py index 3d244ca72ec..e2ea7dd3c7c 100644 --- a/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_element.py +++ b/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_element.py @@ -5,17 +5,15 @@ - Reimundo Heluani (2019-08-09): Initial implementation. """ - - -#****************************************************************************** +# ***************************************************************************** # Copyright (C) 2019 Reimundo Heluani # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. -# http://www.gnu.org/licenses/ -#***************************************************************************** +# https://www.gnu.org/licenses/ +# **************************************************************************** from sage.arith.all import factorial from sage.misc.misc_c import prod @@ -171,7 +169,7 @@ def _repr_(self): TB[alpha[1]] + 3*B[alpha[2] + alpha[3]] """ if self.is_zero(): - return "0"; + return "0" p = self.parent() if p._names: terms = [("T^({0}){1}".format(k[1], @@ -217,7 +215,7 @@ def _latex_(self): 6T^{(3)}\alpha_{1} """ if self.is_zero(): - return "0"; + return "0" p = self.parent() try: names = p.latex_variable_names() diff --git a/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py b/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py index 2f975e6b8e4..b2cf3582793 100644 --- a/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py +++ b/src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py @@ -7,15 +7,15 @@ """ -#****************************************************************************** +# ***************************************************************************** # Copyright (C) 2019 Reimundo Heluani # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. -# http://www.gnu.org/licenses/ -#***************************************************************************** +# https://www.gnu.org/licenses/ +# **************************************************************************** from sage.arith.all import binomial from sage.sets.family import Family @@ -121,11 +121,8 @@ def _standardize_s_coeff(s_coeff, index_set, ce, parity=None): INPUT: - ``s_coeff`` -- a dictionary as in - :class:`LieConformalAlgebraWithStructureCoefficients`. - - ``index_set` -- A finite enumerated set indexing the + :class:`~sage.algebras.lie_conformal_algebras.lie_conformal_algebra_with_structure_coefficients.LieConformalAlgebraWithStructureCoefficients`. + - ``index_set`` -- a finite enumerated set indexing the generators (not counting the central elements). - ``ce`` -- a tuple of ``str``; a list of names for the central generators of this Lie conformal algebra diff --git a/src/sage/algebras/lie_conformal_algebras/weyl_lie_conformal_algebra.py b/src/sage/algebras/lie_conformal_algebras/weyl_lie_conformal_algebra.py index 1f0ecb5b748..3d5a85dddd8 100644 --- a/src/sage/algebras/lie_conformal_algebras/weyl_lie_conformal_algebra.py +++ b/src/sage/algebras/lie_conformal_algebras/weyl_lie_conformal_algebra.py @@ -152,8 +152,8 @@ def __init__(self,R,ngens=None, gram_matrix=None, names=None, .format(ngens,gram_matrix)) elif (gram_matrix is None): if ngens is None: - ngens = 2; - A = identity_matrix(R,ngens/2) + ngens = 2 + A = identity_matrix(R, ngens // 2) from sage.matrix.special import block_matrix gram_matrix = block_matrix([[R.zero(),A],[-A,R.zero()]]) diff --git a/src/sage/algebras/orlik_solomon.py b/src/sage/algebras/orlik_solomon.py index 55bf95fdaaa..5de7269ac14 100644 --- a/src/sage/algebras/orlik_solomon.py +++ b/src/sage/algebras/orlik_solomon.py @@ -533,7 +533,7 @@ class OrlikSolomonInvariantAlgebra(FiniteDimensionalInvariantModule): sage: OSH.basis() Finite family {0: B[0], 1: B[1], 2: B[2]} sage: [OSH.lift(b) for b in OSH.basis()] - [OS{}, OS{1} + OS{2} + OS{3}, OS{4} + OS{5} + OS{6}] + [OS{}, OS{4} + OS{5} + OS{6}, OS{1} + OS{2} + OS{3}] We implement an `S_4` action on the vertices:: @@ -556,23 +556,22 @@ class OrlikSolomonInvariantAlgebra(FiniteDimensionalInvariantModule): sage: OSH = M.orlik_solomon_algebra(QQ, invariant=(H, vert_action)) sage: B = OSH.basis() sage: [OSH.lift(b) for b in B] - [OS{}, - OS{0}, OS{1} + OS{2} + OS{3} + OS{4}, OS{5}, - OS{0, 1} + OS{0, 2} + OS{0, 3} + OS{0, 4}, OS{0, 5}, - OS{1, 2} - 2*OS{1, 5} + OS{3, 4} - 2*OS{3, 5}, - OS{0, 1, 2} - 2*OS{0, 1, 5} + OS{0, 3, 4} - 2*OS{0, 3, 5}] + [OS{}, OS{5}, OS{1} + OS{2} + OS{3} + OS{4}, OS{0}, + -1/2*OS{1, 2} + OS{1, 5} - 1/2*OS{3, 4} + OS{3, 5}, + OS{0, 5}, OS{0, 1} + OS{0, 2} + OS{0, 3} + OS{0, 4}, + -1/2*OS{0, 1, 2} + OS{0, 1, 5} - 1/2*OS{0, 3, 4} + OS{0, 3, 5}] We demonstrate the algebra structure:: sage: matrix([[b*bp for b in B] for bp in B]) - [ B[0] B[1] B[2] B[3] B[4] B[5] B[6] B[7]] - [ B[1] 0 -B[4] -B[5] 0 0 B[7] 0] - [ B[2] B[4] 0 B[6] 0 B[7] 0 0] - [ B[3] B[5] -B[6] 0 -B[7] 0 0 0] - [ B[4] 0 0 -B[7] 0 0 0 0] - [ B[5] 0 B[7] 0 0 0 0 0] - [ B[6] B[7] 0 0 0 0 0 0] - [ B[7] 0 0 0 0 0 0 0] + [ B[0] B[1] B[2] B[3] B[4] B[5] B[6] B[7]] + [ B[1] 0 2*B[4] B[5] 0 0 2*B[7] 0] + [ B[2] -2*B[4] 0 B[6] 0 -2*B[7] 0 0] + [ B[3] -B[5] -B[6] 0 B[7] 0 0 0] + [ B[4] 0 0 B[7] 0 0 0 0] + [ B[5] 0 -2*B[7] 0 0 0 0 0] + [ B[6] 2*B[7] 0 0 0 0 0 0] + [ B[7] 0 0 0 0 0 0 0] .. NOTE:: @@ -600,7 +599,9 @@ def __init__(self, R, M, G, action_on_groundset=None, *args, **kwargs): if action_on_groundset is None: # if sage knows the action, we don't need to provide it - def action_on_groundset(g, x): return g(x) + + def action_on_groundset(g, x): + return g(x) self._groundset_action = action_on_groundset @@ -609,7 +610,7 @@ def action_on_groundset(g, x): return g(x) def action(g, m): return OS.sum(c * self._basis_action(g, x) - for x,c in m._monomial_coefficients.items()) + for x, c in m._monomial_coefficients.items()) self._action = action diff --git a/src/sage/algebras/orlik_terao.py b/src/sage/algebras/orlik_terao.py index 6ff5f6262cb..128e6156ba7 100644 --- a/src/sage/algebras/orlik_terao.py +++ b/src/sage/algebras/orlik_terao.py @@ -620,7 +620,9 @@ def __init__(self, R, M, G, action_on_groundset=None, *args, **kwargs): self._ambient = OT if action_on_groundset is None: - def action_on_groundset(g, x): return g(x) + + def action_on_groundset(g, x): + return g(x) self._groundset_action = action_on_groundset diff --git a/src/sage/algebras/quantum_groups/quantum_group_gap.py b/src/sage/algebras/quantum_groups/quantum_group_gap.py index 0fadd9277a4..0fa487bf697 100644 --- a/src/sage/algebras/quantum_groups/quantum_group_gap.py +++ b/src/sage/algebras/quantum_groups/quantum_group_gap.py @@ -840,7 +840,7 @@ def counit(self, elt): class Element(QuaGroupModuleElement): def _mul_(self, other): r""" - Subtract ``self`` and ``other``. + Multiply ``self`` and ``other``. EXAMPLES:: @@ -2419,7 +2419,7 @@ def _acted_upon_(self, scalar, self_on_left=False): def _mul_(self, other): r""" - Multiply ``self`` and ``other. + Multiply ``self`` and ``other``. EXAMPLES:: diff --git a/src/sage/algebras/quatalg/__init__.py b/src/sage/algebras/quatalg/__init__.py index 39c07e4598a..e69de29bb2d 100644 --- a/src/sage/algebras/quatalg/__init__.py +++ b/src/sage/algebras/quatalg/__init__.py @@ -1,3 +0,0 @@ -# quaternion algebra init file - -from . import all diff --git a/src/sage/algebras/steenrod/steenrod_algebra_misc.py b/src/sage/algebras/steenrod/steenrod_algebra_misc.py index 3b48511eeda..c221b17461d 100644 --- a/src/sage/algebras/steenrod/steenrod_algebra_misc.py +++ b/src/sage/algebras/steenrod/steenrod_algebra_misc.py @@ -458,7 +458,6 @@ def normalize_profile(profile, precision=None, truncation_type='auto', p=2, gene ... ValueError: Invalid profile """ - from inspect import isfunction from sage.rings.infinity import Infinity if truncation_type == 'zero': truncation_type = 0 @@ -482,7 +481,7 @@ def normalize_profile(profile, precision=None, truncation_type='auto', p=2, gene while profile and profile[-1] == truncation_type: profile = profile[:-1] new_profile = tuple(profile) - elif isfunction(profile): + elif callable(profile): # profile is a function: turn it into a tuple. if # truncation_type not specified, set it to 'infinity' if # the function is ever infinite; otherwise set it to @@ -522,7 +521,7 @@ def normalize_profile(profile, precision=None, truncation_type='auto', p=2, gene while e and e[-1] == truncation_type: e = e[:-1] e = tuple(e) - elif isfunction(e): + elif callable(e): # e is a function: turn it into a tuple. if # truncation_type not specified, set it to 'infinity' # if the function is ever infinite; otherwise set it @@ -541,7 +540,7 @@ def normalize_profile(profile, precision=None, truncation_type='auto', p=2, gene if isinstance(k, (list, tuple)): # k is a list or tuple: use it as is. k = tuple(k) - elif isfunction(k): + elif callable(k): # k is a function: turn it into a tuple. if precision is None: k_precision = 100 diff --git a/src/sage/all.py b/src/sage/all.py index 5d4d8a77d78..4fa89329e81 100644 --- a/src/sage/all.py +++ b/src/sage/all.py @@ -94,10 +94,6 @@ warnings.filterwarnings('ignore', category=DeprecationWarning, module='(scipy|networkx)') -# Ignore collections.abc warnings, there are a lot of them but they are -# harmless. -warnings.filterwarnings('ignore', category=DeprecationWarning, - message='.*collections[.]abc.*') # However, be sure to keep OUR deprecation warnings warnings.filterwarnings('default', category=DeprecationWarning, message=r'[\s\S]*See https?://trac\.sagemath\.org/[0-9]* for details.') @@ -182,6 +178,7 @@ from sage.dynamics.all import * from sage.homology.all import * + from sage.topology.all import * from sage.quadratic_forms.all import * @@ -197,7 +194,7 @@ from sage.stats.all import * import sage.stats.all as stats -import sage.finance.all as finance +lazy_import("sage.finance", "all", as_="finance", deprecation=32427) from sage.parallel.all import * @@ -323,6 +320,7 @@ def quit_sage(verbose=True): # From now on it is ok to resolve lazy imports sage.misc.lazy_import.finish_startup() + def sage_globals(): r""" Return the Sage namespace. diff --git a/src/sage/arith/misc.py b/src/sage/arith/misc.py index 72b609c1b94..7ddab883733 100644 --- a/src/sage/arith/misc.py +++ b/src/sage/arith/misc.py @@ -2033,6 +2033,7 @@ def xkcd(n=""): import contextlib import json from sage.misc.html import html + from ssl import SSLContext # import compatible with py2 and py3 from urllib.request import urlopen @@ -2041,12 +2042,12 @@ def xkcd(n=""): data = None if not n: # default to last comic - url = "http://xkcd.com/info.0.json" + url = "https://xkcd.com/info.0.json" else: url = "https://xkcd.com/{}/info.0.json".format(n) try: - with contextlib.closing(urlopen(url)) as f: + with contextlib.closing(urlopen(url, context=SSLContext())) as f: data = f.read() except HTTPError as error: if error.getcode() == 400: # this error occurs when asking for a non valid comic number @@ -3619,12 +3620,12 @@ def binomial(x, m, **kwds): def multinomial(*ks): r""" - Return the multinomial coefficient + Return the multinomial coefficient. INPUT: - - An arbitrary number of integer arguments `k_1,\dots,k_n` - - An iterable (e.g. a list) of integers `[k_1,\dots,k_n]` + - either an arbitrary number of integer arguments `k_1,\dots,k_n` + - or an iterable (e.g. a list) of integers `[k_1,\dots,k_n]` OUTPUT: @@ -3653,6 +3654,8 @@ def multinomial(*ks): sage: multinomial(Partition([4, 2])) 15 + TESTS: + Tests with numpy and gmpy2 numbers:: sage: from numpy import int8 @@ -3662,6 +3665,11 @@ def multinomial(*ks): sage: multinomial(mpz(3), mpz(2)) mpz(10) + sage: multinomial(range(1), range(2)) + Traceback (most recent call last): + ... + ValueError: multinomial takes only one iterable argument + AUTHORS: - Gabriel Ebner @@ -3669,10 +3677,12 @@ def multinomial(*ks): if isinstance(ks[0], Iterable): if len(ks) > 1: raise ValueError("multinomial takes only one iterable argument") - ks = ks[0] + keys = ks[0] + else: + keys = ks s, c = 0, 1 - for k in ks: + for k in keys: s += k c *= binomial(s, k) return c @@ -4600,12 +4610,13 @@ def hilbert_symbol(a, b, p, algorithm="pari"): else: raise ValueError("Algorithm %s not defined"%algorithm) + def hilbert_conductor(a, b): r""" - This is the product of all (finite) primes where the Hilbert symbol is -1. + Return the product of all (finite) primes where the Hilbert symbol is -1. - What is the same, this is the (reduced) discriminant of the quaternion - algebra `(a,b)` over `\QQ`. + This is the (reduced) discriminant of the quaternion algebra `(a,b)` + over `\QQ`. INPUT: @@ -4613,7 +4624,7 @@ def hilbert_conductor(a, b): OUTPUT: - - squarefree positive integer + squarefree positive integer EXAMPLES:: @@ -4640,11 +4651,9 @@ def hilbert_conductor(a, b): - Gonzalo Tornaria (2009-03-02) """ a, b = ZZ(a), ZZ(b) - d = ZZ(1) - for p in set().union([2], prime_divisors(a), prime_divisors(b)): - if hilbert_symbol(a, b, p) == -1: - d *= p - return d + return ZZ.prod(p for p in set([2]).union(prime_divisors(a), + prime_divisors(b)) + if hilbert_symbol(a, b, p) == -1) def hilbert_conductor_inverse(d): diff --git a/src/sage/calculus/integration.pyx b/src/sage/calculus/integration.pyx index 93a3681854d..56456173632 100644 --- a/src/sage/calculus/integration.pyx +++ b/src/sage/calculus/integration.pyx @@ -28,7 +28,6 @@ AUTHORS: from cysignals.signals cimport sig_on, sig_off from memory_allocator cimport MemoryAllocator -import inspect from sage.rings.real_double import RDF from sage.libs.gsl.all cimport * @@ -582,19 +581,21 @@ def monte_carlo_integral(func, xl, xu, size_t calls, algorithm='plain', _xu[i] = xu[i] if not callable(func): - # constant + # constant. Note that all Expression objects are callable. v = float(1) for i in range(dim): v *= _xu[i] - _xl[i] return (v * func, 0.0) elif not isinstance(func, Wrapper_rdf): - if inspect.isfunction(func): - vars = sage_getargspec(func)[0] - elif hasattr(func, 'arguments'): + # func is either an Expression or another callable. + try: vars = func.arguments() - else: - vars = func.variables() + except AttributeError: + try: + vars = func.variables() + except AttributeError: + vars = sage_getargspec(func)[0] target_dim = dim + len(params) if len(vars) < target_dim: @@ -611,7 +612,8 @@ def monte_carlo_integral(func, xl, xu, size_t calls, algorithm='plain', "more items in upper and lower limits" ).format(len(vars), tuple(vars), target_dim)) - if not inspect.isfunction(func): + from sage.symbolic.expression import is_Expression + if is_Expression(func): if params: to_sub = dict(zip(vars[-len(params):], params)) func = func.subs(to_sub) diff --git a/src/sage/calculus/transforms/fft.pyx b/src/sage/calculus/transforms/fft.pyx index 3ed178ee074..c5a6108d222 100644 --- a/src/sage/calculus/transforms/fft.pyx +++ b/src/sage/calculus/transforms/fft.pyx @@ -140,8 +140,10 @@ cdef class FastFourierTransform_complex(FastFourierTransform_base): def __setitem__(self, size_t i, xy): """ - Assign a value to an index of the array. Currently the input has to be - en element that can be coerced to ``float` or a ``ComplexNumber`` element. + Assign a value to an index of the array. + + Currently the input has to be en element that can be coerced + to ``float`` or a ``ComplexNumber`` element. INPUT: diff --git a/src/sage/categories/bimodules.py b/src/sage/categories/bimodules.py index 2317d652a77..d85af83880d 100644 --- a/src/sage/categories/bimodules.py +++ b/src/sage/categories/bimodules.py @@ -42,11 +42,11 @@ def __init__(self, left_base, right_base, name=None): sage: C = Bimodules(QQ, ZZ) sage: TestSuite(C).run() """ - if not ( left_base in Rings or + if not ( left_base in Rings() or (isinstance(left_base, Category) and left_base.is_subcategory(Rings())) ): raise ValueError("the left base must be a ring or a subcategory of Rings()") - if not ( right_base in Rings or + if not ( right_base in Rings() or (isinstance(right_base, Category) and right_base.is_subcategory(Rings())) ): raise ValueError("the right base must be a ring or a subcategory of Rings()") diff --git a/src/sage/categories/category_types.py b/src/sage/categories/category_types.py index c70e4458b90..67bc36fc19a 100644 --- a/src/sage/categories/category_types.py +++ b/src/sage/categories/category_types.py @@ -343,7 +343,7 @@ def __init__(self, base, name=None): sage: TestSuite(C).run() """ from sage.categories.rings import Rings - if not (base in Rings or + if not (base in Rings() or isinstance(base, Category) and base.is_subcategory(Rings())): raise ValueError("base must be a ring or a subcategory of Rings()") Category_over_base.__init__(self, base, name) diff --git a/src/sage/categories/enumerated_sets.py b/src/sage/categories/enumerated_sets.py index 20de7fcb01a..4ca5747f04e 100644 --- a/src/sage/categories/enumerated_sets.py +++ b/src/sage/categories/enumerated_sets.py @@ -171,7 +171,7 @@ def __iter__(self): +------------------------+---------------------------------+ | ``unrank`` | ``_iterator_from_unrank`` | +------------------------+---------------------------------+ - | ``list` | ``_iterator_from_next`` | + | ``list`` | ``_iterator_from_next`` | +------------------------+---------------------------------+ It is also possible to override ``__iter__`` method itself. Then diff --git a/src/sage/categories/examples/__init__.py b/src/sage/categories/examples/__init__.py index 8b137891791..e69de29bb2d 100644 --- a/src/sage/categories/examples/__init__.py +++ b/src/sage/categories/examples/__init__.py @@ -1 +0,0 @@ - diff --git a/src/sage/categories/filtered_modules.py b/src/sage/categories/filtered_modules.py index 4a6ef11b6a1..dd055f4d505 100644 --- a/src/sage/categories/filtered_modules.py +++ b/src/sage/categories/filtered_modules.py @@ -121,7 +121,7 @@ def extra_super_categories(self): from sage.categories.modules import Modules from sage.categories.fields import Fields base_ring = self.base_ring() - if base_ring in Fields: + if base_ring in Fields(): return [Modules(base_ring)] else: return [] diff --git a/src/sage/categories/finite_dimensional_lie_algebras_with_basis.py b/src/sage/categories/finite_dimensional_lie_algebras_with_basis.py index 9a1ae26e1d3..c3a5506db8d 100644 --- a/src/sage/categories/finite_dimensional_lie_algebras_with_basis.py +++ b/src/sage/categories/finite_dimensional_lie_algebras_with_basis.py @@ -101,7 +101,9 @@ def _construct_UEA(self): I = self._basis_ordering try: names = [str(x) for x in I] - def names_map(x): return x + + def names_map(x): + return x F = FreeAlgebra(self.base_ring(), names) except ValueError: names = ['b{}'.format(i) for i in range(self.dimension())] @@ -115,7 +117,9 @@ def names_map(x): return x rels = {} S = self.structure_coefficients(True) # Construct the map from indices to names of the UEA - def get_var(g): return d[names_map(g)] + + def get_var(g): + return d[names_map(g)] # The function ``get_var`` sends an element of the basis of # ``self`` to the corresponding element of ``F``. for k in S.keys(): diff --git a/src/sage/categories/finite_dimensional_modules_with_basis.py b/src/sage/categories/finite_dimensional_modules_with_basis.py index 2e26e338728..0a88ea68233 100644 --- a/src/sage/categories/finite_dimensional_modules_with_basis.py +++ b/src/sage/categories/finite_dimensional_modules_with_basis.py @@ -443,7 +443,7 @@ def twisted_invariant_module(self, G, chi, Create the isotypic component of the action of ``G`` on ``self`` with irreducible character given by ``chi``. - .. SEEALSO: + .. SEEALSO:: -:class:`~sage.modules.with_basis.invariant.FiniteDimensionalTwistedInvariantModule` diff --git a/src/sage/categories/finite_groups.py b/src/sage/categories/finite_groups.py index c840709b39b..d8802949324 100644 --- a/src/sage/categories/finite_groups.py +++ b/src/sage/categories/finite_groups.py @@ -212,7 +212,7 @@ def extra_super_categories(self): """ from sage.categories.fields import Fields K = self.base_ring() - if (K in Fields) and K.characteristic() == 0: + if K in Fields() and K.characteristic() == 0: from sage.categories.algebras import Algebras return [Algebras(self.base_ring()).Semisimple()] else: diff --git a/src/sage/categories/modules.py b/src/sage/categories/modules.py index d990767482b..7139c413bcc 100644 --- a/src/sage/categories/modules.py +++ b/src/sage/categories/modules.py @@ -112,7 +112,7 @@ class Modules(Category_module): """ @staticmethod - def __classcall_private__(cls, base_ring, dispatch = True): + def __classcall_private__(cls, base_ring, dispatch=True): r""" Implement the dispatching of ``Modules(field)`` to ``VectorSpaces(field)``. @@ -171,7 +171,7 @@ def super_categories(self): [Category of modules over Rational Field] """ R = self.base_ring() - return [Bimodules(R,R)] + return [Bimodules(R, R)] def additional_structure(self): r""" @@ -805,7 +805,7 @@ def _lmul_(self, x): ((5, 10), (15, 20)) """ return self.parent()._cartesian_product_of_elements( - x*y for y in self.cartesian_factors()) + x * y for y in self.cartesian_factors()) class TensorProducts(TensorProductsCategory): """ @@ -822,4 +822,3 @@ def extra_super_categories(self): [Category of modules over Integer Ring] """ return [self.base_category()] - diff --git a/src/sage/categories/sets_cat.py b/src/sage/categories/sets_cat.py index 55e8a6e8ab6..7e8cdc95146 100644 --- a/src/sage/categories/sets_cat.py +++ b/src/sage/categories/sets_cat.py @@ -714,8 +714,8 @@ def Algebras(self, base_ring): sage: TestSuite(Groups().Finite().Algebras(QQ)).run() """ from sage.categories.rings import Rings - assert base_ring in Rings or (isinstance(base_ring, Category) - and base_ring.is_subcategory(Rings())) + assert base_ring in Rings() or (isinstance(base_ring, Category) + and base_ring.is_subcategory(Rings())) return AlgebrasCategory.category_of(self, base_ring) @cached_method diff --git a/src/sage/categories/super_modules.py b/src/sage/categories/super_modules.py index 945122e6e09..254ec3ff978 100644 --- a/src/sage/categories/super_modules.py +++ b/src/sage/categories/super_modules.py @@ -158,7 +158,7 @@ def extra_super_categories(self): from sage.categories.modules import Modules from sage.categories.fields import Fields base_ring = self.base_ring() - if base_ring in Fields: + if base_ring in Fields(): return [Modules(base_ring)] else: return [] diff --git a/src/sage/coding/__init__.py b/src/sage/coding/__init__.py index 8b137891791..e69de29bb2d 100644 --- a/src/sage/coding/__init__.py +++ b/src/sage/coding/__init__.py @@ -1 +0,0 @@ - diff --git a/src/sage/coding/bch_code.py b/src/sage/coding/bch_code.py index a07be8a20ce..701fa6900d5 100644 --- a/src/sage/coding/bch_code.py +++ b/src/sage/coding/bch_code.py @@ -136,7 +136,7 @@ def __init__(self, base_field, length, designed_distance, if not (0 < designed_distance <= length): raise ValueError("designed_distance must belong to [1, n]") - if base_field not in Fields or not base_field.is_finite(): + if base_field not in Fields() or not base_field.is_finite(): raise ValueError("base_field has to be a finite field") q = base_field.cardinality() diff --git a/src/sage/coding/reed_muller_code.py b/src/sage/coding/reed_muller_code.py index 63d36a0614a..653cae234f9 100644 --- a/src/sage/coding/reed_muller_code.py +++ b/src/sage/coding/reed_muller_code.py @@ -180,7 +180,7 @@ def ReedMullerCode(base_field, order, num_of_var): sage: C Binary Reed-Muller Code of order 2 and number of variables 2 """ - if not(base_field in FiniteFields): + if base_field not in FiniteFields(): raise ValueError("The parameter `base_field` must be a finite field") q = base_field.cardinality() if q == 2: @@ -253,7 +253,7 @@ def __init__(self, base_field, order, num_of_var): ValueError: the input `base_field` must be a FiniteField """ # input sanitization - if not(base_field in FiniteFields): + if base_field not in FiniteFields(): raise ValueError("the input `base_field` must be a FiniteField") if not(isinstance(order, (Integer, int))): raise ValueError("The order of the code must be an integer") diff --git a/src/sage/coding/source_coding/__init__.py b/src/sage/coding/source_coding/__init__.py index 6e633f48916..e69de29bb2d 100644 --- a/src/sage/coding/source_coding/__init__.py +++ b/src/sage/coding/source_coding/__init__.py @@ -1 +0,0 @@ -from . import all diff --git a/src/sage/combinat/crystals/tensor_product_element.pyx b/src/sage/combinat/crystals/tensor_product_element.pyx index d2d88740133..ed3e688ee56 100644 --- a/src/sage/combinat/crystals/tensor_product_element.pyx +++ b/src/sage/combinat/crystals/tensor_product_element.pyx @@ -1314,7 +1314,7 @@ cdef class CrystalOfBKKTableauxElement(TensorProductOfSuperCrystalsElement): return repr(self.to_tableau()) def _repr_diagram(self): - """ + r""" Return a string representation of ``self`` as a diagram. EXAMPLES:: diff --git a/src/sage/combinat/designs/covering_design.py b/src/sage/combinat/designs/covering_design.py index eeaa04bf1a3..a1959604a1c 100644 --- a/src/sage/combinat/designs/covering_design.py +++ b/src/sage/combinat/designs/covering_design.py @@ -46,6 +46,7 @@ # **************************************************************************** from urllib.request import urlopen +from ssl import SSLContext from sage.misc.sage_eval import sage_eval from sage.structure.sage_object import SageObject @@ -528,7 +529,7 @@ def best_known_covering_design_www(v, k, t, verbose=False): if verbose: print("Looking up the bounds at %s" % url) - f = urlopen(url) + f = urlopen(url, context=SSLContext()) try: s = bytes_to_str(f.read()) finally: diff --git a/src/sage/combinat/finite_state_machine.py b/src/sage/combinat/finite_state_machine.py index 8a74a13af0c..2cdd4045c02 100644 --- a/src/sage/combinat/finite_state_machine.py +++ b/src/sage/combinat/finite_state_machine.py @@ -136,7 +136,6 @@ :meth:`Transducer.cartesian_product` | Cartesian product of a transducer with another finite state machine :meth:`~FiniteStateMachine.product_FiniteStateMachine` | Product of finite state machines :meth:`~FiniteStateMachine.composition` | Composition (output of other is input of self) - :meth:`~FiniteStateMachine.__call__` | Composition with other finite state machine :meth:`~FiniteStateMachine.input_projection` | Input projection (output is deleted) :meth:`~FiniteStateMachine.output_projection` | Output projection (old output is new input) :meth:`~FiniteStateMachine.projection` | Input or output projection @@ -1779,8 +1778,6 @@ def deepcopy(self, memo=None): False sage: B.initial_probability == A.initial_probability True - sage: B.initial_probability is A.initial_probability - False """ return deepcopy(self, memo) diff --git a/src/sage/combinat/k_regular_sequence.py b/src/sage/combinat/k_regular_sequence.py index cdeaa40bc65..0fd6e01015f 100644 --- a/src/sage/combinat/k_regular_sequence.py +++ b/src/sage/combinat/k_regular_sequence.py @@ -1719,7 +1719,6 @@ def matrix(self, recurrence_rules, rem, correct_offset=True): """ from sage.arith.srange import srange from sage.matrix.constructor import Matrix - from sage.matrix.matrix_space import MatrixSpace from sage.matrix.special import block_matrix, zero_matrix from sage.modules.free_module_element import vector @@ -1772,9 +1771,8 @@ def entry(i, kk): for i in srange(n1): J = J.stack(vector([int(j*k == i - rem) for j in srange(n1)])) - Mat = MatrixSpace(coefficient_ring, dim, dim) - return Mat(block_matrix([[mat, W], - [zero_matrix(n1, dim_without_corr), J]])) + Z = zero_matrix(coefficient_ring, n1, dim_without_corr) + return block_matrix([[mat, W], [Z, J]], subdivide=False) def left(self, recurrence_rules): r""" diff --git a/src/sage/combinat/parallelogram_polyomino.py b/src/sage/combinat/parallelogram_polyomino.py index f238c132189..48a8de037f8 100644 --- a/src/sage/combinat/parallelogram_polyomino.py +++ b/src/sage/combinat/parallelogram_polyomino.py @@ -98,7 +98,6 @@ class LocalOptions: sage: e.options(delim='p'); e p - This class is temporary, in the future, this class should be integrated in sage.structure.global_options.py. We should split global_option in two classes LocalOptions and GlobalOptions. @@ -418,7 +417,6 @@ def keys(self): def _dispatch(self, obj, dispatch_to, option, *get_values, **set_values): r""" - The *dispatchable* options are options which dispatch related methods of the corresponding class. The format for specifying a dispatchable option is to include ``dispatch_to =