Skip to content

Commit

Permalink
Trac #31049: "setup.py develop" rewrites the installed sage-version.s…
Browse files Browse the repository at this point in the history
…h as if it is a Python script

(from #31004)

When `configure --enable-editable` is in use (default after #32406), the
installed `sage-version.sh` is corrupted.

... causing:
{{{
$ venv/bin/sage -version
./local/var/lib/sage/venv-python3.10/bin/sage-version.sh: line 3:
__requires__: command not found
./local/var/lib/sage/venv-python3.10/bin/sage-version.sh: line 4: syntax
error near unexpected token `'pkg_resources''
./local/var/lib/sage/venv-python3.10/bin/sage-version.sh: line 4:
`__import__('pkg_resources').require('sagemath-standard==9.7b5')'
}}}

Also affected: `sage-gdb-commands` (#33627)

`setup.py develop` is what `sdh_pip_editable_install` boils down to.

URL: https://trac.sagemath.org/31049
Reported by: mkoeppe
Ticket author(s): Matthias Koeppe
Reviewer(s): John Palmieri
  • Loading branch information
Release Manager committed Jul 24, 2022
2 parents 7f71494 + 5460f8a commit 10247d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/bin/sage-update-version
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ EOF

# Update Sage version file for shell scripts in SAGE_SRC/bin/sage-version.sh
cat <<EOF > "$SAGE_SRC/bin/sage-version.sh"
# Sage version information for shell scripts
# Sage version information for shell scripts.
#
# #31049: The following line is valid shell code but not valid Python code,
# which stops "setup.py develop" from rewriting it as a Python file.
:
# This file is auto-generated by the sage-update-version script, do not edit!
SAGE_VERSION='$SAGE_VERSION'
SAGE_RELEASE_DATE='$SAGE_RELEASE_DATE'
Expand Down
6 changes: 5 additions & 1 deletion src/bin/sage-version.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Sage version information for shell scripts
# Sage version information for shell scripts. The following line is valid shell code
#
# #31049: The following line is valid shell code but not valid Python code,
# which stops "setup.py develop" from rewriting it as a Python file.
:
# This file is auto-generated by the sage-update-version script, do not edit!
SAGE_VERSION='9.7.beta6'
SAGE_RELEASE_DATE='2022-07-24'
Expand Down

0 comments on commit 10247d5

Please sign in to comment.