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

Polish the various utility scripts + fix bugs #56

Merged
merged 5 commits into from
Oct 14, 2021

Conversation

pv
Copy link
Contributor

@pv pv commented May 13, 2021

Address the following problems:

  • No scripts get installed on PATH, so they're annoying to use.
  • makestatic.py and extractsagecode.py don't work correctly with current Pyparsing versions
  • Scripts assume Sage is found at ~/bin/sage, Latex files are in cwd, etc.

So:

Add a sagetex-tool script that can be installed on PATH (unlike makestatic.py etc. whose names are not suitable for that). Make sagetex a python package, make the scripts modules inside it, and make setup.py to install sagetex-tool as the command-line entry point. Do this in a way such that all scripts can still be run standalone, and you can also use sagetex.py as a Python module (instead of a package) exactly as previously if you like.

I guess the scripts could also instead be renamed to sagetex-makestatic, sagetex-run etc., so let me know what you think.
Ok, it's simpler to just rename the scripts as sagetex-XXX and mark them and the sagetexparser.py to be installed in setup.py.

Fix some brokenness and inconveniences. This includes a commit cherry-picked from #55 which makes makestatic.py to work again with current pyparsing versions. extractsagecode.py also needed some fixes.

The code assumes Python3 only.

@pv pv force-pushed the script-polish branch 2 times, most recently from f019e55 to 5aaa0c8 Compare May 13, 2021 19:18
pv and others added 4 commits May 13, 2021 22:21
Use argparse for more friendly argument parsing, and rename script
files so that they can be put on PATH. Add them as script files in
setup.py, and install also sagetexparse.py module.
It's working with pyparsing 2.4.7
Add sagestr support.
Sageexample environment is still not supported

(cherry-picked from pull request sagemath#55 by @vincek59)
@pv pv force-pushed the script-polish branch from 5aaa0c8 to 020a788 Compare May 13, 2021 19:24
Fix pyparsing compatibility, and dedent code appropriately.

Also, use a different comment prefix for comments output by the
extraction tool.
@pv pv force-pushed the script-polish branch from 020a788 to 631e43d Compare May 13, 2021 19:35
@dimpase dimpase self-assigned this Oct 14, 2021
@dimpase dimpase merged commit 926485d into sagemath:master Oct 14, 2021
@dimpase
Copy link
Member

dimpase commented Oct 14, 2021

Sorry, I missed this PR back in April, as for some reason notifications on this repo aren't working for me.

Thanks a lot for contributing this.

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

Successfully merging this pull request may close these issues.

3 participants