nbdevAuto 0.3.73__tar.gz → 0.3.75__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nbdevAuto
3
- Version: 0.3.73
3
+ Version: 0.3.75
4
4
  Summary: automating nbdev
5
5
  Author-email: Benedict Thekkel <bthekkel1@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -72,7 +72,7 @@ from nbdevAuto.pdf import PDFreader
72
72
  | [Functions](00_Functions.ipynb) | Dataset and image helpers: reading a list out of a text file, downloading single images or whole search-driven datasets, verifying and resizing what came back, building the folder layout a classifier expects, running a fastai learner over one image, Kaggle competition and dataset shortcuts, and [`graph`](https://bthek1.github.io/nbdevAuto/functions.html#graph), a `graphviz.Digraph` subclass preloaded with a rounded, filled style |
73
73
  | [Automate](01_Automate.ipynb) | The command line surface: the prep/commit/push pipeline, the GitHub and PyPI release halves, the help output that lists them all, and the one-line-per-stage console grid every command reports through |
74
74
  | [PDF Reader](02_PDF_reader.ipynb) | [`PDFreader`](https://bthek1.github.io/nbdevAuto/pdf_reader.html#pdfreader), a class that converts a PDF through `pdf2image` and renders page ranges inline when you slice it (`pdf[0:5]`) |
75
- | [GitHub](03_GitHub.ipynb) | [`ghstatus`](https://bthek1.github.io/nbdevAuto/github.html#ghstatus): reading `.gitmodules`, resolving a token, and asking the GitHub API about every submodule at once - CI runs, Pages deploys, Pages builds, remote `main` shas - plus the `--report` and `--audit` views, the exit codes that keep “absent” apart from “cannot ask”, and `newest_run`, which picks a run by `run_number` because the API’s page order is not a contract |
75
+ | [GitHub](03_GitHub.ipynb) | [`ghstatus`](https://bthek1.github.io/nbdevAuto/github.html#ghstatus): reading `.gitmodules`, resolving a token, and asking the GitHub API about every submodule at once - CI runs, Pages deploys, Pages builds, remote `main` shas - plus the `--report` and `--audit` views, the exit codes that keep “absent” apart from “cannot ask”, and [`newest_run`](https://bthek1.github.io/nbdevAuto/github.html#newest_run), which picks a run by `run_number` because the API’s page order is not a contract |
76
76
  | [Fleet](04_Fleet.ipynb) | [`fleet`](https://bthek1.github.io/nbdevAuto/fleet.html#fleet): running one command across every submodule of a superproject. A walker that reports only what did work and counts the rest, plus the verbs built on it - upload, push, copy, status, update and sync |
77
77
 
78
78
  ------------------------------------------------------------------------
@@ -129,9 +129,9 @@ The parent Knowledge repo’s `justfile` calls [`upload`](https://bthek1.github.
129
129
 
130
130
  ## Releases
131
131
 
132
- This package publishes itself. A `publish.yaml` workflow runs after CI passes on `main` and uploads to PyPI through Trusted Publishing, so no API token is stored in the repository. It reads `__version__` out of `nbdevAuto/__init__.py` and asks PyPI whether that version already exists: a new version is published, an existing one is skipped without failing the build.
132
+ This package publishes itself. A `publish.yaml` workflow runs after CI passes on `main` and uploads to PyPI through Trusted Publishing, so no API token is stored in the repository. It reads `__version__` out of `nbdevAuto/__init__.py` and asks PyPI whether that version already exists: a new version is published, an existing one is skipped without failing the build. Once PyPI accepts it, the same workflow creates the matching GitHub release (tag `<version>`, title `v<version>`, auto-generated notes) with the built wheel and sdist attached, and skips if that release already exists.
133
133
 
134
- Because [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) bumps the patch version on every push, an ordinary commit made with [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) ships a release. A plain `git commit` leaves the version alone and the workflow skips. `gitrelease`, which bumps the minor version and creates the GitHub release and tag, stays a deliberate manual step.
134
+ Because [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) bumps the patch version on every push, an ordinary commit made with [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) ships a release. A plain `git commit` leaves the version alone and the workflow skips. `gitrelease`, which bumps the minor version and creates the GitHub release and tag, stays a deliberate manual step for minor releases.
135
135
 
136
136
  ------------------------------------------------------------------------
137
137
 
@@ -42,7 +42,7 @@ from nbdevAuto.pdf import PDFreader
42
42
  | [Functions](00_Functions.ipynb) | Dataset and image helpers: reading a list out of a text file, downloading single images or whole search-driven datasets, verifying and resizing what came back, building the folder layout a classifier expects, running a fastai learner over one image, Kaggle competition and dataset shortcuts, and [`graph`](https://bthek1.github.io/nbdevAuto/functions.html#graph), a `graphviz.Digraph` subclass preloaded with a rounded, filled style |
43
43
  | [Automate](01_Automate.ipynb) | The command line surface: the prep/commit/push pipeline, the GitHub and PyPI release halves, the help output that lists them all, and the one-line-per-stage console grid every command reports through |
44
44
  | [PDF Reader](02_PDF_reader.ipynb) | [`PDFreader`](https://bthek1.github.io/nbdevAuto/pdf_reader.html#pdfreader), a class that converts a PDF through `pdf2image` and renders page ranges inline when you slice it (`pdf[0:5]`) |
45
- | [GitHub](03_GitHub.ipynb) | [`ghstatus`](https://bthek1.github.io/nbdevAuto/github.html#ghstatus): reading `.gitmodules`, resolving a token, and asking the GitHub API about every submodule at once - CI runs, Pages deploys, Pages builds, remote `main` shas - plus the `--report` and `--audit` views, the exit codes that keep “absent” apart from “cannot ask”, and `newest_run`, which picks a run by `run_number` because the API’s page order is not a contract |
45
+ | [GitHub](03_GitHub.ipynb) | [`ghstatus`](https://bthek1.github.io/nbdevAuto/github.html#ghstatus): reading `.gitmodules`, resolving a token, and asking the GitHub API about every submodule at once - CI runs, Pages deploys, Pages builds, remote `main` shas - plus the `--report` and `--audit` views, the exit codes that keep “absent” apart from “cannot ask”, and [`newest_run`](https://bthek1.github.io/nbdevAuto/github.html#newest_run), which picks a run by `run_number` because the API’s page order is not a contract |
46
46
  | [Fleet](04_Fleet.ipynb) | [`fleet`](https://bthek1.github.io/nbdevAuto/fleet.html#fleet): running one command across every submodule of a superproject. A walker that reports only what did work and counts the rest, plus the verbs built on it - upload, push, copy, status, update and sync |
47
47
 
48
48
  ------------------------------------------------------------------------
@@ -99,9 +99,9 @@ The parent Knowledge repo’s `justfile` calls [`upload`](https://bthek1.github.
99
99
 
100
100
  ## Releases
101
101
 
102
- This package publishes itself. A `publish.yaml` workflow runs after CI passes on `main` and uploads to PyPI through Trusted Publishing, so no API token is stored in the repository. It reads `__version__` out of `nbdevAuto/__init__.py` and asks PyPI whether that version already exists: a new version is published, an existing one is skipped without failing the build.
102
+ This package publishes itself. A `publish.yaml` workflow runs after CI passes on `main` and uploads to PyPI through Trusted Publishing, so no API token is stored in the repository. It reads `__version__` out of `nbdevAuto/__init__.py` and asks PyPI whether that version already exists: a new version is published, an existing one is skipped without failing the build. Once PyPI accepts it, the same workflow creates the matching GitHub release (tag `<version>`, title `v<version>`, auto-generated notes) with the built wheel and sdist attached, and skips if that release already exists.
103
103
 
104
- Because [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) bumps the patch version on every push, an ordinary commit made with [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) ships a release. A plain `git commit` leaves the version alone and the workflow skips. `gitrelease`, which bumps the minor version and creates the GitHub release and tag, stays a deliberate manual step.
104
+ Because [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) bumps the patch version on every push, an ordinary commit made with [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) ships a release. A plain `git commit` leaves the version alone and the workflow skips. `gitrelease`, which bumps the minor version and creates the GitHub release and tag, stays a deliberate manual step for minor releases.
105
105
 
106
106
  ------------------------------------------------------------------------
107
107
 
@@ -0,0 +1 @@
1
+ __version__ = "0.3.75"
@@ -104,17 +104,30 @@ def newest_run(runs):
104
104
  numbered = [r for r in runs if getattr(r, "run_number", None) is not None]
105
105
  return max(numbered, key=lambda r: r.run_number) if numbered else runs[0]
106
106
 
107
- async def _latest_run(gh, sub, candidates, branch="main"):
108
- "Newest run of the first workflow in `candidates` that exists, or None"
107
+ async def _latest_run(gh, sub, candidates, branch="main", head_sha=None):
108
+ """Newest run of the first workflow in `candidates` that exists, or None.
109
+
110
+ With `head_sha`, the run for that exact commit wins, and the branch-wide page is only
111
+ the fallback for a commit that has no run yet. `newest_run` alone is not enough: on
112
+ 2026-10-05 the branch query for DL_methods returned a page whose highest run was #143
113
+ (2026-05-13, failure) while #161 (success) was the newest, so the max of a bad page was
114
+ still a six-month-old FAILURE. Asking for `main`'s own commit cannot be answered with
115
+ another commit's run."""
109
116
  from githubkit.exception import RequestFailed
110
117
  for wf in candidates:
111
118
  try:
112
- r = await gh.rest.actions.async_list_workflow_runs(
113
- sub.owner, sub.repo, wf, branch=branch, per_page=10)
119
+ runs = []
120
+ if head_sha:
121
+ r = await gh.rest.actions.async_list_workflow_runs(
122
+ sub.owner, sub.repo, wf, head_sha=head_sha, per_page=10)
123
+ runs = r.parsed_data.workflow_runs
124
+ if not runs:
125
+ r = await gh.rest.actions.async_list_workflow_runs(
126
+ sub.owner, sub.repo, wf, branch=branch, per_page=10)
127
+ runs = r.parsed_data.workflow_runs
114
128
  except RequestFailed as e:
115
129
  if _missing(e): continue
116
130
  raise
117
- runs = r.parsed_data.workflow_runs
118
131
  if runs:
119
132
  run = newest_run(runs)
120
133
  # conclusion is None while a run is still going, status covers that case
@@ -132,7 +145,7 @@ async def _pages_build(gh, sub):
132
145
  return r.parsed_data.status
133
146
 
134
147
  async def _remote_sha(gh, sub, branch="main", n=7):
135
- "Short sha that `branch` points at on the remote, or None"
148
+ "Sha that `branch` points at on the remote (first `n` chars, all when None), or None"
136
149
  from githubkit.exception import RequestFailed
137
150
  try: r = await gh.rest.git.async_get_ref(sub.owner, sub.repo, f"heads/{branch}")
138
151
  except RequestFailed as e:
@@ -143,11 +156,13 @@ async def _remote_sha(gh, sub, branch="main", n=7):
143
156
  # %% ../nbs/03_GitHub.ipynb #4e0878a3-56be-4568-98f8-57ed92512e50
144
157
  async def repo_status(gh, sub, root=None):
145
158
  "One row: CI run, Pages deploy run, Pages build, and local vs remote sha"
146
- ci, deploy, built, remote = await asyncio.gather(
147
- _latest_run(gh, sub, CI_WORKFLOWS), _latest_run(gh, sub, PAGES_WORKFLOWS),
148
- _pages_build(gh, sub), _remote_sha(gh, sub))
159
+ # main's full sha first, so the run lookups can ask about that exact commit
160
+ head = await _remote_sha(gh, sub, n=None)
161
+ ci, deploy, built = await asyncio.gather(
162
+ _latest_run(gh, sub, CI_WORKFLOWS, head_sha=head),
163
+ _latest_run(gh, sub, PAGES_WORKFLOWS, head_sha=head), _pages_build(gh, sub))
149
164
  return {"path": sub.path, "owner": sub.owner, "repo": sub.repo,
150
- "ci": ci, "deploy": deploy, "built": built, "remote": remote,
165
+ "ci": ci, "deploy": deploy, "built": built, "remote": head and head[:7],
151
166
  "local": local_sha(Path(root or find_root())/sub.path)}
152
167
 
153
168
  def client(token=None):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nbdevAuto
3
- Version: 0.3.73
3
+ Version: 0.3.75
4
4
  Summary: automating nbdev
5
5
  Author-email: Benedict Thekkel <bthekkel1@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -72,7 +72,7 @@ from nbdevAuto.pdf import PDFreader
72
72
  | [Functions](00_Functions.ipynb) | Dataset and image helpers: reading a list out of a text file, downloading single images or whole search-driven datasets, verifying and resizing what came back, building the folder layout a classifier expects, running a fastai learner over one image, Kaggle competition and dataset shortcuts, and [`graph`](https://bthek1.github.io/nbdevAuto/functions.html#graph), a `graphviz.Digraph` subclass preloaded with a rounded, filled style |
73
73
  | [Automate](01_Automate.ipynb) | The command line surface: the prep/commit/push pipeline, the GitHub and PyPI release halves, the help output that lists them all, and the one-line-per-stage console grid every command reports through |
74
74
  | [PDF Reader](02_PDF_reader.ipynb) | [`PDFreader`](https://bthek1.github.io/nbdevAuto/pdf_reader.html#pdfreader), a class that converts a PDF through `pdf2image` and renders page ranges inline when you slice it (`pdf[0:5]`) |
75
- | [GitHub](03_GitHub.ipynb) | [`ghstatus`](https://bthek1.github.io/nbdevAuto/github.html#ghstatus): reading `.gitmodules`, resolving a token, and asking the GitHub API about every submodule at once - CI runs, Pages deploys, Pages builds, remote `main` shas - plus the `--report` and `--audit` views, the exit codes that keep “absent” apart from “cannot ask”, and `newest_run`, which picks a run by `run_number` because the API’s page order is not a contract |
75
+ | [GitHub](03_GitHub.ipynb) | [`ghstatus`](https://bthek1.github.io/nbdevAuto/github.html#ghstatus): reading `.gitmodules`, resolving a token, and asking the GitHub API about every submodule at once - CI runs, Pages deploys, Pages builds, remote `main` shas - plus the `--report` and `--audit` views, the exit codes that keep “absent” apart from “cannot ask”, and [`newest_run`](https://bthek1.github.io/nbdevAuto/github.html#newest_run), which picks a run by `run_number` because the API’s page order is not a contract |
76
76
  | [Fleet](04_Fleet.ipynb) | [`fleet`](https://bthek1.github.io/nbdevAuto/fleet.html#fleet): running one command across every submodule of a superproject. A walker that reports only what did work and counts the rest, plus the verbs built on it - upload, push, copy, status, update and sync |
77
77
 
78
78
  ------------------------------------------------------------------------
@@ -129,9 +129,9 @@ The parent Knowledge repo’s `justfile` calls [`upload`](https://bthek1.github.
129
129
 
130
130
  ## Releases
131
131
 
132
- This package publishes itself. A `publish.yaml` workflow runs after CI passes on `main` and uploads to PyPI through Trusted Publishing, so no API token is stored in the repository. It reads `__version__` out of `nbdevAuto/__init__.py` and asks PyPI whether that version already exists: a new version is published, an existing one is skipped without failing the build.
132
+ This package publishes itself. A `publish.yaml` workflow runs after CI passes on `main` and uploads to PyPI through Trusted Publishing, so no API token is stored in the repository. It reads `__version__` out of `nbdevAuto/__init__.py` and asks PyPI whether that version already exists: a new version is published, an existing one is skipped without failing the build. Once PyPI accepts it, the same workflow creates the matching GitHub release (tag `<version>`, title `v<version>`, auto-generated notes) with the built wheel and sdist attached, and skips if that release already exists.
133
133
 
134
- Because [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) bumps the patch version on every push, an ordinary commit made with [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) ships a release. A plain `git commit` leaves the version alone and the workflow skips. `gitrelease`, which bumps the minor version and creates the GitHub release and tag, stays a deliberate manual step.
134
+ Because [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) bumps the patch version on every push, an ordinary commit made with [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) ships a release. A plain `git commit` leaves the version alone and the workflow skips. `gitrelease`, which bumps the minor version and creates the GitHub release and tag, stays a deliberate manual step for minor releases.
135
135
 
136
136
  ------------------------------------------------------------------------
137
137
 
@@ -1 +0,0 @@
1
- __version__ = "0.3.73"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes