generated from miek770/python_uv_package_template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
112 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,33 @@ | ||
[project] | ||
name = "eznbtemplater" | ||
version = "0.1.2" | ||
version = "0.1.3" | ||
authors = [ | ||
{ name="Michel Lavoie", email="[email protected]" }, | ||
] | ||
description = "Generate PDF and Jupyter Notebook files from a Notebook template" | ||
readme = "README.md" | ||
requires-python = ">=3.10" | ||
dependencies = [ | ||
"nbconvert>=7.16.4", | ||
"nbformat>=5.10.4", | ||
] | ||
|
||
packages = [ | ||
{ include = "eznbtemplater" }, | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
] | ||
include = ["eznbtemplater/templates/*"] | ||
|
||
[project.urls] | ||
homepage = "https://github.com/miek770/eznbtemplater" | ||
issues = "https://github.com/miek770/eznbtemplater/issues" | ||
|
||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[tool.hatch.build] | ||
include = ["eznbtemplater/templates/*"] | ||
|
||
[tool.uv] | ||
dev-dependencies = [ | ||
"black>=24.10.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from eznbtemplater.eznbtemplater import render_nb | ||
import nbformat as nbf | ||
from pathlib import Path | ||
|
||
|
||
def test_nb_programatically() -> None: | ||
nb: nbf.NotebookNode = nbf.v4.new_notebook() | ||
nb["cells"] = [ | ||
nbf.v4.new_raw_cell(r"\renewcommand{\contentsname}{Table of Contents}"), | ||
nbf.v4.new_raw_cell(r"\tableofcontents"), | ||
nbf.v4.new_markdown_cell("# Introduction"), | ||
nbf.v4.new_markdown_cell("{{introduction}}"), | ||
] | ||
|
||
output_path: Path = Path("tests/test_nb_programatically.ipynb") | ||
|
||
introduction: str = "This is a ***test***, don't mind me." | ||
render_nb( | ||
template_nb=nb, | ||
output_path=output_path, | ||
introduction=introduction, | ||
) | ||
assert output_path.exists() |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.