Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"setup.py develop" rewrites the installed sage-version.sh as if it is a Python script #31049

Closed
mkoeppe opened this issue Dec 14, 2020 · 21 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Dec 14, 2020

(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.

CC: @tobiasdiez @jhpalmieri

Component: scripts

Author: Matthias Koeppe

Branch: 5460f8a

Reviewer: John Palmieri

Issue created by migration from https://trac.sagemath.org/ticket/31049

@mkoeppe mkoeppe added this to the sage-9.3 milestone Dec 14, 2020
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 20, 2021

comment:1

Saving the continuation:

pip install virtualenv embeds absolute path to Python interpreter · Issue #5048 · pypa/pip
pypa/pip#5048

Search — Bitbucket
https://bitbucket.org/search?q=repo%3Adistlib%20ScriptMaker&account=%7Beeed5f62-f24a-4bdd-9190-1966bfb7cf0e%7D

Welcome to distlib’s documentation! — Distlib 0.3.1 documentation
https://distlib.readthedocs.io/en/stable/

pypa / distlib / tests / test_scripts.py — Bitbucket
https://bitbucket.org/pypa/distlib/src/207d4599a330913d51a4c5865745a49e11e851cb/tests/test_scripts.py?at=master#test_scripts.py-24,41,67,113

pypa / distlib / docs / tutorial.rst — Bitbucket
https://bitbucket.org/pypa/distlib/src/207d4599a330913d51a4c5865745a49e11e851cb/docs/tutorial.rst?at=master#tutorial.rst-1159,1163:1164,1185,1226:1227,1277,1279

pip/wheel.py at facc1e56582e60371170c0cb3f955c9c7cd96790 · pypa/pip
https://github.com/pypa/pip/blob/facc1e56582e60371170c0cb3f955c9c7cd96790/src/pip/_internal/operations/install/wheel.py

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 24, 2021

comment:2

Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review of ticket status, priority, and last modification date.

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 Mar 24, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Jul 19, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 18, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 May 3, 2022
@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe changed the title Some virtual env tool rewrites sage-version.sh as if it is a Python script "setup.py develop" rewrites the installed sage-version.sh as if it is a Python script Jul 22, 2022
@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 22, 2022

Dependencies: #33627

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 23, 2022

Changed dependencies from #33627 to none

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 23, 2022

Author: Matthias Koeppe

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 23, 2022

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 23, 2022

Commit: 5460f8a

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 23, 2022

New commits:

5460f8asrc/bin/sage-version.sh: Stop 'setup.py develop' from mistaking this file for a Python file

@mkoeppe

This comment has been minimized.

@jhpalmieri
Copy link
Member

Reviewer: John Palmieri

@jhpalmieri
Copy link
Member

comment:15

I'm not sure why a file with suffix .sh should be treated as a Python file, but this seems to fix the problem.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 23, 2022

comment:16

Thanks!

@vbraun
Copy link
Member

vbraun commented Jul 28, 2022

@jhpalmieri
Copy link
Member

comment:18

By the way, why do the errors in the ticket description not cause the program to quit with an error? I see these in the sagemath_doc_html-none log file, but docbuilding continues nonetheless.

@jhpalmieri
Copy link
Member

Changed commit from 5460f8a to none

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Aug 1, 2022

comment:19

sage-version.sh is invoked by src/bin/sage, which just ignores the error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants