nbdevAuto 0.3.60__tar.gz → 0.3.63__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,5 +1,3 @@
1
- include settings.ini
2
1
  include LICENSE
3
- include CONTRIBUTING.md
4
2
  include README.md
5
3
  recursive-exclude * __pycache__
@@ -0,0 +1,123 @@
1
+ Metadata-Version: 2.4
2
+ Name: nbdevAuto
3
+ Version: 0.3.63
4
+ Summary: automating nbdev
5
+ Author-email: Benedict Thekkel <bthekkel1@gmail.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Repository, https://github.com/bthek1/nbdevAuto
8
+ Project-URL: Documentation, https://bthek1.github.io/nbdevAuto
9
+ Project-URL: Issues, https://github.com/bthek1/nbdevAuto/issues
10
+ Keywords: nbdev,jupyter,notebook,python
11
+ Classifier: Natural Language :: English
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: graphviz
25
+ Requires-Dist: fastcore
26
+ Provides-Extra: gh
27
+ Requires-Dist: githubkit>=0.12; extra == "gh"
28
+ Dynamic: license-file
29
+
30
+ # nbdevAuto
31
+
32
+
33
+ <!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
34
+
35
+ Unlike most sites in this collection, this one documents an **installable library** rather than a topic. `nbdevAuto` exists because the nbdev release cycle is a fixed sequence of commands typed in the same order every time: export the notebooks, run the tests, clean them, bump the version, commit, push, build the docs. Each step is one nbdev call, and forgetting one produces a confusing failure two steps later.
36
+
37
+ The library collapses that sequence into single-word shell commands. It is what `just upload` and `just full_upload` invoke under the hood for every submodule in the parent Knowledge repo.
38
+
39
+ ------------------------------------------------------------------------
40
+
41
+ ## Install
42
+
43
+ ``` sh
44
+ pip install nbdevAuto # the publish-cycle commands and the helpers
45
+ pip install 'nbdevAuto[gh]' # also installs githubkit, which `ghstatus` needs
46
+ ```
47
+
48
+ Requires Python 3.10 or newer.
49
+
50
+ ## Use
51
+
52
+ Every exported function is also a console script, so the common case is a bare word in the terminal at the root of an nbdev project:
53
+
54
+ ``` sh
55
+ upload -m "commit message" # export, test, clean, then add/commit/push
56
+ ```
57
+
58
+ Or import the helpers into a notebook:
59
+
60
+ ``` python
61
+ from nbdevAuto.functions import download_search_images, classify_images
62
+ from nbdevAuto.pdf import PDFreader
63
+ ```
64
+
65
+ ------------------------------------------------------------------------
66
+
67
+ ## Contents
68
+
69
+ | Page | Covers |
70
+ |----|----|
71
+ | [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 |
72
+ | [Automate](01_Automate.ipynb) | The command line surface: the prep/commit/push pipeline, the GitHub and PyPI release halves, and the help output that lists them all |
73
+ | [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]`) |
74
+ | [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 and the exit codes that keep “absent” apart from “cannot ask” |
75
+
76
+ ------------------------------------------------------------------------
77
+
78
+ ## The Command Line Surface
79
+
80
+ Installing the package puts these on your `PATH`. Most are ordinary functions in [Automate](01_Automate.ipynb), exposed as scripts through `[project.scripts]`; [`ghstatus`](https://bthek1.github.io/nbdevAuto/github.html#ghstatus) comes from [GitHub](03_GitHub.ipynb).
81
+
82
+ | Command | Does |
83
+ |----|----|
84
+ | [`prep`](https://bthek1.github.io/nbdevAuto/automate.html#prep) | Bump the version, then export, test and clean the notebooks, refreshing `_quarto.yml` and the README |
85
+ | [`gacp`](https://bthek1.github.io/nbdevAuto/automate.html#gacp) | git add, commit, and push. Without `-m` the commit message is the status output |
86
+ | [`status`](https://bthek1.github.io/nbdevAuto/automate.html#status) | Show the working tree state |
87
+ | [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) | [`prep`](https://bthek1.github.io/nbdevAuto/automate.html#prep) then [`gacp`](https://bthek1.github.io/nbdevAuto/automate.html#gacp), the one you actually type |
88
+ | `gitrelease` | Bump the **minor** version, then tag and create a GitHub release |
89
+ | `piprelease` | Build the sdist and wheel, then upload to PyPI with twine |
90
+ | [`release`](https://bthek1.github.io/nbdevAuto/automate.html#release) | `gitrelease` then `piprelease` |
91
+ | [`ghstatus`](https://bthek1.github.io/nbdevAuto/github.html#ghstatus) | Remote status for every submodule of an nbdev superproject, from the GitHub API. `--report` for the sync view, `--audit` to check `.gitmodules` against the repos the account owns, `--json` for machine output |
92
+ | `h` | Print the list of available commands |
93
+
94
+ Both [`prep`](https://bthek1.github.io/nbdevAuto/automate.html#prep) and [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) take `-p` to choose which version part to increment; it defaults to 2, the patch, so every [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) ships a new version.
95
+
96
+ `piprelease` is the manual path. Pushing to `main` publishes to PyPI on its own: `publish.yaml` runs after CI passes, and skips quietly when the version is already there.
97
+
98
+ [`ghstatus`](https://bthek1.github.io/nbdevAuto/github.html#ghstatus) needs the `gh` extra (`pip install 'nbdevAuto[gh]'`), which brings in `githubkit`. It is an extra rather than a dependency because githubkit pulls pydantic, httpx and hishel behind it, which is a lot of weight for anyone who only wants [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload). Without it the command exits 3 with an install hint rather than a traceback. It takes its token from `$GITHUB_TOKEN` / `$GH_TOKEN`, then `gh auth token`.
99
+
100
+ ------------------------------------------------------------------------
101
+
102
+ ## Where It Is Used
103
+
104
+ The parent Knowledge repo’s `justfile` calls [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) once per submodule. `just upload` runs it only where the working tree is dirty, `just full_upload` runs it everywhere. That is the main consumer, so a change to `automate.py` affects the publish path for every site in the collection.
105
+
106
+ [`ghstatus`](https://bthek1.github.io/nbdevAuto/github.html#ghstatus) is the other half of that loop. [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) pushes to 19 repos and then goes blind: whether each repo’s CI passed and whether its Pages deploy actually landed is invisible from the terminal. `just ci`, `just report` and `just audit` in the parent repo are all thin wrappers around this one command, which answers for the whole fleet in about 1.5 seconds instead of 19 browser tabs.
107
+
108
+ ## Releases
109
+
110
+ 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.
111
+
112
+ 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.
113
+
114
+ ------------------------------------------------------------------------
115
+
116
+ ## Not Covered Yet
117
+
118
+ - **No test notebook for the helpers.** `03_GitHub.ipynb` carries unit tests for its pure functions, but the dataset and image helpers are exercised only by being used, so a broken one surfaces in a downstream repo rather than here.
119
+ - **Undeclared dependencies.** `pyproject.toml` declares `graphviz` and `fastcore`, plus `githubkit` behind the `gh` extra. The helpers additionally import `fastai`, `fastbook`, `fastdownload`, `PIL`, `matplotlib`, `tqdm`, `pdf2image` (with poppler behind it), `nbdev` and `kaggle` (which also needs its credentials). All of those are imported lazily inside the function that needs them, so installing the package and running the console scripts still works - only the specific helper you call fails. Install them yourself.
120
+ - **`core.py` is an empty nbdev stub** (a single `foo`) left over from `00_core.ipynb`, which no longer exists.
121
+ - The docstrings are one-liners, so the rendered API pages are thin. The notebooks carry the real explanation.
122
+
123
+ ------------------------------------------------------------------------
@@ -0,0 +1,94 @@
1
+ # nbdevAuto
2
+
3
+
4
+ <!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
5
+
6
+ Unlike most sites in this collection, this one documents an **installable library** rather than a topic. `nbdevAuto` exists because the nbdev release cycle is a fixed sequence of commands typed in the same order every time: export the notebooks, run the tests, clean them, bump the version, commit, push, build the docs. Each step is one nbdev call, and forgetting one produces a confusing failure two steps later.
7
+
8
+ The library collapses that sequence into single-word shell commands. It is what `just upload` and `just full_upload` invoke under the hood for every submodule in the parent Knowledge repo.
9
+
10
+ ------------------------------------------------------------------------
11
+
12
+ ## Install
13
+
14
+ ``` sh
15
+ pip install nbdevAuto # the publish-cycle commands and the helpers
16
+ pip install 'nbdevAuto[gh]' # also installs githubkit, which `ghstatus` needs
17
+ ```
18
+
19
+ Requires Python 3.10 or newer.
20
+
21
+ ## Use
22
+
23
+ Every exported function is also a console script, so the common case is a bare word in the terminal at the root of an nbdev project:
24
+
25
+ ``` sh
26
+ upload -m "commit message" # export, test, clean, then add/commit/push
27
+ ```
28
+
29
+ Or import the helpers into a notebook:
30
+
31
+ ``` python
32
+ from nbdevAuto.functions import download_search_images, classify_images
33
+ from nbdevAuto.pdf import PDFreader
34
+ ```
35
+
36
+ ------------------------------------------------------------------------
37
+
38
+ ## Contents
39
+
40
+ | Page | Covers |
41
+ |----|----|
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
+ | [Automate](01_Automate.ipynb) | The command line surface: the prep/commit/push pipeline, the GitHub and PyPI release halves, and the help output that lists them all |
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 and the exit codes that keep “absent” apart from “cannot ask” |
46
+
47
+ ------------------------------------------------------------------------
48
+
49
+ ## The Command Line Surface
50
+
51
+ Installing the package puts these on your `PATH`. Most are ordinary functions in [Automate](01_Automate.ipynb), exposed as scripts through `[project.scripts]`; [`ghstatus`](https://bthek1.github.io/nbdevAuto/github.html#ghstatus) comes from [GitHub](03_GitHub.ipynb).
52
+
53
+ | Command | Does |
54
+ |----|----|
55
+ | [`prep`](https://bthek1.github.io/nbdevAuto/automate.html#prep) | Bump the version, then export, test and clean the notebooks, refreshing `_quarto.yml` and the README |
56
+ | [`gacp`](https://bthek1.github.io/nbdevAuto/automate.html#gacp) | git add, commit, and push. Without `-m` the commit message is the status output |
57
+ | [`status`](https://bthek1.github.io/nbdevAuto/automate.html#status) | Show the working tree state |
58
+ | [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) | [`prep`](https://bthek1.github.io/nbdevAuto/automate.html#prep) then [`gacp`](https://bthek1.github.io/nbdevAuto/automate.html#gacp), the one you actually type |
59
+ | `gitrelease` | Bump the **minor** version, then tag and create a GitHub release |
60
+ | `piprelease` | Build the sdist and wheel, then upload to PyPI with twine |
61
+ | [`release`](https://bthek1.github.io/nbdevAuto/automate.html#release) | `gitrelease` then `piprelease` |
62
+ | [`ghstatus`](https://bthek1.github.io/nbdevAuto/github.html#ghstatus) | Remote status for every submodule of an nbdev superproject, from the GitHub API. `--report` for the sync view, `--audit` to check `.gitmodules` against the repos the account owns, `--json` for machine output |
63
+ | `h` | Print the list of available commands |
64
+
65
+ Both [`prep`](https://bthek1.github.io/nbdevAuto/automate.html#prep) and [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) take `-p` to choose which version part to increment; it defaults to 2, the patch, so every [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) ships a new version.
66
+
67
+ `piprelease` is the manual path. Pushing to `main` publishes to PyPI on its own: `publish.yaml` runs after CI passes, and skips quietly when the version is already there.
68
+
69
+ [`ghstatus`](https://bthek1.github.io/nbdevAuto/github.html#ghstatus) needs the `gh` extra (`pip install 'nbdevAuto[gh]'`), which brings in `githubkit`. It is an extra rather than a dependency because githubkit pulls pydantic, httpx and hishel behind it, which is a lot of weight for anyone who only wants [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload). Without it the command exits 3 with an install hint rather than a traceback. It takes its token from `$GITHUB_TOKEN` / `$GH_TOKEN`, then `gh auth token`.
70
+
71
+ ------------------------------------------------------------------------
72
+
73
+ ## Where It Is Used
74
+
75
+ The parent Knowledge repo’s `justfile` calls [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) once per submodule. `just upload` runs it only where the working tree is dirty, `just full_upload` runs it everywhere. That is the main consumer, so a change to `automate.py` affects the publish path for every site in the collection.
76
+
77
+ [`ghstatus`](https://bthek1.github.io/nbdevAuto/github.html#ghstatus) is the other half of that loop. [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) pushes to 19 repos and then goes blind: whether each repo’s CI passed and whether its Pages deploy actually landed is invisible from the terminal. `just ci`, `just report` and `just audit` in the parent repo are all thin wrappers around this one command, which answers for the whole fleet in about 1.5 seconds instead of 19 browser tabs.
78
+
79
+ ## Releases
80
+
81
+ 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.
82
+
83
+ 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.
84
+
85
+ ------------------------------------------------------------------------
86
+
87
+ ## Not Covered Yet
88
+
89
+ - **No test notebook for the helpers.** `03_GitHub.ipynb` carries unit tests for its pure functions, but the dataset and image helpers are exercised only by being used, so a broken one surfaces in a downstream repo rather than here.
90
+ - **Undeclared dependencies.** `pyproject.toml` declares `graphviz` and `fastcore`, plus `githubkit` behind the `gh` extra. The helpers additionally import `fastai`, `fastbook`, `fastdownload`, `PIL`, `matplotlib`, `tqdm`, `pdf2image` (with poppler behind it), `nbdev` and `kaggle` (which also needs its credentials). All of those are imported lazily inside the function that needs them, so installing the package and running the console scripts still works - only the specific helper you call fails. Install them yourself.
91
+ - **`core.py` is an empty nbdev stub** (a single `foo`) left over from `00_core.ipynb`, which no longer exists.
92
+ - The docstrings are one-liners, so the rendered API pages are thin. The notebooks carry the real explanation.
93
+
94
+ ------------------------------------------------------------------------
@@ -0,0 +1 @@
1
+ __version__ = "0.3.63"
@@ -5,18 +5,13 @@ d = { 'settings': { 'branch': 'main',
5
5
  'doc_host': 'https://bthek1.github.io',
6
6
  'git_url': 'https://github.com/bthek1/nbdevAuto',
7
7
  'lib_path': 'nbdevAuto'},
8
- 'syms': { 'nbdevAuto.automate': { 'nbdevAuto.automate.create_env': ('automate.html#create_env', 'nbdevAuto/automate.py'),
9
- 'nbdevAuto.automate.everything': ('automate.html#everything', 'nbdevAuto/automate.py'),
10
- 'nbdevAuto.automate.gacp': ('automate.html#gacp', 'nbdevAuto/automate.py'),
11
- 'nbdevAuto.automate.hello': ('automate.html#hello', 'nbdevAuto/automate.py'),
8
+ 'syms': { 'nbdevAuto.automate': { 'nbdevAuto.automate.gacp': ('automate.html#gacp', 'nbdevAuto/automate.py'),
12
9
  'nbdevAuto.automate.help_output': ('automate.html#help_output', 'nbdevAuto/automate.py'),
13
10
  'nbdevAuto.automate.prep': ('automate.html#prep', 'nbdevAuto/automate.py'),
14
- 'nbdevAuto.automate.reinstall': ('automate.html#reinstall', 'nbdevAuto/automate.py'),
15
11
  'nbdevAuto.automate.release': ('automate.html#release', 'nbdevAuto/automate.py'),
16
12
  'nbdevAuto.automate.release_git': ('automate.html#release_git', 'nbdevAuto/automate.py'),
17
13
  'nbdevAuto.automate.release_pypi': ('automate.html#release_pypi', 'nbdevAuto/automate.py'),
18
14
  'nbdevAuto.automate.status': ('automate.html#status', 'nbdevAuto/automate.py'),
19
- 'nbdevAuto.automate.update': ('automate.html#update', 'nbdevAuto/automate.py'),
20
15
  'nbdevAuto.automate.upload': ('automate.html#upload', 'nbdevAuto/automate.py')},
21
16
  'nbdevAuto.functions': { 'nbdevAuto.functions.classify_images': ('functions.html#classify_images', 'nbdevAuto/functions.py'),
22
17
  'nbdevAuto.functions.create_data_folder': ( 'functions.html#create_data_folder',
@@ -49,6 +44,7 @@ d = { 'settings': { 'branch': 'main',
49
44
  'nbdevAuto.github.ahead_behind': ('github.html#ahead_behind', 'nbdevAuto/github.py'),
50
45
  'nbdevAuto.github.api_error': ('github.html#api_error', 'nbdevAuto/github.py'),
51
46
  'nbdevAuto.github.audit_result': ('github.html#audit_result', 'nbdevAuto/github.py'),
47
+ 'nbdevAuto.github.client': ('github.html#client', 'nbdevAuto/github.py'),
52
48
  'nbdevAuto.github.failures': ('github.html#failures', 'nbdevAuto/github.py'),
53
49
  'nbdevAuto.github.find_root': ('github.html#find_root', 'nbdevAuto/github.py'),
54
50
  'nbdevAuto.github.format_audit': ('github.html#format_audit', 'nbdevAuto/github.py'),
@@ -5,8 +5,7 @@ Docs: https://bthek1.github.io/nbdevAuto/automate.html.md"""
5
5
  # AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/01_Automate.ipynb.
6
6
 
7
7
  # %% auto #0
8
- __all__ = ['prep', 'gacp', 'status', 'upload', 'reinstall', 'update', 'release_git', 'release_pypi', 'release', 'help_output',
9
- 'everything', 'create_env', 'hello']
8
+ __all__ = ['prep', 'gacp', 'status', 'upload', 'release_git', 'release_pypi', 'release', 'help_output']
10
9
 
11
10
  # %% ../nbs/01_Automate.ipynb #6d1499d1-aa55-47d8-92fd-fa056b1fb135
12
11
  from fastcore.script import *
@@ -15,7 +14,7 @@ from fastcore.script import *
15
14
  def prep(
16
15
  p:int = 2, # Increment Part
17
16
  ):
18
- "Export, test, and clean notebooks, and render README if needed"
17
+ "Bump version part `p`, then export, test and clean the notebooks, refreshing _quarto.yml and README"
19
18
 
20
19
  import nbdev.test, nbdev.clean, nbdev.quarto, nbdev.release
21
20
  nbdev.release.nbdev_bump_version(p)
@@ -39,7 +38,7 @@ def prep(
39
38
  def gacp(
40
39
  m:str = '', # Commit message
41
40
  ):
42
- "git add, commit and push to github"
41
+ "git add, commit and push. Without `-m` the commit message is the status output"
43
42
 
44
43
  import subprocess
45
44
  subprocess.run(["git", "add", "."])
@@ -58,7 +57,7 @@ def gacp(
58
57
 
59
58
  # %% ../nbs/01_Automate.ipynb #88017a1b-55c1-4833-aeb6-277a7e5b6314
60
59
  def status():
61
- "git status"
60
+ "Show the working tree state"
62
61
  import subprocess
63
62
  subprocess.run(["git", "status"])
64
63
 
@@ -68,74 +67,31 @@ def upload(
68
67
  m:str = '', # Commit message
69
68
  p:int = 2, #Increment part
70
69
  ):
71
- "prep, then gacp"
70
+ "prep then gacp: the everyday command for shipping a notebook change"
72
71
  prep(p)
73
72
  gacp(m)
74
73
 
75
- # %% ../nbs/01_Automate.ipynb #0f096fc0-0e97-4592-975f-e81e583b2adb
76
- def reinstall():
77
- "runs pip install -e ."
78
- import subprocess
79
- subprocess.run(["pip", "install", "-e", "."])
80
-
81
- # %% ../nbs/01_Automate.ipynb #fa41bc21-ba9f-4097-8c70-4fc1404d325c
82
- def update():
83
- "prep, then reinstall"
84
- prep()
85
- reinstall()
86
-
87
74
  # %% ../nbs/01_Automate.ipynb #dee37b06-c946-4b40-be0f-056e133751ea
88
75
  def release_git():
89
- "release to git"
76
+ "Bump the MINOR version, then tag and create a GitHub release"
90
77
  import nbdev.release
91
78
  nbdev.release.nbdev_bump_version(1)
92
79
  nbdev.release.release_git()
93
80
 
94
81
  # %% ../nbs/01_Automate.ipynb #288708c6-194a-4059-9ff0-ae330079c199
95
82
  def release_pypi():
96
- "release to pypi"
83
+ "Build the sdist and wheel, then upload to PyPI with twine. CI publishes on push, so this is the manual path"
97
84
  import nbdev.release
98
85
  nbdev.release.release_pypi()
99
86
 
100
87
  # %% ../nbs/01_Automate.ipynb #dd798178-9d58-457e-969a-d86a5e8bf875
101
88
  def release():
102
- "release to github and pip"
89
+ "release_git then release_pypi"
103
90
  release_git()
104
91
  release_pypi()
105
92
 
106
93
  # %% ../nbs/01_Automate.ipynb #c4d2bd52-04c4-43fe-890b-b4cb5da8d206
107
94
  def help_output():
108
- "Show help for all console scripts"
95
+ "Print every console script this package installs, with its help"
109
96
  from fastcore.xtras import console_help
110
97
  console_help('nbdevAuto')
111
-
112
- # %% ../nbs/01_Automate.ipynb #3606bcc9-57b1-42e7-842a-5c889485cf88
113
- def everything():
114
- "prep, gacp, release, reinstall"
115
- upload()
116
- update()
117
- release()
118
-
119
- # %% ../nbs/01_Automate.ipynb #8ca135ed-6377-4da1-98e8-fdab288921fb
120
- @call_parse
121
- def create_env(
122
- n:str = 'fast', #Name of the environment
123
- ):
124
- "create conda env for AI"
125
- from pathlib import Path
126
- import subprocess
127
-
128
- subprocess.run(["conda", "create", "-n", f"{n}", "python"])
129
- subprocess.run(["conda", "init"])
130
- subprocess.run(["conda", "activate", f"{n}"], shell=True)
131
- # subprocess.run(["pip", "install", "fastai", "fastcore"])
132
-
133
-
134
- # %% ../nbs/01_Automate.ipynb #16615f52-30f8-4a42-8d73-52355f2c574a
135
- def hello():
136
- import argparse
137
- parser = argparse.ArgumentParser(description='My CLI function.')
138
- parser.add_argument('-n', '--name', type=str, help='Name of the environment', default='fast')
139
- args = parser.parse_args()
140
-
141
- print(f'Hello, {args.name}!')
@@ -6,9 +6,9 @@ Docs: https://bthek1.github.io/nbdevAuto/github.html.md"""
6
6
 
7
7
  # %% auto #0
8
8
  __all__ = ['Submodule', 'CI_WORKFLOWS', 'PAGES_WORKFLOWS', 'FAILED', 'RUNNING', 'BOLD', 'RED', 'YELLOW', 'CYAN', 'DIM', 'OFF',
9
- 'find_root', 'parse_gitmodules', 'resolve_token', 'local_sha', 'api_error', 'repo_status', 'gather_status',
10
- 'format_table', 'failures', 'has_failure', 'git', 'local_state', 'ahead_behind', 'add_local',
11
- 'format_report', 'stale_sections', 'owned_repos', 'self_repo', 'audit_result', 'gather_audit',
9
+ 'find_root', 'parse_gitmodules', 'resolve_token', 'local_sha', 'api_error', 'repo_status', 'client',
10
+ 'gather_status', 'format_table', 'failures', 'has_failure', 'git', 'local_state', 'ahead_behind',
11
+ 'add_local', 'format_report', 'stale_sections', 'owned_repos', 'self_repo', 'audit_result', 'gather_audit',
12
12
  'format_audit', 'ghstatus']
13
13
 
14
14
  # %% ../nbs/03_GitHub.ipynb #519f31cd-5e6f-4ff9-9137-0293e57c0929
@@ -139,15 +139,33 @@ async def repo_status(gh, sub, root=None):
139
139
  "ci": ci, "deploy": deploy, "built": built, "remote": remote,
140
140
  "local": local_sha(Path(root or find_root())/sub.path)}
141
141
 
142
- async def gather_status(subs, token=None, root=None):
143
- "Every row, concurrently, through one client and one connection pool"
142
+ def client(token=None):
143
+ "One githubkit client, with githubkit's response cache turned off"
144
144
  try:
145
145
  from githubkit import GitHub
146
146
  except ImportError:
147
147
  raise ImportError("githubkit is not installed: pip install 'nbdevAuto[gh]'") from None
148
- async with GitHub(token or resolve_token()) as gh:
148
+ # githubkit defaults to http_cache=True. Its default MemCacheStrategy sounds
149
+ # like a dict but is not: githubkit's AsyncMemoryStorage subclasses hishel's
150
+ # AsyncSqliteStorage over a ":memory:" database, so every cached response is a
151
+ # transaction on one shared anysqlite connection. This tool issues ~76 requests
152
+ # concurrently through a single client, and those transactions collide: runs
153
+ # die intermittently on "cannot start a transaction within a transaction" or
154
+ # "bad parameter or other API misuse" and exit 3, which reads as "cannot ask
155
+ # GitHub" on a perfectly healthy fleet. Observed about twice in 40 runs.
156
+ #
157
+ # Caching is the wrong default for this question anyway - the whole point is to
158
+ # see whether the thing just pushed has built yet - and 76 calls against a
159
+ # 5000/hour budget do not need it. Turning it off removes the shared connection
160
+ # from the concurrent path entirely.
161
+ return GitHub(token or resolve_token(), http_cache=False)
162
+
163
+ async def gather_status(subs, token=None, root=None):
164
+ "Every row, concurrently, through one client and one connection pool"
165
+ async with client(token) as gh:
149
166
  return await asyncio.gather(*[repo_status(gh, s, root) for s in subs])
150
167
 
168
+
151
169
  # %% ../nbs/03_GitHub.ipynb #d4d8fd92-b4a2-4479-bd76-df3cc7fc9f77
152
170
  FAILED = {"failure", "timed_out", "cancelled", "action_required", "startup_failure"}
153
171
  RUNNING = {"in_progress", "queued", "requested", "waiting", "pending"}
@@ -287,15 +305,12 @@ def audit_result(subs, login, every, active, stale, exclude=()):
287
305
 
288
306
  async def gather_audit(subs, root, token=None):
289
307
  "The audit, one client, one pass over the account's repos"
290
- try:
291
- from githubkit import GitHub
292
- except ImportError:
293
- raise ImportError("githubkit is not installed: pip install 'nbdevAuto[gh]'") from None
294
- async with GitHub(token or resolve_token()) as gh:
308
+ async with client(token) as gh:
295
309
  login, every, active = await owned_repos(gh)
296
310
  return audit_result(subs, login, every, active, stale_sections(root),
297
311
  exclude=[self_repo(root)])
298
312
 
313
+
299
314
  # %% ../nbs/03_GitHub.ipynb #5e8ec6fc-9878-422c-b4bd-a0ce64dd8234
300
315
  def _wrap(items, width=92):
301
316
  "Comma-joined `items`, wrapped to `width` columns"
@@ -0,0 +1,123 @@
1
+ Metadata-Version: 2.4
2
+ Name: nbdevAuto
3
+ Version: 0.3.63
4
+ Summary: automating nbdev
5
+ Author-email: Benedict Thekkel <bthekkel1@gmail.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Repository, https://github.com/bthek1/nbdevAuto
8
+ Project-URL: Documentation, https://bthek1.github.io/nbdevAuto
9
+ Project-URL: Issues, https://github.com/bthek1/nbdevAuto/issues
10
+ Keywords: nbdev,jupyter,notebook,python
11
+ Classifier: Natural Language :: English
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: graphviz
25
+ Requires-Dist: fastcore
26
+ Provides-Extra: gh
27
+ Requires-Dist: githubkit>=0.12; extra == "gh"
28
+ Dynamic: license-file
29
+
30
+ # nbdevAuto
31
+
32
+
33
+ <!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
34
+
35
+ Unlike most sites in this collection, this one documents an **installable library** rather than a topic. `nbdevAuto` exists because the nbdev release cycle is a fixed sequence of commands typed in the same order every time: export the notebooks, run the tests, clean them, bump the version, commit, push, build the docs. Each step is one nbdev call, and forgetting one produces a confusing failure two steps later.
36
+
37
+ The library collapses that sequence into single-word shell commands. It is what `just upload` and `just full_upload` invoke under the hood for every submodule in the parent Knowledge repo.
38
+
39
+ ------------------------------------------------------------------------
40
+
41
+ ## Install
42
+
43
+ ``` sh
44
+ pip install nbdevAuto # the publish-cycle commands and the helpers
45
+ pip install 'nbdevAuto[gh]' # also installs githubkit, which `ghstatus` needs
46
+ ```
47
+
48
+ Requires Python 3.10 or newer.
49
+
50
+ ## Use
51
+
52
+ Every exported function is also a console script, so the common case is a bare word in the terminal at the root of an nbdev project:
53
+
54
+ ``` sh
55
+ upload -m "commit message" # export, test, clean, then add/commit/push
56
+ ```
57
+
58
+ Or import the helpers into a notebook:
59
+
60
+ ``` python
61
+ from nbdevAuto.functions import download_search_images, classify_images
62
+ from nbdevAuto.pdf import PDFreader
63
+ ```
64
+
65
+ ------------------------------------------------------------------------
66
+
67
+ ## Contents
68
+
69
+ | Page | Covers |
70
+ |----|----|
71
+ | [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 |
72
+ | [Automate](01_Automate.ipynb) | The command line surface: the prep/commit/push pipeline, the GitHub and PyPI release halves, and the help output that lists them all |
73
+ | [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]`) |
74
+ | [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 and the exit codes that keep “absent” apart from “cannot ask” |
75
+
76
+ ------------------------------------------------------------------------
77
+
78
+ ## The Command Line Surface
79
+
80
+ Installing the package puts these on your `PATH`. Most are ordinary functions in [Automate](01_Automate.ipynb), exposed as scripts through `[project.scripts]`; [`ghstatus`](https://bthek1.github.io/nbdevAuto/github.html#ghstatus) comes from [GitHub](03_GitHub.ipynb).
81
+
82
+ | Command | Does |
83
+ |----|----|
84
+ | [`prep`](https://bthek1.github.io/nbdevAuto/automate.html#prep) | Bump the version, then export, test and clean the notebooks, refreshing `_quarto.yml` and the README |
85
+ | [`gacp`](https://bthek1.github.io/nbdevAuto/automate.html#gacp) | git add, commit, and push. Without `-m` the commit message is the status output |
86
+ | [`status`](https://bthek1.github.io/nbdevAuto/automate.html#status) | Show the working tree state |
87
+ | [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) | [`prep`](https://bthek1.github.io/nbdevAuto/automate.html#prep) then [`gacp`](https://bthek1.github.io/nbdevAuto/automate.html#gacp), the one you actually type |
88
+ | `gitrelease` | Bump the **minor** version, then tag and create a GitHub release |
89
+ | `piprelease` | Build the sdist and wheel, then upload to PyPI with twine |
90
+ | [`release`](https://bthek1.github.io/nbdevAuto/automate.html#release) | `gitrelease` then `piprelease` |
91
+ | [`ghstatus`](https://bthek1.github.io/nbdevAuto/github.html#ghstatus) | Remote status for every submodule of an nbdev superproject, from the GitHub API. `--report` for the sync view, `--audit` to check `.gitmodules` against the repos the account owns, `--json` for machine output |
92
+ | `h` | Print the list of available commands |
93
+
94
+ Both [`prep`](https://bthek1.github.io/nbdevAuto/automate.html#prep) and [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) take `-p` to choose which version part to increment; it defaults to 2, the patch, so every [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) ships a new version.
95
+
96
+ `piprelease` is the manual path. Pushing to `main` publishes to PyPI on its own: `publish.yaml` runs after CI passes, and skips quietly when the version is already there.
97
+
98
+ [`ghstatus`](https://bthek1.github.io/nbdevAuto/github.html#ghstatus) needs the `gh` extra (`pip install 'nbdevAuto[gh]'`), which brings in `githubkit`. It is an extra rather than a dependency because githubkit pulls pydantic, httpx and hishel behind it, which is a lot of weight for anyone who only wants [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload). Without it the command exits 3 with an install hint rather than a traceback. It takes its token from `$GITHUB_TOKEN` / `$GH_TOKEN`, then `gh auth token`.
99
+
100
+ ------------------------------------------------------------------------
101
+
102
+ ## Where It Is Used
103
+
104
+ The parent Knowledge repo’s `justfile` calls [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) once per submodule. `just upload` runs it only where the working tree is dirty, `just full_upload` runs it everywhere. That is the main consumer, so a change to `automate.py` affects the publish path for every site in the collection.
105
+
106
+ [`ghstatus`](https://bthek1.github.io/nbdevAuto/github.html#ghstatus) is the other half of that loop. [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) pushes to 19 repos and then goes blind: whether each repo’s CI passed and whether its Pages deploy actually landed is invisible from the terminal. `just ci`, `just report` and `just audit` in the parent repo are all thin wrappers around this one command, which answers for the whole fleet in about 1.5 seconds instead of 19 browser tabs.
107
+
108
+ ## Releases
109
+
110
+ 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.
111
+
112
+ 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.
113
+
114
+ ------------------------------------------------------------------------
115
+
116
+ ## Not Covered Yet
117
+
118
+ - **No test notebook for the helpers.** `03_GitHub.ipynb` carries unit tests for its pure functions, but the dataset and image helpers are exercised only by being used, so a broken one surfaces in a downstream repo rather than here.
119
+ - **Undeclared dependencies.** `pyproject.toml` declares `graphviz` and `fastcore`, plus `githubkit` behind the `gh` extra. The helpers additionally import `fastai`, `fastbook`, `fastdownload`, `PIL`, `matplotlib`, `tqdm`, `pdf2image` (with poppler behind it), `nbdev` and `kaggle` (which also needs its credentials). All of those are imported lazily inside the function that needs them, so installing the package and running the console scripts still works - only the specific helper you call fails. Install them yourself.
120
+ - **`core.py` is an empty nbdev stub** (a single `foo`) left over from `00_core.ipynb`, which no longer exists.
121
+ - The docstrings are one-liners, so the rendered API pages are thin. The notebooks carry the real explanation.
122
+
123
+ ------------------------------------------------------------------------
@@ -1,17 +1,12 @@
1
1
  [console_scripts]
2
- create_env = nbdevAuto.automate:create_env
3
- everything = nbdevAuto.automate:everything
4
2
  gacp = nbdevAuto.automate:gacp
5
3
  ghstatus = nbdevAuto.github:ghstatus
6
4
  gitrelease = nbdevAuto.automate:release_git
7
5
  h = nbdevAuto.automate:help_output
8
- hello = nbdevAuto.automate:hello
9
6
  piprelease = nbdevAuto.automate:release_pypi
10
7
  prep = nbdevAuto.automate:prep
11
- reinstall = nbdevAuto.automate:reinstall
12
8
  release = nbdevAuto.automate:release
13
9
  status = nbdevAuto.automate:status
14
- update = nbdevAuto.automate:update
15
10
  upload = nbdevAuto.automate:upload
16
11
 
17
12
  [nbdev]
@@ -1,5 +1,5 @@
1
1
  [build-system]
2
- requires = ["setuptools>=64"]
2
+ requires = ["setuptools>=77"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
@@ -7,21 +7,35 @@ name = "nbdevAuto"
7
7
  dynamic = ["version"]
8
8
  description = "automating nbdev"
9
9
  readme = "README.md"
10
- requires-python = ">=3.7"
11
- license = {text = "Apache-2.0"}
10
+ requires-python = ">=3.10"
11
+ license = "Apache-2.0"
12
+ license-files = ["LICENSE"]
12
13
  authors = [{name = "Benedict Thekkel", email = "bthekkel1@gmail.com"}]
13
14
  keywords = ['nbdev', 'jupyter', 'notebook', 'python']
14
- classifiers = ["Natural Language :: English", "Intended Audience :: Developers", "Development Status :: 3 - Alpha", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only"]
15
+ classifiers = [
16
+ "Natural Language :: English",
17
+ "Intended Audience :: Developers",
18
+ "Development Status :: 3 - Alpha",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3 :: Only",
21
+ "Programming Language :: Python :: 3.10",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
24
+ "Programming Language :: Python :: 3.13",
25
+ "Programming Language :: Python :: 3.14",
26
+ ]
15
27
  dependencies = ['graphviz', 'fastcore']
16
28
 
17
29
  [project.optional-dependencies]
18
- # githubkit needs Python >=3.9 while this package still supports 3.7, so the
19
- # GitHub status tooling is an extra and every import of it is deferred.
30
+ # An extra, not a dependency: githubkit pulls pydantic + httpx + hishel, which is
31
+ # a lot of weight for anyone who only wants `upload`/`prep`. Every import of it is
32
+ # deferred, and `ghstatus` exits 3 with an install hint when it is absent.
20
33
  gh = ['githubkit>=0.12']
21
34
 
22
35
  [project.urls]
23
36
  Repository = "https://github.com/bthek1/nbdevAuto"
24
37
  Documentation = "https://bthek1.github.io/nbdevAuto"
38
+ Issues = "https://github.com/bthek1/nbdevAuto/issues"
25
39
 
26
40
  [project.entry-points.nbdev]
27
41
  nbdevAuto = "nbdevAuto._modidx:d"
@@ -32,15 +46,10 @@ prep = "nbdevAuto.automate:prep"
32
46
  gacp = "nbdevAuto.automate:gacp"
33
47
  status = "nbdevAuto.automate:status"
34
48
  upload = "nbdevAuto.automate:upload"
35
- reinstall = "nbdevAuto.automate:reinstall"
36
- update = "nbdevAuto.automate:update"
37
49
  gitrelease = "nbdevAuto.automate:release_git"
38
50
  piprelease = "nbdevAuto.automate:release_pypi"
39
51
  release = "nbdevAuto.automate:release"
40
52
  h = "nbdevAuto.automate:help_output"
41
- everything = "nbdevAuto.automate:everything"
42
- create_env = "nbdevAuto.automate:create_env"
43
- hello = "nbdevAuto.automate:hello"
44
53
  ghstatus = "nbdevAuto.github:ghstatus"
45
54
 
46
55
  [tool.setuptools.dynamic]
nbdevauto-0.3.60/PKG-INFO DELETED
@@ -1,128 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: nbdevAuto
3
- Version: 0.3.60
4
- Summary: automating nbdev
5
- Author-email: Benedict Thekkel <bthekkel1@gmail.com>
6
- License: Apache-2.0
7
- Project-URL: Repository, https://github.com/bthek1/nbdevAuto
8
- Project-URL: Documentation, https://bthek1.github.io/nbdevAuto
9
- Keywords: nbdev,jupyter,notebook,python
10
- Classifier: Natural Language :: English
11
- Classifier: Intended Audience :: Developers
12
- Classifier: Development Status :: 3 - Alpha
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3 :: Only
15
- Requires-Python: >=3.7
16
- Description-Content-Type: text/markdown
17
- License-File: LICENSE
18
- Requires-Dist: graphviz
19
- Requires-Dist: fastcore
20
- Provides-Extra: gh
21
- Requires-Dist: githubkit>=0.12; extra == "gh"
22
- Dynamic: license-file
23
-
24
- # nbdevAuto
25
-
26
-
27
- <!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
28
-
29
- Unlike most sites in this collection, this one documents an
30
- **installable library** rather than a topic. `nbdevAuto` exists because
31
- the nbdev release cycle is a fixed sequence of commands typed in the
32
- same order every time: export the notebooks, run the tests, clean them,
33
- bump the version, commit, push, build the docs. Each step is one nbdev
34
- call, and forgetting one produces a confusing failure two steps later.
35
-
36
- The library collapses that sequence into single-word shell commands. It
37
- is what `just upload` and `just full_upload` invoke under the hood for
38
- every submodule in the parent Knowledge repo.
39
-
40
- ------------------------------------------------------------------------
41
-
42
- ## Install
43
-
44
- ``` sh
45
- pip install nbdevAuto
46
- ```
47
-
48
- ## Use
49
-
50
- Every exported function is also a console script, so the common case is
51
- a bare word in the terminal at the root of an nbdev project:
52
-
53
- ``` sh
54
- upload -m "commit message" # export, test, clean, then add/commit/push
55
- ```
56
-
57
- Or import the helpers into a notebook:
58
-
59
- ``` python
60
- from nbdevAuto.functions import download_search_images, classify_images
61
- from nbdevAuto.pdf import PDFreader
62
- ```
63
-
64
- ------------------------------------------------------------------------
65
-
66
- ## Contents
67
-
68
- | Page | Covers |
69
- |----|----|
70
- | [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 |
71
- | [Automate](01_Automate.ipynb) | The command line surface: the prep/commit/push pipeline, GitHub and PyPI releases, reinstall and update, conda environment creation, and the help output that lists them all |
72
- | [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]`) |
73
-
74
- ------------------------------------------------------------------------
75
-
76
- ## The Command Line Surface
77
-
78
- Installing the package puts these on your `PATH`. They are ordinary
79
- functions in [Automate](01_Automate.ipynb), exposed as scripts through
80
- `[project.scripts]`.
81
-
82
- | Command | Does |
83
- |----|----|
84
- | [`prep`](https://bthek1.github.io/nbdevAuto/automate.html#prep) | Export, test, and clean the notebooks, rendering the README if it needs it |
85
- | [`gacp`](https://bthek1.github.io/nbdevAuto/automate.html#gacp) | git add, commit, and push, with `-m` for the message |
86
- | [`status`](https://bthek1.github.io/nbdevAuto/automate.html#status) | Show the working tree state |
87
- | [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) | [`prep`](https://bthek1.github.io/nbdevAuto/automate.html#prep) then [`gacp`](https://bthek1.github.io/nbdevAuto/automate.html#gacp), the one you actually type |
88
- | [`release`](https://bthek1.github.io/nbdevAuto/automate.html#release) | Bump the version, then release to both GitHub and PyPI |
89
- | `gitrelease` / `piprelease` | The two halves of [`release`](https://bthek1.github.io/nbdevAuto/automate.html#release), separately |
90
- | [`reinstall`](https://bthek1.github.io/nbdevAuto/automate.html#reinstall) / [`update`](https://bthek1.github.io/nbdevAuto/automate.html#update) | Reinstall or update the package locally |
91
- | [`everything`](https://bthek1.github.io/nbdevAuto/automate.html#everything) | [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload), [`update`](https://bthek1.github.io/nbdevAuto/automate.html#update), [`release`](https://bthek1.github.io/nbdevAuto/automate.html#release), [`reinstall`](https://bthek1.github.io/nbdevAuto/automate.html#reinstall), in that order |
92
- | [`create_env`](https://bthek1.github.io/nbdevAuto/automate.html#create_env) | Create a conda environment for AI work, named `fast` by default |
93
- | `h` | Print the list of available commands |
94
-
95
- Both [`prep`](https://bthek1.github.io/nbdevAuto/automate.html#prep) and
96
- [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) take
97
- `-p` to choose which version part to increment.
98
-
99
- ------------------------------------------------------------------------
100
-
101
- ## Where It Is Used
102
-
103
- The parent Knowledge repo’s `justfile` calls
104
- [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) once
105
- per submodule. `just upload` runs it only where the working tree is
106
- dirty, `just full_upload` runs it everywhere. That is the main consumer,
107
- so a change to `automate.py` affects the publish path for every site in
108
- the collection.
109
-
110
- ------------------------------------------------------------------------
111
-
112
- ## Not Covered Yet
113
-
114
- - **No test notebook.** The functions are exercised only by being used,
115
- so a broken helper surfaces in a downstream repo rather than here.
116
- - **Undeclared dependencies.** `pyproject.toml` lists only `graphviz`,
117
- but the image helpers import `fastai`, the Kaggle shortcuts need the
118
- Kaggle CLI and its credentials, and
119
- [`PDFreader`](https://bthek1.github.io/nbdevAuto/pdf_reader.html#pdfreader)
120
- needs `pdf2image` with poppler behind it, plus matplotlib. Install
121
- those yourself.
122
- - **`core.py` is an empty nbdev stub** (a single
123
- [`foo`](https://bthek1.github.io/nbdevAuto/core.html#foo)), with no
124
- notebook behind it.
125
- - The docstrings are one-liners, so the rendered API pages are thin. The
126
- notebooks carry the real explanation.
127
-
128
- ------------------------------------------------------------------------
@@ -1,105 +0,0 @@
1
- # nbdevAuto
2
-
3
-
4
- <!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
5
-
6
- Unlike most sites in this collection, this one documents an
7
- **installable library** rather than a topic. `nbdevAuto` exists because
8
- the nbdev release cycle is a fixed sequence of commands typed in the
9
- same order every time: export the notebooks, run the tests, clean them,
10
- bump the version, commit, push, build the docs. Each step is one nbdev
11
- call, and forgetting one produces a confusing failure two steps later.
12
-
13
- The library collapses that sequence into single-word shell commands. It
14
- is what `just upload` and `just full_upload` invoke under the hood for
15
- every submodule in the parent Knowledge repo.
16
-
17
- ------------------------------------------------------------------------
18
-
19
- ## Install
20
-
21
- ``` sh
22
- pip install nbdevAuto
23
- ```
24
-
25
- ## Use
26
-
27
- Every exported function is also a console script, so the common case is
28
- a bare word in the terminal at the root of an nbdev project:
29
-
30
- ``` sh
31
- upload -m "commit message" # export, test, clean, then add/commit/push
32
- ```
33
-
34
- Or import the helpers into a notebook:
35
-
36
- ``` python
37
- from nbdevAuto.functions import download_search_images, classify_images
38
- from nbdevAuto.pdf import PDFreader
39
- ```
40
-
41
- ------------------------------------------------------------------------
42
-
43
- ## Contents
44
-
45
- | Page | Covers |
46
- |----|----|
47
- | [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 |
48
- | [Automate](01_Automate.ipynb) | The command line surface: the prep/commit/push pipeline, GitHub and PyPI releases, reinstall and update, conda environment creation, and the help output that lists them all |
49
- | [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]`) |
50
-
51
- ------------------------------------------------------------------------
52
-
53
- ## The Command Line Surface
54
-
55
- Installing the package puts these on your `PATH`. They are ordinary
56
- functions in [Automate](01_Automate.ipynb), exposed as scripts through
57
- `[project.scripts]`.
58
-
59
- | Command | Does |
60
- |----|----|
61
- | [`prep`](https://bthek1.github.io/nbdevAuto/automate.html#prep) | Export, test, and clean the notebooks, rendering the README if it needs it |
62
- | [`gacp`](https://bthek1.github.io/nbdevAuto/automate.html#gacp) | git add, commit, and push, with `-m` for the message |
63
- | [`status`](https://bthek1.github.io/nbdevAuto/automate.html#status) | Show the working tree state |
64
- | [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) | [`prep`](https://bthek1.github.io/nbdevAuto/automate.html#prep) then [`gacp`](https://bthek1.github.io/nbdevAuto/automate.html#gacp), the one you actually type |
65
- | [`release`](https://bthek1.github.io/nbdevAuto/automate.html#release) | Bump the version, then release to both GitHub and PyPI |
66
- | `gitrelease` / `piprelease` | The two halves of [`release`](https://bthek1.github.io/nbdevAuto/automate.html#release), separately |
67
- | [`reinstall`](https://bthek1.github.io/nbdevAuto/automate.html#reinstall) / [`update`](https://bthek1.github.io/nbdevAuto/automate.html#update) | Reinstall or update the package locally |
68
- | [`everything`](https://bthek1.github.io/nbdevAuto/automate.html#everything) | [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload), [`update`](https://bthek1.github.io/nbdevAuto/automate.html#update), [`release`](https://bthek1.github.io/nbdevAuto/automate.html#release), [`reinstall`](https://bthek1.github.io/nbdevAuto/automate.html#reinstall), in that order |
69
- | [`create_env`](https://bthek1.github.io/nbdevAuto/automate.html#create_env) | Create a conda environment for AI work, named `fast` by default |
70
- | `h` | Print the list of available commands |
71
-
72
- Both [`prep`](https://bthek1.github.io/nbdevAuto/automate.html#prep) and
73
- [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) take
74
- `-p` to choose which version part to increment.
75
-
76
- ------------------------------------------------------------------------
77
-
78
- ## Where It Is Used
79
-
80
- The parent Knowledge repo’s `justfile` calls
81
- [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) once
82
- per submodule. `just upload` runs it only where the working tree is
83
- dirty, `just full_upload` runs it everywhere. That is the main consumer,
84
- so a change to `automate.py` affects the publish path for every site in
85
- the collection.
86
-
87
- ------------------------------------------------------------------------
88
-
89
- ## Not Covered Yet
90
-
91
- - **No test notebook.** The functions are exercised only by being used,
92
- so a broken helper surfaces in a downstream repo rather than here.
93
- - **Undeclared dependencies.** `pyproject.toml` lists only `graphviz`,
94
- but the image helpers import `fastai`, the Kaggle shortcuts need the
95
- Kaggle CLI and its credentials, and
96
- [`PDFreader`](https://bthek1.github.io/nbdevAuto/pdf_reader.html#pdfreader)
97
- needs `pdf2image` with poppler behind it, plus matplotlib. Install
98
- those yourself.
99
- - **`core.py` is an empty nbdev stub** (a single
100
- [`foo`](https://bthek1.github.io/nbdevAuto/core.html#foo)), with no
101
- notebook behind it.
102
- - The docstrings are one-liners, so the rendered API pages are thin. The
103
- notebooks carry the real explanation.
104
-
105
- ------------------------------------------------------------------------
@@ -1 +0,0 @@
1
- __version__ = "0.3.60"
@@ -1,128 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: nbdevAuto
3
- Version: 0.3.60
4
- Summary: automating nbdev
5
- Author-email: Benedict Thekkel <bthekkel1@gmail.com>
6
- License: Apache-2.0
7
- Project-URL: Repository, https://github.com/bthek1/nbdevAuto
8
- Project-URL: Documentation, https://bthek1.github.io/nbdevAuto
9
- Keywords: nbdev,jupyter,notebook,python
10
- Classifier: Natural Language :: English
11
- Classifier: Intended Audience :: Developers
12
- Classifier: Development Status :: 3 - Alpha
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3 :: Only
15
- Requires-Python: >=3.7
16
- Description-Content-Type: text/markdown
17
- License-File: LICENSE
18
- Requires-Dist: graphviz
19
- Requires-Dist: fastcore
20
- Provides-Extra: gh
21
- Requires-Dist: githubkit>=0.12; extra == "gh"
22
- Dynamic: license-file
23
-
24
- # nbdevAuto
25
-
26
-
27
- <!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
28
-
29
- Unlike most sites in this collection, this one documents an
30
- **installable library** rather than a topic. `nbdevAuto` exists because
31
- the nbdev release cycle is a fixed sequence of commands typed in the
32
- same order every time: export the notebooks, run the tests, clean them,
33
- bump the version, commit, push, build the docs. Each step is one nbdev
34
- call, and forgetting one produces a confusing failure two steps later.
35
-
36
- The library collapses that sequence into single-word shell commands. It
37
- is what `just upload` and `just full_upload` invoke under the hood for
38
- every submodule in the parent Knowledge repo.
39
-
40
- ------------------------------------------------------------------------
41
-
42
- ## Install
43
-
44
- ``` sh
45
- pip install nbdevAuto
46
- ```
47
-
48
- ## Use
49
-
50
- Every exported function is also a console script, so the common case is
51
- a bare word in the terminal at the root of an nbdev project:
52
-
53
- ``` sh
54
- upload -m "commit message" # export, test, clean, then add/commit/push
55
- ```
56
-
57
- Or import the helpers into a notebook:
58
-
59
- ``` python
60
- from nbdevAuto.functions import download_search_images, classify_images
61
- from nbdevAuto.pdf import PDFreader
62
- ```
63
-
64
- ------------------------------------------------------------------------
65
-
66
- ## Contents
67
-
68
- | Page | Covers |
69
- |----|----|
70
- | [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 |
71
- | [Automate](01_Automate.ipynb) | The command line surface: the prep/commit/push pipeline, GitHub and PyPI releases, reinstall and update, conda environment creation, and the help output that lists them all |
72
- | [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]`) |
73
-
74
- ------------------------------------------------------------------------
75
-
76
- ## The Command Line Surface
77
-
78
- Installing the package puts these on your `PATH`. They are ordinary
79
- functions in [Automate](01_Automate.ipynb), exposed as scripts through
80
- `[project.scripts]`.
81
-
82
- | Command | Does |
83
- |----|----|
84
- | [`prep`](https://bthek1.github.io/nbdevAuto/automate.html#prep) | Export, test, and clean the notebooks, rendering the README if it needs it |
85
- | [`gacp`](https://bthek1.github.io/nbdevAuto/automate.html#gacp) | git add, commit, and push, with `-m` for the message |
86
- | [`status`](https://bthek1.github.io/nbdevAuto/automate.html#status) | Show the working tree state |
87
- | [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) | [`prep`](https://bthek1.github.io/nbdevAuto/automate.html#prep) then [`gacp`](https://bthek1.github.io/nbdevAuto/automate.html#gacp), the one you actually type |
88
- | [`release`](https://bthek1.github.io/nbdevAuto/automate.html#release) | Bump the version, then release to both GitHub and PyPI |
89
- | `gitrelease` / `piprelease` | The two halves of [`release`](https://bthek1.github.io/nbdevAuto/automate.html#release), separately |
90
- | [`reinstall`](https://bthek1.github.io/nbdevAuto/automate.html#reinstall) / [`update`](https://bthek1.github.io/nbdevAuto/automate.html#update) | Reinstall or update the package locally |
91
- | [`everything`](https://bthek1.github.io/nbdevAuto/automate.html#everything) | [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload), [`update`](https://bthek1.github.io/nbdevAuto/automate.html#update), [`release`](https://bthek1.github.io/nbdevAuto/automate.html#release), [`reinstall`](https://bthek1.github.io/nbdevAuto/automate.html#reinstall), in that order |
92
- | [`create_env`](https://bthek1.github.io/nbdevAuto/automate.html#create_env) | Create a conda environment for AI work, named `fast` by default |
93
- | `h` | Print the list of available commands |
94
-
95
- Both [`prep`](https://bthek1.github.io/nbdevAuto/automate.html#prep) and
96
- [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) take
97
- `-p` to choose which version part to increment.
98
-
99
- ------------------------------------------------------------------------
100
-
101
- ## Where It Is Used
102
-
103
- The parent Knowledge repo’s `justfile` calls
104
- [`upload`](https://bthek1.github.io/nbdevAuto/automate.html#upload) once
105
- per submodule. `just upload` runs it only where the working tree is
106
- dirty, `just full_upload` runs it everywhere. That is the main consumer,
107
- so a change to `automate.py` affects the publish path for every site in
108
- the collection.
109
-
110
- ------------------------------------------------------------------------
111
-
112
- ## Not Covered Yet
113
-
114
- - **No test notebook.** The functions are exercised only by being used,
115
- so a broken helper surfaces in a downstream repo rather than here.
116
- - **Undeclared dependencies.** `pyproject.toml` lists only `graphviz`,
117
- but the image helpers import `fastai`, the Kaggle shortcuts need the
118
- Kaggle CLI and its credentials, and
119
- [`PDFreader`](https://bthek1.github.io/nbdevAuto/pdf_reader.html#pdfreader)
120
- needs `pdf2image` with poppler behind it, plus matplotlib. Install
121
- those yourself.
122
- - **`core.py` is an empty nbdev stub** (a single
123
- [`foo`](https://bthek1.github.io/nbdevAuto/core.html#foo)), with no
124
- notebook behind it.
125
- - The docstrings are one-liners, so the rendered API pages are thin. The
126
- notebooks carry the real explanation.
127
-
128
- ------------------------------------------------------------------------
File without changes
File without changes
File without changes
File without changes