Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitsanj committed Aug 3, 2024
1 parent 105b7ac commit 7333f19
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]
pip install .[dev]
pip install tox-gh-actions
- name: Run the tests
run: tox
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ If you are contributing with documentation please jump to [building documentatio

We need to install the development package before we can run the tests. If anything is confusing below, always resort to the relevant documentation.

For the most basic test runs against python 3.6 use this tox subset (callable after `pip install tox`):
For the most basic test runs against python 3.11 use this tox subset (callable after `pip install tox`):

```bash
tox -e py36
tox -e py311
```

This will just execute the unittests against python 3.6 in a new virtual env. The first run will take longer to setup the virtualenv, but will be fast after that point.
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ recursive-include testbook *.yaml
recursive-include testbook *.keep
recursive-include testbook *.txt

include setup.py
include requirements*.txt
include tox.ini
include pytest.ini
include README.md
Expand Down
22 changes: 8 additions & 14 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# -- Project information -----------------------------------------------------

project = "testbook"
copyright = "2020, nteract team"
copyright = "2024, nteract team"
author = "nteract team"


Expand Down Expand Up @@ -51,7 +51,7 @@

# General information about the project.
project = "testbook"
copyright = "2020, nteract team"
copyright = "2024, nteract team"
author = "nteract team"

# The version info for the project you're documenting, acts as replacement for
Expand All @@ -61,7 +61,7 @@


# The short X.Y version.
version = read_version(project).split(".")[0:2]
version = '.'.join(read_version(project).split(".")[0:2])

# The full version, including alpha/beta/rc tags.
release = read_version(project)
Expand All @@ -71,7 +71,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line foexitr these cases.
language = None
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down Expand Up @@ -109,15 +109,6 @@
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
"**": ["about.html", "navigation.html", "relations.html", "searchbox.html"]
}

html_title = "testbook"

# -- Options for HTMLHelp output ------------------------------------------
Expand Down Expand Up @@ -176,4 +167,7 @@
]

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {"https://docs.python.org/": None}
intersphinx_mapping = {"python": ("https://docs.python.org/", None)}

# Generate heading anchors for h1, h2 and h3.
myst_heading_anchors = 3
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ def test_func(tb):
## Features

- Write conventional unit tests for Jupyter Notebooks
- [Execute all or some specific cells before unit test](usage/index.html#using-execute-to-control-which-cells-are-executed-before-test)
- [Share kernel context across multiple tests](usage/index.html#share-kernel-context-across-multiple-tests) (using pytest fixtures)
- [Support for patching objects](usage/index.html#support-for-patching-objects)
- [Execute all or some specific cells before unit test](usage/index.md#using-execute-to-control-which-cells-are-executed-before-test)
- [Share kernel context across multiple tests](usage/index.md#share-kernel-context-across-multiple-tests) (using pytest fixtures)
- [Support for patching objects](usage/index.md#support-for-patching-objects)
- Inject code into Jupyter notebooks
- Works with any unit testing library - unittest, pytest or nose

Expand Down
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ optional-dependencies.dev = [
"twine>=1.11",
"xmltodict",
]
optional-dependencies.test = [
"myst-parser==0.9.1",
"sphinx>=1.7,<3",
"sphinx-book-theme==0.0.35",
optional-dependencies.docs = [
"myst-parser==3.0.1",
"sphinx==7.4.7",
"sphinx-book-theme==1.1.3",
]

urls.Documentation = "https://testbook.readthedocs.io"
urls.Funding = "https://nteract.io"
urls.Issues = "https://github.com/nteract/testbook/issues"
Expand Down
25 changes: 8 additions & 17 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ python =
3.12: py312

# Linters
[testenv:ruff]
[testenv:lint]
skip_install = true
commands = ruff check

Expand All @@ -28,24 +28,15 @@ commands = check-manifest
description = invoke sphinx-build to build the HTML docs
skip_install = true
deps =
.[sphinx]
extras = docs
.[docs]
commands =
sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" --color -W -bhtml {posargs}
sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" --color -bhtml {posargs}
python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'
python "{toxinidir}/docs/conf.py"
python -c "import docs.conf"

# Distro
[testenv:dist]
skip_install = true
# Have to use /bin/bash or the `*` will cause that argument to get quoted by the tox command line...
commands =
python setup.py bdist_wheel --dist-dir={distdir}
/bin/bash -c 'python -m pip install -U --force-reinstall {distdir}/testbook*.whl'

# ruff
[testenv:ruff]
description = apply ruff linter with desired rules
# Formatter
[testenv:format]
description = apply ruff formatter with desired rules
basepython = python3.11
deps =
ruff
Expand All @@ -64,7 +55,7 @@ basepython =
py310: python3.10
py311: python3.11
py312: python3.12
ruff: python3.11
lint: python3.11
manifest: python3.11
dist: python3.11
docs: python3.11
Expand Down

0 comments on commit 7333f19

Please sign in to comment.