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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,26 @@ E2.sobj
auto/
dist/
example.synctex.gz
extractsagecode.py
makecmds.sty
makestatic.py
remote-sagetex.py
run-sagetex-if-necessary.py
sagetex-extract
sagetex-extract.py
sagetex-makestatic
sagetex-makestatic.py
sagetex-remote
sagetex-remote.py
sagetex-run
sagetex-run.py
sage-plots-for-*.tex/
sagetex.glo
sagetex.gls
sagetex.idx
sagetex.ilg
sagetex.ind
sagetex.py
sagetex.pyc
sagetex.sty
sagetexparse.py
*.pyc
__pycache__
.*.sage-history
.*.sage-chat
MANIFEST
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ pkg=sagetex
dtxs=$(wildcard *.dtx)
# the subdir stuff makes the tarball have the directory correct
srcs=example.tex README sagetex.ins
pyscripts=sagetex-run sagetex-extract sagetex-makestatic sagetex-remote

.SUFFIXES:

all: sagetex.sty sagetex.py example.pdf $(pkg).pdf
all: sagetex.sty sagetex.py $(pyscripts) $(pkg).pdf example.pdf

# just depend on the .ind file, since we'll make the .gls and .ind together;
# TEXOPTS is used by spkg-install to specify nonstopmode when building docs
Expand Down Expand Up @@ -35,14 +36,18 @@ sagetex.sty: py-and-sty.dtx $(pkg).dtx
sagetex.py: py-and-sty.dtx $(pkg).dtx
yes | latex $(TEXOPTS) $(pkg).ins

remote-sagetex.py: remote-sagetex.dtx
sagetex-remote.py: remote-sagetex.dtx
yes | latex $(TEXOPTS) $(pkg).ins

run-sagetex-if-necessary.py makestatic.py extractsagecode.py sagetexparse.py: scripts.dtx
sagetex-run.py sagetex-extract.py sagetex-makestatic.py sagetexparse.py: scripts.dtx
yes | latex $(TEXOPTS) $(pkg).ins

%: %.py
cp -f $< $@
chmod +x $@

clean: auxclean
rm -fr sage-plots-for-* E2.sobj *.pyc sagetex.tar.gz sagetex.py sagetex.pyc sagetex.sty makestatic.py sagetexparse.py extractsagecode.py dist MANIFEST remote-sagetex.py auto *_doctest.sage *_doctest.sage.py example-*.table run-sagetex-if-necessary.py __pycache__
rm -fr sage-plots-for-* E2.sobj *.pyc sagetex.tar.gz sagetex.py sagetexparse.py $(pyscripts) $(addsuffix .py,$(pyscripts)) sagetex.sty dist MANIFEST remote-sagetex.py auto *_doctest.sage *_doctest.sage.py example-*.table __pycache__

auxclean:
/bin/bash -c "rm -f {$(pkg),example}.{glo,gls,aux,out,toc,dvi,pdf,ps,log,ilg,ind,idx,fdb_latexmk,sagetex.*}"
Expand All @@ -54,5 +59,5 @@ test:
./test

# make a source distribution, used for building the spkg
dist: sagetex.sty
dist: sagetex.sty $(pypkg) $(pyscripts)
python setup.py sdist --formats=gztar
9 changes: 4 additions & 5 deletions sagetex.ins
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,17 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
\from{py-and-sty.dtx}{python}}}
\generate{\file{sagetexparse.py}{\from{scripts.dtx}{parsermod}}}


\usedir{scripts/sagetex}

% Now define a new preamble with the shebang line at the top.

\def\envpypreamble{\hash!/usr/bin/env python^^J\pypreamble}
\usepreamble\envpypreamble

\generate{\file{run-sagetex-if-necessary.py}{\from{scripts.dtx}{ifnecessaryscript}}}
\generate{\file{makestatic.py}{\from{scripts.dtx}{staticscript}}}
\generate{\file{extractsagecode.py}{\from{scripts.dtx}{extractscript}}}
\generate{\file{remote-sagetex.py}{\from{remote-sagetex.dtx}{remotesagetex}}}
\generate{\file{sagetex-run.py}{\from{scripts.dtx}{ifnecessaryscript}}}
\generate{\file{sagetex-makestatic.py}{\from{scripts.dtx}{staticscript}}}
\generate{\file{sagetex-extract.py}{\from{scripts.dtx}{extractscript}}}
\generate{\file{sagetex-remote.py}{\from{remote-sagetex.dtx}{remotesagetex}}}

\obeyspaces
\Msg{******************************************************************}
Expand Down
Loading