Skip to content

Commit

Permalink
Merge pull request #215 from connorferster/chores/remove_nbconvert_ex…
Browse files Browse the repository at this point in the history
…porters

Chores/remove nbconvert exporters
  • Loading branch information
connorferster authored Jun 27, 2024
2 parents 3579abd + 366e3ce commit 7809aa4
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 100 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ You can install using pip:

`pip install handcalcs`

To install the optional nbconvert "no input" exporters, use:

`pip install "handcalcs[exporters]"`

**NEW**

As of v1.9.0, handcalcs no longer installs the "no input" nbconvert exporters. This was done to lighten the installation load of handcalcs and to ensure the package has appropriate scope. The nbconvert exporters are now "out of scope" and are separately maintained at [https://github.com/connorferster/nb-hideinputs](nb-hideinputs).

## Basic Usage 1: As a Jupyter cell magic (`%%render`)
`handcalcs` is intended to be used with either Jupyter Notebook or Jupyter Lab as a _cell magic_.

Expand Down
47 changes: 0 additions & 47 deletions handcalcs/exporters.py

This file was deleted.

16 changes: 8 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ classifiers = ["License :: OSI Approved :: Apache Software License"]
dynamic = ["version", "description"]
dependencies = [
"more_itertools",
"nbconvert >= 7.0.0",
"innerscope >= 0.7.0",
"pyparsing"
]
Expand All @@ -22,27 +21,28 @@ Source = "https://github.com/connorferster/handcalcs"

[project.optional-dependencies]

exporters = [
"nb-hideinputs",
]

test = [
"pytest >= 8.0.0",
"pytest-cov >= 4.1.0",
"coverage[toml] >= 5.5.0",
"pint >= 0.23",
"sympy",
]

dev = [
"jupyterlab >= 4.0.0",
"sympy",
"forallpeople >= 2.0",
"black"
"black",
"pint >= 0.23",
"sympy",
]

doc = ["sphinx"]

[project.entry-points."nbconvert.exporters"]
HTML_NoInput = 'handcalcs.exporters:HTMLHideInputExporter'
PDF_NoInput = 'handcalcs.exporters:PDFHideInputExporter'
LaTeX_NoInput = 'handcalcs.exporters:LatexHideInputExporter'

[tool.coverage.paths]
source = ['handcalcs', '*/site-packages']

Expand Down
33 changes: 0 additions & 33 deletions test_handcalcs/test_handcalcs_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,8 @@
import inspect
from collections import deque

from handcalcs.exporters import (
LatexHideInputExporter,
HTMLHideInputExporter,
PDFHideInputExporter,
)

import handcalcs
import pathlib
import pytest
import nbconvert
import filecmp
import forallpeople as si


Expand Down Expand Up @@ -353,30 +344,6 @@ def test_handcalcs3():
assert func_3(4, 5) == {"x": 4, "y": 5, "a": 8, "b": 29}


# Test template.py


def test_latex_exporter():
exporter = LatexHideInputExporter()
assert exporter.exclude_input == True
parent = exporter.__class__.__bases__[0]()
assert parent.exclude_input == False


def test_pdf_exporter():
exporter = PDFHideInputExporter()
assert exporter.exclude_input == True
parent = exporter.__class__.__bases__[0]()
assert parent.exclude_input == False


def test_html_exporter():
exporter = HTMLHideInputExporter()
assert exporter.exclude_input == True
parent = exporter.__class__.__bases__[0]()
assert parent.exclude_input == False


# Test expected exceptions


Expand Down
7 changes: 0 additions & 7 deletions test_handcalcs/test_render_file.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
import inspect
from collections import deque
import handcalcs
import pathlib
import pytest
import nbconvert
import filecmp


from IPython.testing.globalipapp import start_ipython
from IPython.utils.io import capture_output
from IPython.display import Latex


@pytest.fixture(scope="session")
Expand Down
5 changes: 0 additions & 5 deletions test_handcalcs/test_sympy_kit.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import inspect
from collections import deque
from handcalcs.handcalcs import CalcLine, round_and_render_line_objects_to_latex
import handcalcs.sympy_kit as sk
import handcalcs.global_config
import pathlib
import pytest
import nbconvert
import filecmp
import sympy as sp

a, b = sp.symbols("a b")
Expand Down

0 comments on commit 7809aa4

Please sign in to comment.