Skip to content

Commit

Permalink
more pages (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
bollwyvl authored Nov 29, 2023
1 parent 18f619d commit 3078415
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 12 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ jobs:
miniforge-variant: Mambaforge
use-mamba: true
- run: doit bootstrap
env:
JPYK_LOG_NAME: bootstrap
- run: doit shave:git:*
env:
JPYK_LOG_NAME: git
Expand All @@ -37,6 +35,10 @@ jobs:
- uses: actions/upload-pages-artifact@v1
with:
path: build/docs
- if: failure()
uses: actions/upload-artifact@v3
with:
path: work/logs

deploy:
needs: build
Expand Down
15 changes: 14 additions & 1 deletion dodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import doit.reporter

os.environ.update(
PYTHONUNBUFFERED="1",
PIP_DISABLE_PIP_VERSION_CHECK="1",
PYDEVD_DISABLE_FILE_VALIDATION="1",
JPYK_SELF="1",
)
Expand Down Expand Up @@ -137,12 +139,23 @@ def __init__(self, outstream, options=None): # pylint: disable=W0613

def get_status(self, task):
"""Called when task is selected (check if up-to-date)"""
print(f"- {task.name}: >", file=self._old_out, flush=True)
self.t_results[task.name] = TaskResult(task)

def skip_uptodate(self, task):
"""Skipped up-to-date task"""
super().skip_uptodate(task)
print(" ...", file=self._old_out, flush=True)

def skip_ignore(self, task):
"""Skipped ignored task"""
super().skip_ignore(task)
print(" ...", file=self._old_out, flush=True)

def add_success(self, task):
"""Called when execution finishes successfully"""
super().add_success(task)
print(".", file=self._old_out, end="")
print(" ok", file=self._old_out, flush=True)

def complete_run(self):
"""Called when finished running all tasks"""
Expand Down
7 changes: 6 additions & 1 deletion src/jupyak/tasks/_git.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,18 @@
" tasks = []\n",
" targets = []\n",
" file_dep += [work_path / W.GITCONFIG]\n",
" fetch = [\"fetch\", \"--no-tags\"]\n",
"\n",
" if len(urls) == 1:\n",
" fetch += [\"--depth=1\"]\n",
"\n",
" for url in urls:\n",
" remote_ref, local_ref, target = _url_to_refs_and_target(url, work_path)\n",
" task = dict(\n",
" name=f\"{name}:fetch:{local_ref}\",\n",
" doc=f\"> fetch {name} at `{remote_ref}` to `{local_ref}`\",\n",
" actions=[\n",
" A.git([\"fetch\", \"origin\", f\"{remote_ref}:{local_ref}\"], in_repo),\n",
" A.git([*fetch, \"origin\", f\"{remote_ref}:{local_ref}\"], in_repo),\n",
" ],\n",
" file_dep=file_dep,\n",
" targets=[target],\n",
Expand Down
21 changes: 16 additions & 5 deletions src/jupyak/tasks/_js.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
" yield dict(\n",
" name=\"not-a-package\",\n",
" doc=\"> create an empty project which can be linked against to avoid downloading/solving\",\n",
" uptodate=[doit.tools.config_changed(NOT_A_PACKAGE)],\n",
" targets=[yak.not_a_package_json],\n",
" actions=[(_write_not_a_package, [yak.not_a_package_json])],\n",
" )\n",
Expand Down Expand Up @@ -119,6 +120,20 @@
" )"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "13ef6647-ece1-4220-99c6-c1971997a616",
"metadata": {},
"outputs": [],
"source": [
"NOT_A_PACKAGE = {\n",
" \"name\": \"not-a-package\",\n",
" \"description\": \"not-a-package for painful resolutions\",\n",
" \"version\": \"0.0.0\",\n",
"}"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -130,11 +145,7 @@
" package_json.parent.mkdir(parents=True, exist_ok=True)\n",
" package_json.write_text(\n",
" json.dumps(\n",
" {\n",
" \"name\": \"not-a-package\",\n",
" \"description\": \"not-a-package for painful resolutions\",\n",
" \"version\": \"0.0.0\",\n",
" },\n",
" NOT_A_PACKAGE,\n",
" indent=2,\n",
" sort_keys=True,\n",
" ),\n",
Expand Down
4 changes: 3 additions & 1 deletion src/jupyak/tasks/_self.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"import re\n",
"from pathlib import Path\n",
"\n",
"import doit\n",
"import importnb\n",
"\n",
"import jupyak\n",
Expand Down Expand Up @@ -139,10 +140,11 @@
"source": [
"def task_docs():\n",
" for svg in ALL_DOCS_SVG:\n",
" tmp = BUILD / svg.name\n",
" tmp = BUILD / \"scour\" / svg.name\n",
" yield dict(\n",
" name=f\"scour:{svg.name}\",\n",
" actions=[\n",
" (doit.tools.create_folder, [tmp.parent]),\n",
" [*SCOUR_ARGS, svg, tmp],\n",
" (A.copy, [svg, tmp]),\n",
" (A.clean, [tmp]),\n",
Expand Down
4 changes: 2 additions & 2 deletions src/jupyak/tasks/_yak.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@
" \"hatch\",\n",
" \"hatch-jupyter-builder\",\n",
" \"jupyter-packaging\",\n",
" \"mypy\",\n",
" \"python-build\",\n",
" \"python-libarchive-c\",\n",
" ),\n",
" help=\"the names of conda (or pip) packages to install\",\n",
" help=\"the names of conda packages (or a `pip:` object) to install\",\n",
" )\n",
" pypi_to_conda = T.Dict().tag(sync=True)\n",
"\n",
Expand Down

0 comments on commit 3078415

Please sign in to comment.