Skip to content

Commit

Permalink
Revert "sync with official remote (#1)"
Browse files Browse the repository at this point in the history
This reverts commit 121b7ff.
  • Loading branch information
bodnalev committed Feb 29, 2024
1 parent 220e075 commit 3f205e4
Show file tree
Hide file tree
Showing 921 changed files with 5,439 additions and 7,800 deletions.
28 changes: 11 additions & 17 deletions .ci/create-changes-html.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,27 +62,21 @@ for block in diff_blocks:
match = re.search(r'^diff --git a/(.*) b/\1', block, flags=re.MULTILINE)
if match:
doc = match.group(1)
path = 'html/' + doc
file_path = os.path.join('$DOC_REPOSITORY', doc)
try:
with open(file_path, 'r') as file:
content = file.readlines()
except FileNotFoundError:
content = []
with open(file_path, 'r') as file:
content = file.readlines()
count = 0
for line in block.splitlines():
if line.startswith('@@ -'):
search_result = re.search(r'@@ -(\d+),(\d+) \+(\d+),(\d+)', line)
if search_result:
line_number = int(search_result.group(3))
for i in range(line_number - 1, -1, -1):
if content[i].startswith('<'):
count += 1
content[i] = f'<span id="hunk{count}" style="visibility: hidden;"></span>' + content[i]
break
if content:
with open(file_path, 'w') as file:
file.writelines(content)
path = 'html/' + doc
line_number = int(re.search(r'@@ -(\d+)', line).group(1))
for i in range(line_number, -1, -1):
if content[i].startswith('<'):
count += 1
content[i] = f'<span id="hunk{count}" style="visibility: hidden;"></span>' + content[i]
break
with open(file_path, 'w') as file:
file.writelines(content)
hunks = '&nbsp;'.join(f'<a href="{path}#hunk{i+1}" class="hunk" target="_blank">#{i + 1}</a>' for i in range(count))
out_blocks.append(f'<p class="diff"><a href="{path}">{doc}</a>&nbsp;' + hunks + '&emsp;</p>'
+ '\n<pre><code class="language-diff">'
Expand Down
28 changes: 5 additions & 23 deletions .github/sync_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ def __init__(self, url, actor):
self._commits = None
self._commit_date = None
self._bot_login = None
self._gh_version = None

s = url.split('/')
self._owner = s[3]
Expand Down Expand Up @@ -236,30 +235,13 @@ def bot_login(self):
"""
if self._bot_login:
return self._bot_login
from subprocess import run
cmd = 'gh version'
capt = run(cmd, shell=True, capture_output=True)
self._gh_version = str(capt.stdout).split('\\n')[0]
info('version: %s' % self._gh_version)
cmd = 'gh auth status'
from subprocess import run
capt = run(cmd, shell=True, capture_output=True)
errtxt = str(capt.stderr)
outtxt = str(capt.stdout)
debug('auth status err: %s' % errtxt)
debug('auth status out: %s' % outtxt)
def read_login(txt, position_mark):
for t in txt:
for p in position_mark:
# the output text has changed from as to account
# around version 2.40.0
l = t.split()
if p in l:
return l[l.index(p)+1]
self._bot_login = read_login([errtxt, outtxt], ['account', 'as'])
if not self._bot_login:
self._bot_login = default_bot
warning('Bot is unknown')
return self._bot_login
l = str(capt.stderr).split()
if not 'as' in l:
l = str(capt.stdout).split()
self._bot_login = l[l.index('as')+1]
if self._bot_login.endswith('[bot]'):
self._bot_login = self._bot_login.split('[bot]')[0]
info('Bot is %s' % self._bot_login)
Expand Down
53 changes: 0 additions & 53 deletions .github/workflows/ci-conda-known-test-failures.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
- name: Test
if: success() || failure()
shell: bash -l {0}
run: ./sage -t --all --baseline-stats-path=.github/workflows/ci-conda-known-test-failures.json -p0
run: ./sage -t --all -p0

- name: Print logs
if: always()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doc-build-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
export PATH="build/bin:$PATH"
eval $(sage-print-system-package-command auto update)
eval $(sage-print-system-package-command auto --yes --no-install-recommends install zip)
eval $(sage-print-system-package-command auto --spkg --yes --no-install-recommends install git texlive texlive_luatex free_fonts xindy)
eval $(sage-print-system-package-command auto --spkg --yes --no-install-recommends install git texlive)
- name: Add prebuilt tree as a worktree
id: worktree
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ jobs:
export PATH="build/bin:$PATH"
eval $(sage-print-system-package-command auto update)
eval $(sage-print-system-package-command auto --yes --no-install-recommends install zip)
eval $(sage-print-system-package-command auto --spkg --yes --no-install-recommends install git texlive texlive_luatex free_fonts xindy)
eval $(sage-print-system-package-command auto --spkg --yes --no-install-recommends install git texlive)
export SAGE_USE_CDNS=yes
export SAGE_LIVE_DOC=yes
export SAGE_JUPYTER_SERVER=binder:sagemath/sage-binder-env/dev
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ title: SageMath
abstract: SageMath is a free open-source mathematics software system.
authors:
- name: "The SageMath Developers"
version: 10.3.beta4
version: 10.3.beta2
doi: 10.5281/zenodo.593563
date-released: 2023-12-26
date-released: 2023-12-13
repository-code: "https://github.com/sagemath/sage"
url: "https://www.sagemath.org/"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ For installation of `sage` in python using `pip` you need to install `sagemath-s

$ python3 -m pip install sage_conf
$ ls $(sage-config SAGE_SPKG_WHEELS)
$ python3 -m pip install $(sage-config SAGE_SPKG_WHEELS)/*.whl sage_setup
$ python3 -m pip install --no-build-isolation sagemath-standard
$ python3 -m pip install $(sage-config SAGE_SPKG_WHEELS)/*.whl
$ python3 -m pip install sagemath-standard

You need to install `sage_conf`, a wheelhouse of various python packages. You can list the wheels using `ls $(sage-config SAGE_SPKG_WHEELS)`. After manual installation of these wheels, you can install the sage library, `sagemath-standard`.

Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SageMath version 10.3.beta4, Release Date: 2023-12-26
SageMath version 10.3.beta2, Release Date: 2023-12-13
4 changes: 3 additions & 1 deletion build/bin/sage-dist-helpers
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ sdh_pip_install() {
# Our default after #33789 (Sage 9.7): We allow the package to provision
# its build environment using the stored wheels.
# We pass --find-links.
# The SPKG needs to declare "setuptools" as a dependency.
# The SPKG needs to declare "setuptools_wheel" as a dependency.
build_isolation_option="--find-links=$SAGE_SPKG_WHEELS"
;;
--no-build-isolation)
Expand Down Expand Up @@ -289,6 +289,8 @@ sdh_pip_install() {

sdh_pip_editable_install() {
echo "Installing $PKG_NAME (editable mode)"
# Until https://github.com/sagemath/sage/issues/34209 switches us to PEP 660 editable wheels
export SETUPTOOLS_ENABLE_FEATURES=legacy-editable
python3 -m pip install --verbose --no-deps --no-index --no-build-isolation --isolated --editable "$@" || \
sdh_die "Error installing $PKG_NAME"
}
Expand Down
2 changes: 1 addition & 1 deletion build/bin/sage-get-system-packages
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ case "$SYSTEM" in
fi
fi
SYSTEM_PACKAGES_FILE_NAMES="distros/$SYSTEM.txt"
STRIP_COMMENTS="sed s/#.*//;s/\${PYTHON_MINOR}/${PYTHON_MINOR}/g"
STRIP_COMMENTS="sed s/#.*//;"
COLLECT=echo
;;
esac
Expand Down
2 changes: 0 additions & 2 deletions build/bin/sage-guess-package-system
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ if conda --version > /dev/null 2>&1; then
fi
if brew --version > /dev/null 2>&1; then
echo homebrew
elif port version > /dev/null 2>&1; then
echo macports
elif emerge --version > /dev/null 2>&1; then
echo gentoo
elif apt-get --version > /dev/null 2>&1; then
Expand Down
63 changes: 17 additions & 46 deletions build/bin/sage-print-system-package-command
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@ do
;;
--prompt)
PROMPT=' $ '
CONTINUATION=' '
;;
--continuation=*)
CONTINUATION="${1#--continuation=}"
;;
--wrap)
WRAP=78
;;
--wrap=*)
WRAP="${1#--wrap=}"
;;
--no-install-recommends)
NO_INSTALL_RECOMMENDS=yes
Expand Down Expand Up @@ -89,13 +79,7 @@ function print_shell_command()
echo ".. CODE-BLOCK:: bash"
echo
fi
# shell-quote arguments if necessary
quoted=$(for a in "$@"; do printf "%q " $a; done)
if [ -z "$WRAP" -o $# -lt 6 ]; then
echo "${PROMPT}${quoted}"
else
sage-bootstrap-python -c "import textwrap; print(' \\\\\n'.join(textwrap.wrap(r'''${quoted}''', $WRAP, initial_indent=r'''${PROMPT}''', subsequent_indent=r'''${CONTINUATION}''', break_long_words=False, break_on_hyphens=False)))"
fi
echo "${PROMPT}$1"
if [ -n "$OUTPUT_RST" ]; then
echo
fi
Expand All @@ -118,90 +102,77 @@ case $system:$command in
[ -n "$SAGE_ROOT" ] || SAGE_ROOT=.
echo "${PROMPT}source $SAGE_ROOT/.homebrew-build-env"
;;
macports*:setup-build-env)
$IF_VERBOSE echo "${COMMENT}"
$IF_VERBOSE echo "${COMMENT}WARNING: Use of MacPorts is experimental"
$IF_VERBOSE echo "${COMMENT}"
$IF_VERBOSE echo "${COMMENT}MacPorts does not provide unversioned gfortran executables by default"
$IF_VERBOSE echo "${COMMENT}To make gfortran available (and build with gcc from XCode), use:"
$IF_VERBOSE echo "${COMMENT}"
$IF_VERBOSE print_shell_command ./configure FC=gfortran-mp-11
;;
*:setup-build-env)
# Nothing needed
;;
#
# Verbs handled above are our own inventions. Verbs handled below are apt-get verbs.
#
@(debian*|ubuntu*):update)
print_shell_command ${SUDO}apt-get $command $system_packages
print_shell_command "${SUDO}apt-get $command $system_packages"
;;
@(debian*|ubuntu*):*)
[ "$NO_INSTALL_RECOMMENDS" = yes ] && options="$options --no-install-recommends"
[ "$YES" = yes ] && options="$options --yes" env="DEBIAN_FRONTEND=noninteractive "
[ -n "$system_packages" ] && print_shell_command ${SUDO}${env}apt-get $command $options $system_packages
[ -n "$system_packages" ] && print_shell_command "${SUDO}${env}apt-get $command $options $system_packages"
;;
@(fedora*|redhat*|centos*):install)
[ "$YES" = yes ] && options="$options -y"
[ -n "$system_packages" ] && print_shell_command ${SUDO}yum install $options $system_packages
[ -n "$system_packages" ] && print_shell_command "${SUDO}yum install $options $system_packages"
;;
gentoo*:install)
[ -n "$system_packages" ] && print_shell_command ${SUDO}emerge $system_packages
[ -n "$system_packages" ] && print_shell_command "${SUDO}emerge $system_packages"
;;
arch*:update)
print_shell_command "${SUDO}pacman -Sy"
;;
arch*:install)
[ "$YES" = yes ] && options="$options --noconfirm"
[ -n "$system_packages" ] && print_shell_command ${SUDO}pacman -S $options $system_packages
[ -n "$system_packages" ] && print_shell_command "${SUDO}pacman -S $options $system_packages"
;;
void*:update)
print_shell_command "${SUDO}xbps-install -Su"
;;
void*:install)
[ "$YES" = yes ] && options="$options --yes"
[ -n "$system_packages" ] && print_shell_command ${SUDO}xbps-install $options $system_packages
[ -n "$system_packages" ] && print_shell_command "${SUDO}xbps-install $options $system_packages"
;;
opensuse*:install)
[ -n "$system_packages" ] && print_shell_command ${SUDO}zypper install $system_packages
[ -n "$system_packages" ] && print_shell_command "${SUDO}zypper install $system_packages"
;;
*conda*:install)
[ "$YES" = yes ] && options="$options --yes"
[ -n "$system_packages" ] && print_shell_command conda install $options $system_packages
[ -n "$system_packages" ] && print_shell_command "conda install $options $system_packages"
;;
homebrew*:install)
[ -n "$system_packages" ] && print_shell_command brew install $system_packages
;;
macports*:install)
[ "$YES" = yes ] && options="$options -N"
[ -n "$system_packages" ] && print_shell_command ${SUDO}port $options install $system_packages
[ -n "$system_packages" ] && print_shell_command "brew install $system_packages"
;;
slackware*:install)
[ -n "$system_packages" ] && print_shell_command ${SUDO}slackpkg install $system_packages
[ -n "$system_packages" ] && print_shell_command "${SUDO}slackpkg install $system_packages"
;;
cygwin*:update)
print_comment "first install apt-cyg from https://github.com/transcode-open/apt-cyg"
;;
cygwin*:install)
[ -n "$system_packages" ] && print_shell_command apt-cyg install $system_packages
[ -n "$system_packages" ] && print_shell_command "apt-cyg install $system_packages"
;;
freebsd*:install)
[ -n "$system_packages" ] && print_shell_command ${SUDO}pkg install $system_packages
[ -n "$system_packages" ] && print_shell_command "${SUDO}pkg install $system_packages"
;;
nix*:install)
[ -n "$system_packages" ] && print_shell_command nix-env --install $system_packages
[ -n "$system_packages" ] && print_shell_command "nix-env --install $system_packages"
;;
alpine:update)
print_shell_command "apk update"
;;
alpine:install)
[ -n "$system_packages" ] && print_shell_command apk add $system_packages
[ -n "$system_packages" ] && print_shell_command "apk add $system_packages"
;;
pip:install)
[ -n "$system_packages" ] && print_shell_command sage -pip install $system_packages
[ -n "$system_packages" ] && print_shell_command "sage -pip install $system_packages"
;;
cpan:install)
[ -n "$system_packages" ] && print_shell_command cpan -i $system_packages
[ -n "$system_packages" ] && print_shell_command "cpan -i $system_packages"
;;
repology:install)
if [ -n "$system_packages" ]; then
Expand Down
12 changes: 5 additions & 7 deletions build/bin/sage-spkg
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ fi
PKG_BASE_VER=`echo $PKG_VER | sed 's/\.p[0-9][0-9]*$//'`
if [ -f "$PKG_SCRIPTS/checksums.ini" ]; then
# Normal/wheel package
PKG_NAME_UPSTREAM=`lookup_param tarball "$PKG_SCRIPTS/checksums.ini"`
PKG_NAME_UPSTREAM=`lookup_param tarball "$PKG_SCRIPTS/checksums.ini" | sed "s/VERSION/$PKG_BASE_VER/"`
fi

# Set the $SAGE_DESTDIR variable to be passed to the spkg-install
Expand Down Expand Up @@ -396,11 +396,11 @@ ensure_pkg_src() { ###############################################
if [ ! -f "$PKG_SRC" ]; then
if [ -n "$PKG_NAME_UPSTREAM" ]; then
# Normal or wheel package
PKG_SRC=$(sage-package download $SAGE_DOWNLOAD_FILE_OPTIONS $PKG_BASE)
if [ $? != 0 ]; then
error_msg "Error downloading tarball of $PKG_BASE"
if ! sage-download-file $SAGE_DOWNLOAD_FILE_OPTIONS "$PKG_NAME_UPSTREAM"; then
error_msg "Error downloading $PKG_NAME_UPSTREAM"
exit 1
fi
PKG_SRC="$SAGE_DISTFILES/$PKG_NAME_UPSTREAM"
# Do a final check that PKG_SRC is a file with an absolute path
cd /
if [ ! -f "$PKG_SRC" ]; then
Expand Down Expand Up @@ -509,9 +509,7 @@ else
# just copy to dist/ and create a simple install script.
mkdir -p dist
cp "$PKG_SRC" dist/
if [ ! -f spkg-install.in ]; then
echo "sdh_store_and_pip_install_wheel ." > spkg-install.in
fi
echo "sdh_store_and_pip_install_wheel ." > spkg-install.in
;;
*)
# Source tarball
Expand Down
Loading

0 comments on commit 3f205e4

Please sign in to comment.