PK!hocus_pocus/__init__.pyPK!6XKhocus_pocus/py.pyfrom invoke import task from .util import safe_checkout @task def upload(ctx): # from twine.commands import upload print( "twine upload --repository-url https://$PYPI_SERVER --username $PYPI_USER --password $PYPI_SERVER_PW --skip-existing $WHEELHOUSE/*" ) @task(post=[upload]) def build(ctx): ctx.run("python setup.py sdist bdist_wheel") @task(post=[upload]) def build_all_tags(ctx, repo): for tag in repo.tags: print(f"Building {tag}") with safe_checkout(tag): build(ctx) PK!mhocus_pocus/tex.pyimport os import pathlib from invoke import task LATEX = "latexmk -pdf" def needs_compile(target, sources): if not os.path.exists(target): return True return any(os.path.getmtime(target) < os.path.getmtime(s) for s in sources if s.is_file()) @task def compile_latex(ctx, texfile=None, sources=(), latex=LATEX): if texfile is None: texfile = ctx.compile_latex.texfile texfile = pathlib.Path(texfile) # https://github.com/pyinvoke/invoke/issues/454 with ctx.cd(str(texfile.parent)): target = texfile.with_suffix(".pdf") if needs_compile(target, (texfile,) + tuple(sources)): print(f"Compiling {texfile}") ctx.run(f"{latex} {texfile.name}") return target PK!?սhocus_pocus/util.pyfrom contextlib import contextmanager @contextmanager def safe_checkout(ref, repo): git = repo.git was_dirty = False if repo.is_dirty(): git.stash("save", "include-untracked") was_dirty = True current_branch = repo.head.ref.name print(f"Checking out {ref}") git.checkout(ref) try: yield finally: git.checkout(current_branch) if was_dirty: git.stash("pop") PK!H=jTT!hocus_pocus-0.1.0.dist-info/WHEEL 1 0 нRN&":WhAqo;VSoBtM4[`Z} Mz7M*{/ܒ?֎XPK!Hl:%$$hocus_pocus-0.1.0.dist-info/METADATAQN1+IF I@u2S@m5ds}) {Eт^.y6w%YFGY3?EQ24FfRL !d"K>ѧbps O ȝR̓xҡg6Lw=^;^%NT:[ZgXD_;D`PK!hocus_pocus/__init__.pyPK!6XK5hocus_pocus/py.pyPK!m|hocus_pocus/tex.pyPK!?սhocus_pocus/util.pyPK!H=jTT!hocus_pocus-0.1.0.dist-info/WHEELPK!Hl:%$$hocus_pocus-0.1.0.dist-info/METADATAPK!H]L"{ hocus_pocus-0.1.0.dist-info/RECORDPK